Global Metrics

path: .metrics.mi.mi_sei
old: 16.726940560383678
new: -10.86665816487939

path: .metrics.mi.mi_visual_studio
old: 25.885108818130643
new: 12.772758145733444

path: .metrics.mi.mi_original
old: 44.2635360790034
new: 21.841416429204187

path: .metrics.nexits.average
old: 0.6666666666666666
new: 1.6923076923076923

path: .metrics.nexits.sum
old: 2.0
new: 22.0

path: .metrics.cognitive.average
old: 3.3333333333333335
new: 2.3076923076923075

path: .metrics.cognitive.sum
old: 10.0
new: 30.0

path: .metrics.nargs.average
old: 2.0
new: 0.9230769230769232

path: .metrics.nargs.sum
old: 6.0
new: 12.0

path: .metrics.nom.functions
old: 3.0
new: 13.0

path: .metrics.nom.total
old: 3.0
new: 13.0

path: .metrics.loc.sloc
old: 147.0
new: 318.0

path: .metrics.loc.blank
old: 25.0
new: 19.0

path: .metrics.loc.cloc
old: 20.0
new: 53.0

path: .metrics.loc.ploc
old: 102.0
new: 246.0

path: .metrics.loc.lloc
old: 47.0
new: 89.0

path: .metrics.cyclomatic.average
old: 2.5
new: 2.3125

path: .metrics.cyclomatic.sum
old: 15.0
new: 37.0

path: .metrics.halstead.level
old: 0.02926258291065158
new: 0.029411764705882353

path: .metrics.halstead.vocabulary
old: 97.0
new: 232.0

path: .metrics.halstead.volume
old: 3504.553719201365
new: 8926.66641046492

path: .metrics.halstead.N2
old: 233.0
new: 476.0

path: .metrics.halstead.N1
old: 298.0
new: 660.0

path: .metrics.halstead.length
old: 531.0
new: 1136.0

path: .metrics.halstead.n2
old: 75.0
new: 203.0

path: .metrics.halstead.effort
old: 119762.2824308413
new: 303506.6579558073

path: .metrics.halstead.difficulty
old: 34.17333333333333
new: 34.0

path: .metrics.halstead.n1
old: 22.0
new: 29.0

path: .metrics.halstead.bugs
old: 0.8098889149211501
new: 1.5054195799515386

path: .metrics.halstead.estimated_program_length
old: 565.2688973972116
new: 1696.9446400472902

path: .metrics.halstead.purity_ratio
old: 1.0645365299382517
new: 1.4937892958162766

path: .metrics.halstead.time
old: 6653.460135046738
new: 16861.480997544848

Spaces Data

Minimal test - lines (71, 86)

path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 23.0
new: 28.0

path: .spaces[0].spaces[1].metrics.halstead.effort
old: 1909.7656112662517
new: 1979.027776247047

path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 81.07329781366414
new: 108.27793097483524

path: .spaces[0].spaces[1].metrics.halstead.N2
old: 18.0
new: 26.0

path: .spaces[0].spaces[1].metrics.halstead.volume
old: 194.51316411045156
new: 274.01923055728344

path: .spaces[0].spaces[1].metrics.halstead.time
old: 106.09808951479177
new: 109.9459875692804

path: .spaces[0].spaces[1].metrics.halstead.level
old: 0.10185185185185185
new: 0.13846153846153847

path: .spaces[0].spaces[1].metrics.halstead.N1
old: 25.0
new: 31.0

path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 9.818181818181818
new: 7.222222222222222

path: .spaces[0].spaces[1].metrics.halstead.n2
old: 11.0
new: 18.0

path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 1.885425530550329
new: 1.8996128241199168

path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.05130961916022003
new: 0.05254281522508537

path: .spaces[0].spaces[1].metrics.halstead.length
old: 43.0
new: 57.0

path: .spaces[0].spaces[1].metrics.halstead.n1
old: 12.0
new: 10.0

