Global Metrics

path: .metrics.nexits.average
old: 0.9545454545454546
new: 0.75

path: .metrics.nexits.sum
old: 21.0
new: 3.0

path: .metrics.nom.closures
old: 1.0
new: 0.0

path: .metrics.nom.functions
old: 21.0
new: 4.0

path: .metrics.nom.total
old: 22.0
new: 4.0

path: .metrics.cyclomatic.average
old: 1.7391304347826086
new: 1.2

path: .metrics.cyclomatic.sum
old: 40.0
new: 6.0

path: .metrics.mi.mi_visual_studio
old: 17.765554703716898
new: 37.20996351808907

path: .metrics.mi.mi_sei
old: -6.535993997178572
new: 41.55231127201877

path: .metrics.mi.mi_original
old: 30.379098543355894
new: 63.629037615932305

path: .metrics.loc.cloc
old: 16.0
new: 8.0

path: .metrics.loc.blank
old: 32.0
new: 18.0

path: .metrics.loc.ploc
old: 151.0
new: 45.0

path: .metrics.loc.sloc
old: 199.0
new: 71.0

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

path: .metrics.nargs.sum
old: 22.0
new: 3.0

path: .metrics.nargs.average
old: 1.0
new: 0.75

path: .metrics.cognitive.average
old: 0.6818181818181818
new: 0.25

path: .metrics.cognitive.sum
old: 15.0
new: 1.0

path: .metrics.halstead.N2
old: 360.0
new: 89.0

path: .metrics.halstead.purity_ratio
old: 1.5134582074155167
new: 1.8236353379103736

path: .metrics.halstead.estimated_program_length
old: 1306.114432999591
new: 362.9034322441643

path: .metrics.halstead.volume
old: 6519.610178997801
new: 1215.5963668988556

path: .metrics.halstead.time
old: 11409.317813246153
new: 1141.9852535699804

path: .metrics.halstead.bugs
old: 1.160290849473389
new: 0.25013093851487767

path: .metrics.halstead.effort
old: 205367.7206384307
new: 20555.73456425965

path: .metrics.halstead.length
old: 863.0
new: 199.0

path: .metrics.halstead.vocabulary
old: 188.0
new: 69.0

path: .metrics.halstead.n1
old: 28.0
new: 19.0

path: .metrics.halstead.difficulty
old: 31.5
new: 16.91

path: .metrics.halstead.N1
old: 503.0
new: 110.0

path: .metrics.halstead.n2
old: 160.0
new: 50.0

path: .metrics.halstead.level
old: 0.031746031746031744
new: 0.05913660555884092

Spaces Data

Minimal test - lines (38, 58)

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

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

path: .spaces[2].metrics.loc.sloc
old: 8.0
new: 21.0

path: .spaces[2].metrics.loc.ploc
old: 8.0
new: 12.0

path: .spaces[2].metrics.loc.lloc
old: 4.0
new: 7.0

path: .spaces[2].metrics.loc.blank
old: 0.0
new: 5.0

path: .spaces[2].metrics.loc.cloc
old: 0.0
new: 4.0

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

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

path: .spaces[2].metrics.mi.mi_original
old: 110.41615664966996
new: 90.73993860225951

path: .spaces[2].metrics.mi.mi_sei
old: 83.79962935929399
new: 86.59972586763854

path: .spaces[2].metrics.mi.mi_visual_studio
old: 64.57085184191227
new: 53.06429158026872

path: .spaces[2].metrics.halstead.N1
old: 24.0
new: 40.0

path: .spaces[2].metrics.halstead.n2
old: 8.0
new: 22.0

path: .spaces[2].metrics.halstead.time
old: 86.31552711344396
new: 201.1440265081356

path: .spaces[2].metrics.halstead.estimated_program_length
old: 62.05374780501027
new: 151.41046451882698

path: .spaces[2].metrics.halstead.purity_ratio
old: 1.632993363289744
new: 2.1325417537862954

path: .spaces[2].metrics.halstead.vocabulary
old: 19.0
new: 36.0

