Global Metrics

path: .metrics.nargs.average
old: 2.25
new: 1.6666666666666667

path: .metrics.nargs.sum
old: 9.0
new: 5.0

path: .metrics.loc.ploc
old: 147.0
new: 22.0

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

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

path: .metrics.loc.sloc
old: 206.0
new: 35.0

path: .metrics.loc.lloc
old: 38.0
new: 4.0

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

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

path: .metrics.cyclomatic.average
old: 7.714285714285714
new: 1.0

path: .metrics.cyclomatic.sum
old: 54.0
new: 4.0

path: .metrics.halstead.vocabulary
old: 136.0
new: 43.0

path: .metrics.halstead.N2
old: 301.0
new: 39.0

path: .metrics.halstead.time
old: 7060.002317119249
new: 255.4086686264953

path: .metrics.halstead.bugs
old: 0.8425525119908895
new: 0.09216177648513532

path: .metrics.halstead.length
old: 691.0
new: 90.0

path: .metrics.halstead.n2
old: 116.0
new: 29.0

path: .metrics.halstead.n1
old: 20.0
new: 14.0

path: .metrics.halstead.difficulty
old: 25.948275862068964
new: 9.413793103448276

path: .metrics.halstead.estimated_program_length
old: 881.9643573325455
new: 194.18441776750603

path: .metrics.halstead.level
old: 0.03853820598006645
new: 0.10622710622710622

path: .metrics.halstead.purity_ratio
old: 1.2763594172685175
new: 2.157604641861178

path: .metrics.halstead.volume
old: 4897.436823303984
new: 488.3638279231888

path: .metrics.halstead.N1
old: 390.0
new: 51.0

path: .metrics.halstead.effort
old: 127080.04170814648
new: 4597.3560352769155

path: .metrics.mi.mi_original
old: 28.08677636586515
new: 80.28984588299072

path: .metrics.mi.mi_sei
old: -0.24982926452776863
new: 74.27880297426212

path: .metrics.mi.mi_visual_studio
old: 16.42501541863459
new: 46.953126247362995

path: .metrics.cognitive.sum
old: 14.0
new: 0.0

path: .metrics.cognitive.average
old: 3.5
new: 0.0

path: .metrics.nexits.average
old: 3.5
new: 0.3333333333333333

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

Spaces Data

Minimal test - lines (26, 31)

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

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

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

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

path: .spaces[1].metrics.halstead.effort
old: 47582.07608505036
new: 626.8888888888889

path: .spaces[1].metrics.halstead.n2
old: 84.0
new: 9.0

path: .spaces[1].metrics.halstead.length
old: 399.0
new: 31.0

path: .spaces[1].metrics.halstead.N1
old: 222.0
new: 18.0

path: .spaces[1].metrics.halstead.N2
old: 177.0
new: 13.0

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

path: .spaces[1].metrics.halstead.level
old: 0.05583250249252244
new: 0.19780219780219785

path: .spaces[1].metrics.halstead.time
old: 2643.4486713916867
new: 34.827160493827165

path: .spaces[1].metrics.halstead.purity_ratio
old: 1.519903588507949
new: 1.5542196602381948

path: .spaces[1].metrics.halstead.bugs
old: 0.4376977727467989
new: 0.024415884407938307

path: .spaces[1].metrics.halstead.difficulty
old: 17.910714285714285
new: 5.055555555555555

path: .spaces[1].metrics.halstead.volume
old: 2656.626381617966
new: 124.0

path: .spaces[1].metrics.halstead.estimated_program_length
old: 606.4415318146716
new: 48.18080946738404

path: .spaces[1].metrics.halstead.vocabulary
old: 101.0
new: 16.0

path: .spaces[1].metrics.loc.ploc
old: 83.0
new: 6.0

path: .spaces[1].metrics.loc.blank
old: 9.0
new: 0.0

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

path: .spaces[1].metrics.loc.sloc
old: 107.0
new: 6.0

path: .spaces[1].metrics.loc.lloc
old: 23.0
new: 1.0

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

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

path: .spaces[1].metrics.mi.mi_original
old: 44.40914882164924
new: 116.67803245735932

path: .spaces[1].metrics.mi.mi_visual_studio
old: 25.97026246880073
new: 68.23276751892358