path: .spaces[0].spaces[1].metrics.nexits.average
old: 1.0
new: 0.0

path: .spaces[0].spaces[1].metrics.nexits.sum
old: 1.0
new: 0.0

path: .spaces[0].spaces[1].metrics.mi.mi_original
old: 111.60965640393994
new: 96.66543159982297

path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 65.26880491458476
new: 56.529492163639155

path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: 85.52148553608146
new: 113.49014212988628

path: .spaces[0].spaces[1].metrics.nargs.average
old: 3.0
new: 1.0

path: .spaces[0].spaces[1].metrics.nargs.sum
old: 3.0
new: 1.0

path: .spaces[0].spaces[1].metrics.loc.cloc
old: 0.0
new: 14.0

path: .spaces[0].spaces[1].metrics.loc.lloc
old: 3.0
new: 2.0

path: .spaces[0].spaces[1].metrics.loc.sloc
old: 7.0
new: 16.0

path: .spaces[0].spaces[1].metrics.loc.ploc
old: 7.0
new: 16.0

path: .spaces[0].spaces[1].metrics.cognitive.sum
old: 1.0
new: 0.0

path: .spaces[0].spaces[1].metrics.cognitive.average
old: 1.0
new: 0.0

path: .spaces[0].spaces[1].metrics.cyclomatic.average
old: 2.0
new: 1.0

path: .spaces[0].spaces[1].metrics.cyclomatic.sum
old: 2.0
new: 1.0

Code

StatusBarEntry::StatusBarEntry(Element* aMenu) : mMenu(aMenu), mInitted(false) {
  mIconData = {/* cbSize */ sizeof(NOTIFYICONDATA),
               /* hWnd */ 0,
               /* uID */ 2,
               /* uFlags */ NIF_ICON | NIF_MESSAGE | NIF_TIP | NIF_SHOWTIP,
               /* uCallbackMessage */ WM_USER,
               /* hIcon */ 0,
               /* szTip */ L"",  // This is updated in Init()
               /* dwState */ 0,
               /* dwStateMask */ 0,
               /* szInfo */ L"",
               /* uVersion */ {NOTIFYICON_VERSION_4},
               /* szInfoTitle */ L"",
               /* dwInfoFlags */ 0};
  MOZ_ASSERT(mMenu);
}

Minimal test - lines (26, 318)

path: .spaces[0].metrics.nexits.average
old: 0.5
new: 1.6923076923076923

path: .spaces[0].metrics.nexits.sum
old: 1.0
new: 22.0

path: .spaces[0].metrics.nargs.average
old: 2.5
new: 0.9230769230769232

path: .spaces[0].metrics.nargs.sum
old: 5.0
new: 12.0

path: .spaces[0].metrics.mi.mi_original
old: 84.58785159426988
new: 23.540286011451315

path: .spaces[0].metrics.mi.mi_visual_studio
old: 49.466579879689995
new: 13.766249129503692

path: .spaces[0].metrics.mi.mi_sei
old: 62.29161055360419
new: -9.003005013420712

path: .spaces[0].metrics.loc.cloc
old: 1.0
new: 47.0

path: .spaces[0].metrics.loc.blank
old: 2.0
new: 17.0

path: .spaces[0].metrics.loc.lloc
old: 8.0
new: 89.0

path: .spaces[0].metrics.loc.ploc
old: 22.0
new: 229.0

path: .spaces[0].metrics.loc.sloc
old: 25.0
new: 293.0

path: .spaces[0].metrics.cyclomatic.average
old: 1.75
new: 2.4

path: .spaces[0].metrics.cyclomatic.sum
old: 7.0
new: 36.0

path: .spaces[0].metrics.nom.functions
old: 2.0
new: 13.0

path: .spaces[0].metrics.nom.total
old: 2.0
new: 13.0

path: .spaces[0].metrics.halstead.n1
old: 15.0
new: 29.0

path: .spaces[0].metrics.halstead.N2
old: 42.0
new: 460.0