path: .spaces[2].metrics.halstead.volume
old: 161.42124551085624
new: 367.0646751024042

path: .spaces[2].metrics.halstead.level
old: 0.1038961038961039
new: 0.10138248847926268

path: .spaces[2].metrics.halstead.N2
old: 14.0
new: 31.0

path: .spaces[2].metrics.halstead.difficulty
old: 9.625
new: 9.863636363636363

path: .spaces[2].metrics.halstead.effort
old: 1553.6794880419914
new: 3620.592477146441

path: .spaces[2].metrics.halstead.bugs
old: 0.044714979231514906
new: 0.07859564971481622

path: .spaces[2].metrics.halstead.n1
old: 11.0
new: 14.0

path: .spaces[2].metrics.halstead.length
old: 38.0
new: 71.0

Code

nsSystemStatusBarCocoa::StatusItem::StatusItem(nsStandaloneNativeMenu* aMenu) : mMenu(aMenu) {
  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;

  MOZ_COUNT_CTOR(nsSystemStatusBarCocoa::StatusItem);

  NSMenu* nativeMenu = nil;
  mMenu->GetNativeMenu(reinterpret_cast(&nativeMenu));

  mStatusItem =
      [[NSStatusBar.systemStatusBar statusItemWithLength:NSSquareStatusItemLength] retain];
  mStatusItem.menu = nativeMenu;
  mStatusItem.highlightMode = YES;

  // We want the status item to get its image from menu item that mMenu was
  // initialized with. Icon loads are asynchronous, so we need to let the menu
  // know about the item so that it can update its icon as soon as it has
  // loaded.
  mMenu->SetContainerStatusBarItem(mStatusItem);

  NS_OBJC_END_TRY_ABORT_BLOCK;
}

Minimal test - lines (60, 71)

path: .spaces[3].metrics.mi.mi_sei
old: 65.87728616300629
new: 74.38877881016107

path: .spaces[3].metrics.mi.mi_original
old: 97.92275884566422
new: 103.96362827333868

path: .spaces[3].metrics.mi.mi_visual_studio
old: 57.264771254774395
new: 60.79744343470099

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

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

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

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

path: .spaces[3].metrics.halstead.time
old: 176.593492098037
new: 61.110729588733335

path: .spaces[3].metrics.halstead.length
old: 54.0
new: 37.0

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

path: .spaces[3].metrics.halstead.volume
old: 240.8093074064141
new: 164.99896988958

path: .spaces[3].metrics.halstead.purity_ratio
old: 1.411830202917176
new: 2.0605089447980403

path: .spaces[3].metrics.halstead.n2
old: 10.0
new: 12.0

path: .spaces[3].metrics.halstead.bugs
old: 0.07206264721201631
new: 0.035519926721969866

path: .spaces[3].metrics.halstead.N2
old: 22.0
new: 16.0

path: .spaces[3].metrics.halstead.level
old: 0.07575757575757576
new: 0.15

path: .spaces[3].metrics.halstead.difficulty
old: 13.2
new: 6.666666666666667

path: .spaces[3].metrics.halstead.effort
old: 3178.6828577646656
new: 1099.9931325972

path: .spaces[3].metrics.halstead.N1
old: 32.0
new: 21.0

path: .spaces[3].metrics.loc.lloc
old: 5.0
new: 6.0

path: .spaces[3].metrics.loc.sloc
old: 15.0
new: 12.0

path: .spaces[3].metrics.loc.ploc
old: 12.0
new: 9.0

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

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

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

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

Code

nsSystemStatusBarCocoa::StatusItem::~StatusItem() {
  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;

  mMenu->SetContainerStatusBarItem(nil);
  [NSStatusBar.systemStatusBar removeStatusItem:mStatusItem];
  [mStatusItem release];
  mStatusItem = nil;

  MOZ_COUNT_DTOR(nsSystemStatusBarCocoa::StatusItem);

  NS_OBJC_END_TRY_ABORT_BLOCK;
}

