Global Metrics

path: .metrics.nexits.average
old: 0.7142857142857143
new: 0.5

path: .metrics.nexits.sum
old: 10.0
new: 1.0

path: .metrics.halstead.difficulty
old: 86.79761904761905
new: 12.43421052631579

path: .metrics.halstead.n1
old: 23.0
new: 15.0

path: .metrics.halstead.effort
old: 1665303.4409255749
new: 10042.325802214124

path: .metrics.halstead.vocabulary
old: 191.0
new: 53.0

path: .metrics.halstead.estimated_program_length
old: 1345.9512520161431
new: 258.024604444984

path: .metrics.halstead.bugs
old: 4.683181594077634
new: 0.1551558958825021

path: .metrics.halstead.N2
old: 1268.0
new: 63.0

path: .metrics.halstead.time
old: 92516.8578291986
new: 557.9069890118958

path: .metrics.halstead.purity_ratio
old: 0.531576323861036
new: 1.8299617336523688

path: .metrics.halstead.n2
old: 168.0
new: 38.0

path: .metrics.halstead.level
old: 0.011521053353449455
new: 0.08042328042328042

path: .metrics.halstead.volume
old: 19186.049792586517
new: 807.636784093411

path: .metrics.halstead.N1
old: 1264.0
new: 78.0

path: .metrics.halstead.length
old: 2532.0
new: 141.0

path: .metrics.nom.total
old: 14.0
new: 2.0

path: .metrics.nom.functions
old: 14.0
new: 2.0

path: .metrics.loc.ploc
old: 338.0
new: 32.0

path: .metrics.loc.blank
old: 93.0
new: 4.0

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

path: .metrics.loc.lloc
old: 192.0
new: 8.0

path: .metrics.loc.sloc
old: 480.0
new: 44.0

path: .metrics.cognitive.sum
old: 31.0
new: 2.0

path: .metrics.cognitive.average
old: 2.2142857142857144
new: 1.0

path: .metrics.cyclomatic.average
old: 2.066666666666667
new: 1.4

path: .metrics.cyclomatic.sum
old: 31.0
new: 7.0

path: .metrics.mi.mi_original
old: 12.572583769508569
new: 73.27674327987191

path: .metrics.mi.mi_sei
old: -30.65556063901466
new: 61.4065596470618

path: .metrics.mi.mi_visual_studio
old: 7.352388169303257
new: 42.85189665489585

path: .metrics.nargs.sum
old: 69.0
new: 0.0

path: .metrics.nargs.average
old: 4.928571428571429
new: 0.0

Spaces Data

Minimal test - lines (14, 44)

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

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

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

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

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

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

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

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

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

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

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

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

path: .spaces[0].metrics.loc.ploc
old: 8.0
new: 27.0

path: .spaces[0].metrics.loc.sloc
old: 8.0
new: 31.0

path: .spaces[0].metrics.mi.mi_sei
old: 81.96544426630348
new: 58.77412085080037

path: .spaces[0].metrics.mi.mi_original
old: 109.21537257230976
new: 79.49919774679964

path: .spaces[0].metrics.mi.mi_visual_studio
old: 63.86863893117529
new: 46.4907589162571

path: .spaces[0].metrics.halstead.vocabulary
old: 17.0
new: 48.0

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

path: .spaces[0].metrics.halstead.N2
old: 30.0
new: 58.0

path: .spaces[0].metrics.halstead.effort
old: 1739.029645186508
new: 10012.314592201928

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

path: .spaces[0].metrics.halstead.time
old: 96.6127580659171
new: 556.2396995667737

path: .spaces[0].metrics.halstead.volume
old: 212.54806774501765
new: 759.5549000980773

path: .spaces[0].metrics.halstead.estimated_program_length
old: 53.5635228093372
new: 225.06836487295675

path: .spaces[0].metrics.halstead.bugs
old: 0.04820403601546764
new: 0.15484662233935653

path: .spaces[0].metrics.halstead.difficulty
old: 8.181818181818182
new: 13.181818181818182

path: .spaces[0].metrics.halstead.N1
old: 22.0
new: 78.0

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

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.0300677463334078
new: 1.6549144475952702

path: .spaces[0].metrics.halstead.level
old: 0.12222222222222222
new: 0.07586206896551724

Code

namespace mozilla {
namespace widget {

/* static */
LayoutDeviceIntRect HeadlessScreenHelper::GetScreenRect() {
  char* ev = PR_GetEnv("MOZ_HEADLESS_WIDTH");
  int width = 1366;
  if (ev) {
    width = atoi(ev);
  }
  ev = PR_GetEnv("MOZ_HEADLESS_HEIGHT");
  int height = 768;
  if (ev) {
    height = atoi(ev);
  }
  return LayoutDeviceIntRect(0, 0, width, height);
}

HeadlessScreenHelper::HeadlessScreenHelper() {
  AutoTArray, 1> screenList;
  LayoutDeviceIntRect rect = GetScreenRect();
  RefPtr ret =
      new Screen(rect, rect, 24, 24, DesktopToLayoutDeviceScale(),
                 CSSToLayoutDeviceScale(), 96.0f);
  screenList.AppendElement(ret.forget());
  ScreenManager& screenManager = ScreenManager::GetSingleton();
  screenManager.Refresh(std::move(screenList));
}

}  // namespace widget
}  // namespace mozilla