path: .spaces[0].metrics.halstead.level
old: 0.0761904761904762
new: 0.0280359820089955

path: .spaces[0].metrics.halstead.vocabulary
old: 39.0
new: 216.0

path: .spaces[0].metrics.halstead.n2
old: 24.0
new: 187.0

path: .spaces[0].metrics.halstead.estimated_program_length
old: 168.64245895143551
new: 1552.1507128576875

path: .spaces[0].metrics.halstead.effort
old: 7006.461316379269
new: 309797.38821476995

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.6697273163508466
new: 1.3858488507657925

path: .spaces[0].metrics.halstead.volume
old: 533.8256241050872
new: 8685.474002423085

path: .spaces[0].metrics.halstead.N1
old: 59.0
new: 660.0

path: .spaces[0].metrics.halstead.length
old: 101.0
new: 1120.0

path: .spaces[0].metrics.halstead.difficulty
old: 13.125
new: 35.668449197860966

path: .spaces[0].metrics.halstead.bugs
old: 0.1220519055595256
new: 1.5261500900990144

path: .spaces[0].metrics.halstead.time
old: 389.2478509099594
new: 17210.966011931665

path: .spaces[0].metrics.cognitive.sum
old: 3.0
new: 30.0

path: .spaces[0].metrics.cognitive.average
old: 1.5
new: 2.3076923076923075

Code

namespace mozilla::widget {

using mozilla::LinkedListElement;
using mozilla::dom::Element;

class StatusBarEntry final : public LinkedListElement>,
                             public IconLoader::Listener,
                             public nsISupports {
 public:
  explicit StatusBarEntry(Element* aMenu);
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_CLASS(StatusBarEntry)
  nsresult Init();
  void Destroy();

  LRESULT OnMessage(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
  const Element* GetMenu() { return mMenu; };

  nsresult OnComplete(imgIContainer* aImage) override;

 private:
  ~StatusBarEntry();
  RefPtr mIconLoader;
  RefPtr mMenu;
  NOTIFYICONDATAW mIconData;
  boolean mInitted;
};

NS_IMPL_CYCLE_COLLECTION_CLASS(StatusBarEntry)

NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(StatusBarEntry)
  tmp->Destroy();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(StatusBarEntry)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIconLoader)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMenu)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END

NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StatusBarEntry)
  NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END

NS_IMPL_CYCLE_COLLECTING_ADDREF(StatusBarEntry)
NS_IMPL_CYCLE_COLLECTING_RELEASE(StatusBarEntry)

StatusBarEntry::StatusBarEntry(Element* aMenu) : mMenu(aMenu), mInitted(false) {
  mIconData = {/* cbSize */ sizeof(NOTIFYICONDATA),
               /* hWnd */ 0,
               /* uID */ 2,
               /* uFlags */ NIF_ICON | NIF_MESSAGE | NIF_TIP | NIF_SHOWTIP,
               /* uCallbackMessage */ WM_USER,
               /* hIcon */ 0,
               /* szTip */ L"",  // This is updated in Init()
               /* dwState */ 0,
               /* dwStateMask */ 0,
               /* szInfo */ L"",
               /* uVersion */ {NOTIFYICON_VERSION_4},
               /* szInfoTitle */ L"",
               /* dwInfoFlags */ 0};
  MOZ_ASSERT(mMenu);
}

StatusBarEntry::~StatusBarEntry() {
  if (!mInitted) {
    return;
  }
  Destroy();
  ::Shell_NotifyIconW(NIM_DELETE, &mIconData);
  VERIFY(::DestroyWindow(mIconData.hWnd));
}

void StatusBarEntry::Destroy() {
  if (mIconLoader) {
    mIconLoader->Destroy();
    mIconLoader = nullptr;
  }
}