Minimal test - lines (33, 36)

path: .spaces[1].metrics.loc.ploc
old: 1.0
new: 4.0

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

path: .spaces[1].metrics.loc.sloc
old: 1.0
new: 4.0

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

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

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

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

path: .spaces[1].metrics.halstead.n2
old: 1.0
new: 6.0

path: .spaces[1].metrics.halstead.estimated_program_length
old: 8.0
new: 35.161259458730164

path: .spaces[1].metrics.halstead.vocabulary
old: 5.0
new: 13.0

path: .spaces[1].metrics.halstead.bugs
old: 0.002712967490108627
new: 0.012936124267933504

path: .spaces[1].metrics.halstead.length
old: 5.0
new: 16.0

path: .spaces[1].metrics.halstead.difficulty
old: 2.0
new: 4.083333333333333

path: .spaces[1].metrics.halstead.effort
old: 23.21928094887362
new: 241.762061585218

path: .spaces[1].metrics.halstead.N1
old: 4.0
new: 9.0

path: .spaces[1].metrics.halstead.n1
old: 4.0
new: 7.0

path: .spaces[1].metrics.halstead.volume
old: 11.60964047443681
new: 59.207035490257475

path: .spaces[1].metrics.halstead.level
old: 0.5
new: 0.2448979591836735

path: .spaces[1].metrics.halstead.N2
old: 1.0
new: 7.0

path: .spaces[1].metrics.halstead.purity_ratio
old: 1.6
new: 2.1975787161706353

path: .spaces[1].metrics.halstead.time
old: 1.289960052715201
new: 13.431225643623222

path: .spaces[1].metrics.mi.mi_sei
old: 152.37629276875444
new: 107.75397708518643

path: .spaces[1].metrics.mi.mi_visual_studio
old: 92.40962204246613
new: 74.32200081081642

path: .spaces[1].metrics.mi.mi_original
old: 158.02045369261705
new: 127.09062138649608

Code

nsSystemStatusBarCocoa::RemoveItem(Element* aElement) {
  mItems.Remove(aElement);
  return NS_OK;
}

Minimal test - lines (19, 30)

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

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

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

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

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

path: .spaces[0].metrics.halstead.vocabulary
old: 15.0
new: 32.0

path: .spaces[0].metrics.halstead.time
old: 36.62709933382987
new: 168.5185185185185

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.76156400069231
new: 2.139360315579468

path: .spaces[0].metrics.halstead.length
old: 25.0
new: 60.0

path: .spaces[0].metrics.halstead.level
old: 0.14814814814814814
new: 0.09890109890109892

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

path: .spaces[0].metrics.halstead.effort
old: 659.2877880089376
new: 3033.333333333333

path: .spaces[0].metrics.halstead.bugs
old: 0.025250041691176003
new: 0.06984878193280245

path: .spaces[0].metrics.halstead.volume
old: 97.67226489021296
new: 300.0

path: .spaces[0].metrics.halstead.N1
old: 16.0
new: 34.0

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

path: .spaces[0].metrics.halstead.estimated_program_length
old: 44.039100017307746
new: 128.36161893476807

path: .spaces[0].metrics.halstead.difficulty
old: 6.75
new: 10.11111111111111

path: .spaces[0].metrics.halstead.n1
old: 9.0
new: 14.0

path: .spaces[0].metrics.mi.mi_sei
old: 130.48889475558636
new: 69.6737502977387

path: .spaces[0].metrics.mi.mi_visual_studio
old: 70.55128309876082
new: 58.8449376638726

path: .spaces[0].metrics.mi.mi_original
old: 120.642694098881
new: 100.62484340522217

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

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

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

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

Code

nsSystemStatusBarCocoa::AddItem(Element* aElement) {
  RefPtr menu = new nsStandaloneNativeMenu();
  nsresult rv = menu->Init(aElement);
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr keyPtr = aElement;
  mItems.InsertOrUpdate(keyPtr, mozilla::MakeUnique(menu));

  return NS_OK;
}