path: .spaces[1].metrics.mi.mi_sei
old: 20.14920966738496
new: 92.73178667430554

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

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

Code

MOZ_NORETURN MOZ_COLD void InvalidArrayIndex_CRASH(size_t aIndex,
                                                   size_t aLength) {
  MOZ_CRASH_UNSAFE_PRINTF(
      "ElementAt(aIndex = %" PRIu64 ", aLength = %" PRIu64 ")",
      static_cast(aIndex), static_cast(aLength));
}

Minimal test - lines (33, 35)

path: .spaces[2].metrics.nargs.average
old: 4.0
new: 1.0

path: .spaces[2].metrics.nargs.sum
old: 4.0
new: 1.0

path: .spaces[2].metrics.loc.lloc
old: 0.0
new: 1.0

path: .spaces[2].metrics.loc.sloc
old: 7.0
new: 3.0

path: .spaces[2].metrics.loc.ploc
old: 7.0
new: 3.0

path: .spaces[2].metrics.mi.mi_sei
old: 86.19289251026214
new: 116.84481255663158

path: .spaces[2].metrics.mi.mi_visual_studio
old: 65.58223181495484
new: 78.00696395465648

path: .spaces[2].metrics.mi.mi_original
old: 112.14561640357276
new: 133.3919083624626

path: .spaces[2].metrics.halstead.volume
old: 183.39850002884623
new: 43.18506523353571

path: .spaces[2].metrics.halstead.vocabulary
old: 24.0
new: 10.0

path: .spaces[2].metrics.halstead.difficulty
old: 5.7
new: 4.666666666666667

path: .spaces[2].metrics.halstead.effort
old: 1045.3714501644235
new: 201.53030442316663

path: .spaces[2].metrics.halstead.level
old: 0.17543859649122806
new: 0.21428571428571427

path: .spaces[2].metrics.halstead.n2
old: 15.0
new: 3.0

path: .spaces[2].metrics.halstead.length
old: 40.0
new: 13.0

path: .spaces[2].metrics.halstead.n1
old: 9.0
new: 7.0

path: .spaces[2].metrics.halstead.N1
old: 21.0
new: 9.0

path: .spaces[2].metrics.halstead.time
old: 58.07619167580131
new: 11.196128023509258

path: .spaces[2].metrics.halstead.N2
old: 19.0
new: 4.0

path: .spaces[2].metrics.halstead.bugs
old: 0.034334113248994685
new: 0.01145791648872146

path: .spaces[2].metrics.halstead.estimated_program_length
old: 87.13268394710859
new: 24.406371956566694

path: .spaces[2].metrics.halstead.purity_ratio
old: 2.1783170986777147
new: 1.8774132274282072

Code

void ::detail::SetCycleCollectionArrayFlag(uint32_t& aFlags) {
  aFlags |= CycleCollectionEdgeNameArrayFlag;
}

Minimal test - lines (20, 24)

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

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

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

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

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

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

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

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

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

path: .spaces[0].metrics.halstead.volume
old: 358.2030134794219
new: 101.57915548582147

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

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

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.6391485321454913
new: 1.693811539127221

path: .spaces[0].metrics.halstead.length
old: 73.0
new: 26.0

path: .spaces[0].metrics.halstead.N1
old: 42.0
new: 17.0

path: .spaces[0].metrics.halstead.effort
old: 2776.0733544655195
new: 685.659299529295

path: .spaces[0].metrics.halstead.bugs
old: 0.06584144754085783
new: 0.025918965228776444

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

path: .spaces[0].metrics.halstead.time
old: 154.22629747030663
new: 38.092183307183056

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

path: .spaces[0].metrics.mi.mi_sei
old: 83.24039000655893
new: 98.48916987523094

path: .spaces[0].metrics.mi.mi_visual_studio
old: 52.142265619475715
new: 70.56651835700818

path: .spaces[0].metrics.mi.mi_original
old: 89.16327420930347
new: 120.668746390484

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

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

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

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

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

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

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

Code

bool IsTwiceTheRequiredBytesRepresentableAsUint32(size_t aCapacity,
                                                  size_t aElemSize) {
  using mozilla::CheckedUint32;
  return ((CheckedUint32(aCapacity) * aElemSize) * 2).isValid();
}