nsresult StatusBarEntry::Init() {
  MOZ_ASSERT(NS_IsMainThread());

  // First, look at the content node's "image" attribute.
  nsAutoString imageURIString;
  bool hasImageAttr =
      mMenu->GetAttr(kNameSpaceID_None, nsGkAtoms::image, imageURIString);

  nsresult rv;
  RefPtr sc;
  nsCOMPtr iconURI;
  if (!hasImageAttr) {
    // If the content node has no "image" attribute, get the
    // "list-style-image" property from CSS.
    RefPtr document = mMenu->GetComposedDoc();
    if (!document) {
      return NS_ERROR_FAILURE;
    }

    sc = nsComputedDOMStyle::GetComputedStyle(mMenu, nullptr);
    if (!sc) {
      return NS_ERROR_FAILURE;
    }

    iconURI = sc->StyleList()->GetListStyleImageURI();
  } else {
    uint64_t dummy = 0;
    nsContentPolicyType policyType;
    nsCOMPtr triggeringPrincipal = mMenu->NodePrincipal();
    nsContentUtils::GetContentPolicyTypeForUIImageLoading(
        mMenu, getter_AddRefs(triggeringPrincipal), policyType, &dummy);
    if (policyType != nsIContentPolicy::TYPE_INTERNAL_IMAGE) {
      return NS_ERROR_ILLEGAL_VALUE;
    }

    // If this menu item shouldn't have an icon, the string will be empty,
    // and NS_NewURI will fail.
    rv = NS_NewURI(getter_AddRefs(iconURI), imageURIString);
    if (NS_FAILED(rv)) return rv;
  }

  mIconLoader = new IconLoader(this);

  if (iconURI) {
    rv = mIconLoader->LoadIcon(iconURI, mMenu);
  }

  HWND iconWindow;
  NS_ENSURE_TRUE(iconWindow = ::CreateWindowExW(
                     /* extended style */ 0,
                     /* className */ L"IconWindowClass",
                     /* title */ 0,
                     /* style */ WS_CAPTION,
                     /* x, y, cx, cy */ 0, 0, 0, 0,
                     /* parent */ 0,
                     /* menu */ 0,
                     /* instance */ 0,
                     /* create struct */ 0),
                 NS_ERROR_FAILURE);
  ::SetWindowLongPtr(iconWindow, GWLP_USERDATA, (LONG_PTR)this);

  mIconData.hWnd = iconWindow;
  mIconData.hIcon = ::LoadIcon(::GetModuleHandle(NULL), IDI_APPLICATION);

  nsAutoString labelAttr;
  mMenu->GetAttr(kNameSpaceID_None, nsGkAtoms::label, labelAttr);
  const nsString& label = PromiseFlatString(labelAttr);

  size_t destLength = sizeof mIconData.szTip / (sizeof mIconData.szTip[0]);
  wchar_t* tooltip = &(mIconData.szTip[0]);
  ::StringCchCopyNW(tooltip, destLength, label.get(), label.Length());

  ::Shell_NotifyIconW(NIM_ADD, &mIconData);
  ::Shell_NotifyIconW(NIM_SETVERSION, &mIconData);

  mInitted = true;
  return NS_OK;
}

nsresult StatusBarEntry::OnComplete(imgIContainer* aImage) {
  NS_ENSURE_ARG_POINTER(aImage);

  RefPtr kungFuDeathGrip = this;

  nsresult rv = nsWindowGfx::CreateIcon(
      aImage, false, LayoutDeviceIntPoint(),
      nsWindowGfx::GetIconMetrics(nsWindowGfx::kRegularIcon), &mIconData.hIcon);
  NS_ENSURE_SUCCESS(rv, rv);

  ::Shell_NotifyIconW(NIM_MODIFY, &mIconData);

  if (mIconData.hIcon) {
    ::DestroyIcon(mIconData.hIcon);
    mIconData.hIcon = nullptr;
  }

  // To simplify things, we won't react to CSS changes to update the icon
  // with this implementation. We can get rid of the IconLoader at this point.
  mIconLoader->Destroy();
  mIconLoader = nullptr;
  return NS_OK;
}

LRESULT StatusBarEntry::OnMessage(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
  if (msg == WM_USER &&
      (LOWORD(lp) == WM_LBUTTONUP || LOWORD(lp) == WM_RBUTTONUP)) {
    nsMenuFrame* menu = do_QueryFrame(mMenu->GetPrimaryFrame());
    if (!menu) {
      return TRUE;
    }

    nsMenuPopupFrame* popupFrame = menu->GetPopup();
    if (!popupFrame) {
      return TRUE;
    }

    nsIWidget* widget = popupFrame->GetNearestWidget();
    if (!widget) {
      return TRUE;
    }

    HWND win = static_cast(widget->GetNativeData(NS_NATIVE_WINDOW));
    if (!win) {
      return TRUE;
    }

    nsCOMPtr docShell = popupFrame->PresContext()->GetDocShell();
    nsCOMPtr baseWin = do_QueryInterface(docShell);
    if (!baseWin) {
      return TRUE;
    }

    double scale = 1.0;
    baseWin->GetUnscaledDevicePixelsPerCSSPixel(&scale);
    int32_t x = NSToIntRound(GET_X_LPARAM(wp) / scale);
    int32_t y = NSToIntRound(GET_Y_LPARAM(wp) / scale);

    // The menu that is being opened is a Gecko , and the popup code
    // that manages it expects that the window that the  belongs to
    // will be in the foreground when it opens. If we don't do this, then if the
    // icon is clicked when the window is _not_ in the foreground, then the
    // opened menu will not be keyboard focusable, nor will it close on its own
    // if the user clicks away from the menu (at least, not until the user
    // focuses any window in the parent process).
    ::SetForegroundWindow(win);
    nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
    pm->ShowPopupAtScreen(popupFrame->GetContent(), x, y, false, nullptr);
  }

  return DefWindowProc(hWnd, msg, wp, lp);
}

NS_IMPL_ISUPPORTS(SystemStatusBar, nsISystemStatusBar)

static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
  StatusBarEntry* entry =
      (StatusBarEntry*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
  if (entry) {
    return entry->OnMessage(hWnd, msg, wp, lp);
  }
  return TRUE;
}

static StaticRefPtr sSingleton;

SystemStatusBar& SystemStatusBar::GetSingleton() {
  if (!sSingleton) {
    sSingleton = new SystemStatusBar();
    ClearOnShutdown(&sSingleton);
  }
  return *sSingleton;
}

already_AddRefed SystemStatusBar::GetAddRefedSingleton() {
  RefPtr sm = &GetSingleton();
  return sm.forget();
}

nsresult SystemStatusBar::Init() {
  WNDCLASS classStruct = {/* style */ 0,
                          /* lpfnWndProc */ &WindowProc,
                          /* cbClsExtra */ 0,
                          /* cbWndExtra */ 0,
                          /* hInstance */ 0,
                          /* hIcon */ 0,
                          /* hCursor */ 0,
                          /* hbrBackground */ 0,
                          /* lpszMenuName */ 0,
                          /* lpszClassName */ L"IconWindowClass"};
  NS_ENSURE_TRUE(::RegisterClass(&classStruct), NS_ERROR_FAILURE);
  return NS_OK;
}

NS_IMETHODIMP
SystemStatusBar::AddItem(Element* aElement) {
  RefPtr entry = new StatusBarEntry(aElement);
  nsresult rv = entry->Init();
  NS_ENSURE_SUCCESS(rv, rv);

  mStatusBarEntries.insertBack(entry);
  return NS_OK;
}

NS_IMETHODIMP
SystemStatusBar::RemoveItem(Element* aElement) {
  for (StatusBarEntry* entry : mStatusBarEntries) {
    if (entry->GetMenu() == aElement) {
      entry->removeFrom(mStatusBarEntries);
      return NS_OK;
    }
  }
  return NS_ERROR_NOT_AVAILABLE;
}

}  // namespace mozilla::widget

Minimal test - lines (42, 42)

path: .spaces[0].spaces[0].spaces[0].metrics.nargs.sum
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].spaces[0].metrics.nargs.average
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].spaces[0].metrics.cyclomatic.sum
old: 3.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.cyclomatic.average
old: 3.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.cognitive.sum
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].spaces[0].metrics.cognitive.average
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].spaces[0].metrics.loc.sloc
old: 10.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.loc.lloc
old: 5.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.loc.ploc
old: 10.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.nexits.average
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.nexits.sum
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.length
old: 48.0
new: 8.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n1
old: 11.0
new: 5.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 86.15946414084446
new: 16.36452797660028

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n2
old: 13.0
new: 3.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.794988836267593
new: 2.045565997075035

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.bugs
old: 0.05045408301730168
new: 0.005108729549290353

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N1
old: 28.0
new: 5.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.difficulty
old: 8.461538461538462
new: 2.5

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.time
old: 103.45556411883634
new: 3.3333333333333335

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.vocabulary
old: 24.0
new: 8.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N2
old: 20.0
new: 3.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.level
old: 0.11818181818181818
new: 0.4

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.volume
old: 220.0782000346155
new: 24.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.effort
old: 1862.200154139054
new: 60.0

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_original
old: 104.95941021643672
new: 154.24412008219068

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_sei
old: 76.02902820008431
new: 146.92819499625

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 61.379772056395744
new: 90.2012398141466

Code

  const Element* GetMenu() { return mMenu; };

Minimal test - lines (31, 52)

path: .spaces[0].spaces[0].metrics.nargs.average
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].metrics.nargs.sum
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].metrics.nexits.average
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].metrics.nexits.sum
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 4.0
new: 2.0

path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.0
new: 1.0

path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 59.16394452930136
new: 51.64625577875681

path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 101.17034514510532
new: 88.31509738167415

path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 70.66438267147338
new: 51.9145407549634

path: .spaces[0].spaces[0].metrics.cognitive.average
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].metrics.halstead.volume
old: 247.25415011250035
new: 484.29545663475

path: .spaces[0].spaces[0].metrics.halstead.n2
old: 15.0
new: 28.0

path: .spaces[0].spaces[0].metrics.halstead.effort
old: 2175.8365209900035
new: 3943.548718311536

path: .spaces[0].spaces[0].metrics.halstead.time
old: 120.87980672166684
new: 219.0860399061964

path: .spaces[0].spaces[0].metrics.halstead.length
old: 52.0
new: 91.0

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.0559709811468412
new: 0.08320259766092453

path: .spaces[0].spaces[0].metrics.halstead.N2
old: 22.0
new: 38.0

path: .spaces[0].spaces[0].metrics.halstead.N1
old: 30.0
new: 53.0

path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 101.62290894278166
new: 177.62548782626678

path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 27.0
new: 40.0

path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.954286710438109
new: 1.951928437651283

path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 8.8
new: 8.142857142857142

path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.11363636363636365
new: 0.12280701754385966

path: .spaces[0].spaces[0].metrics.loc.blank
old: 0.0
new: 3.0

path: .spaces[0].spaces[0].metrics.loc.lloc
old: 5.0
new: 1.0

path: .spaces[0].spaces[0].metrics.loc.ploc
old: 12.0
new: 19.0

path: .spaces[0].spaces[0].metrics.loc.sloc
old: 12.0
new: 22.0

Code

class StatusBarEntry final : public LinkedListElement>,
                             public IconLoader::Listener,
                             public nsISupports {
 public:
  explicit StatusBarEntry(Element* aMenu);
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_CLASS(StatusBarEntry)
  nsresult Init();
  void Destroy();

  LRESULT OnMessage(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
  const Element* GetMenu() { return mMenu; };

  nsresult OnComplete(imgIContainer* aImage) override;

 private:
  ~StatusBarEntry();
  RefPtr mIconLoader;
  RefPtr mMenu;
  NOTIFYICONDATAW mIconData;
  boolean mInitted;
};