Global Metrics
path: .metrics.loc.lloc
old: 11.0
new: 14.0
path: .metrics.loc.ploc
old: 47.0
new: 32.0
path: .metrics.loc.blank
old: 14.0
new: 7.0
path: .metrics.loc.sloc
old: 68.0
new: 49.0
path: .metrics.loc.cloc
old: 7.0
new: 10.0
path: .metrics.cyclomatic.average
old: 1.0
new: 2.0
path: .metrics.cyclomatic.sum
old: 6.0
new: 8.0
path: .metrics.nexits.average
old: 0.6
new: 0.6666666666666666
path: .metrics.nexits.sum
old: 3.0
new: 2.0
path: .metrics.cognitive.sum
old: 0.0
new: 1.0
path: .metrics.cognitive.average
old: 0.0
new: 0.3333333333333333
path: .metrics.nargs.average
old: 0.4
new: 0.6666666666666666
path: .metrics.mi.mi_original
old: 61.097671917340094
new: 72.86052034082687
path: .metrics.mi.mi_visual_studio
old: 35.729632700198884
new: 42.60849142738414
path: .metrics.mi.mi_sei
old: 36.897110185325815
new: 62.4345270430386
path: .metrics.halstead.time
old: 3999.622305508783
new: 440.3582436781128
path: .metrics.halstead.n1
old: 12.0
new: 16.0
path: .metrics.halstead.difficulty
old: 31.818181818181817
new: 13.241379310344827
path: .metrics.halstead.N2
old: 175.0
new: 48.0
path: .metrics.halstead.N1
old: 237.0
new: 61.0
path: .metrics.halstead.volume
old: 2262.643475687826
new: 598.6119874999346
path: .metrics.halstead.bugs
old: 0.5768635122369242
new: 0.1325148357576431
path: .metrics.halstead.effort
old: 71993.2014991581
new: 7926.44838620603
path: .metrics.halstead.estimated_program_length
old: 209.48455594748285
new: 204.88144885869957
path: .metrics.halstead.length
old: 412.0
new: 109.0
path: .metrics.halstead.level
old: 0.03142857142857143
new: 0.07552083333333333
path: .metrics.halstead.n2
old: 33.0
new: 29.0
path: .metrics.halstead.purity_ratio
old: 0.5084576600667059
new: 1.8796463198045832
path: .metrics.nom.total
old: 5.0
new: 3.0
path: .metrics.nom.functions
old: 5.0
new: 3.0
Spaces Data
Minimal test - lines (24, 42)
path: .spaces[1].metrics.loc.ploc
old: 1.0
new: 14.0
path: .spaces[1].metrics.loc.lloc
old: 1.0
new: 11.0
path: .spaces[1].metrics.loc.sloc
old: 1.0
new: 19.0
path: .spaces[1].metrics.loc.cloc
old: 0.0
new: 5.0
path: .spaces[1].metrics.mi.mi_visual_studio
old: 88.80070420559018
new: 55.47430059193352
path: .spaces[1].metrics.mi.mi_original
old: 151.8492041915592
new: 94.86105401220632
path: .spaces[1].metrics.mi.mi_sei
old: 143.47306171748977
new: 97.34717384706866
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.6887218755408668
new: 1.5132516549543429
path: .spaces[1].metrics.halstead.estimated_program_length
old: 20.264662506490403
new: 66.58307281799108
path: .spaces[1].metrics.halstead.level
old: 0.25
new: 0.10227272727272728
path: .spaces[1].metrics.halstead.time
old: 8.4531333371795
new: 103.29941718150536
path: .spaces[1].metrics.halstead.volume
old: 38.039100017307746
new: 190.16483617504392
path: .spaces[1].metrics.halstead.difficulty
old: 4.0
new: 9.77777777777778
path: .spaces[1].metrics.halstead.N2
old: 4.0
new: 16.0
path: .spaces[1].metrics.halstead.bugs
old: 0.009500334461331307
new: 0.0504033028668795
path: .spaces[1].metrics.halstead.vocabulary
old: 9.0
new: 20.0
path: .spaces[1].metrics.halstead.effort
old: 152.15640006923098
new: 1859.3895092670964
path: .spaces[1].metrics.halstead.length
old: 12.0
new: 44.0
path: .spaces[1].metrics.halstead.n2
old: 3.0
new: 9.0
path: .spaces[1].metrics.halstead.n1
old: 6.0
new: 11.0
path: .spaces[1].metrics.halstead.N1
old: 8.0
new: 28.0
path: .spaces[1].metrics.cyclomatic.sum
old: 1.0
new: 5.0
path: .spaces[1].metrics.cyclomatic.average
old: 1.0
new: 5.0
path: .spaces[1].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[1].metrics.nexits.average
old: 1.0
new: 0.0
path: .spaces[1].metrics.cognitive.average
old: 0.0
new: 1.0
path: .spaces[1].metrics.cognitive.sum
old: 0.0
new: 1.0
Code
void NS_DispatchEventualMemoryPressure(MemoryPressureState aState) {
/*
* A new memory pressure event erases an ongoing (or stop of) memory pressure,
* but an existing "new" memory pressure event takes precedence over a new
* "ongoing" or "stop" memory pressure event.
*/
switch (aState) {
case MemPressure_None:
sMemoryPressurePending = MemPressure_None;
break;
case MemPressure_New:
sMemoryPressurePending = MemPressure_New;
break;
case MemPressure_Ongoing:
case MemPressure_Stopping:
sMemoryPressurePending.compareExchange(MemPressure_None, aState);
break;
}
}
Minimal test - lines (19, 22)
path: .spaces[0].metrics.loc.ploc
old: 1.0
new: 4.0
path: .spaces[0].metrics.loc.sloc
old: 1.0
new: 4.0
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 0.0
path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 24.406371956566694
new: 35.161259458730164
path: .spaces[0].metrics.halstead.n2
old: 3.0
new: 6.0
path: .spaces[0].metrics.halstead.N1
old: 9.0
new: 10.0
path: .spaces[0].metrics.halstead.N2
old: 4.0
new: 8.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.8774132274282072
new: 1.9534033032627869
path: .spaces[0].metrics.halstead.volume
old: 43.18506523353571
new: 66.60791492653966
path: .spaces[0].metrics.halstead.time
old: 11.196128023509258
new: 17.26871868465843
path: .spaces[0].metrics.halstead.bugs
old: 0.01145791648872146
new: 0.015295622567773837
path: .spaces[0].metrics.halstead.effort
old: 201.53030442316663
new: 310.8369363238518
path: .spaces[0].metrics.halstead.length
old: 13.0
new: 18.0
path: .spaces[0].metrics.halstead.vocabulary
old: 10.0
new: 13.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 88.41486984730174
new: 73.96383017607187
path: .spaces[0].metrics.mi.mi_sei
old: 142.52120506831432
new: 106.8703670776864
path: .spaces[0].metrics.mi.mi_original
old: 151.189427438886
new: 126.47814960108288
Code
MemoryPressureState NS_GetPendingMemoryPressure() {
int32_t value = sMemoryPressurePending.exchange(MemPressure_None);
return MemoryPressureState(value);
}
Minimal test - lines (44, 49)
path: .spaces[2].metrics.nexits.average
old: 0.0
new: 1.0
path: .spaces[2].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[2].metrics.loc.blank
old: 3.0
new: 0.0
path: .spaces[2].metrics.loc.ploc
old: 19.0
new: 6.0
path: .spaces[2].metrics.loc.lloc
old: 6.0
new: 2.0
path: .spaces[2].metrics.loc.sloc
old: 22.0
new: 6.0
path: .spaces[2].metrics.mi.mi_visual_studio
old: 49.150568256230535
new: 68.58476740131832
path: .spaces[2].metrics.mi.mi_original
old: 84.04747171815421
new: 117.27995225625432
path: .spaces[2].metrics.mi.mi_sei
old: 45.65583851442821
new: 93.60017338318426
path: .spaces[2].metrics.nargs.average
old: 0.0
new: 1.0
path: .spaces[2].metrics.nargs.sum
old: 0.0
new: 1.0
path: .spaces[2].metrics.halstead.n1
old: 10.0
new: 8.0
path: .spaces[2].metrics.halstead.N2
old: 102.0
new: 13.0
path: .spaces[2].metrics.halstead.effort
old: 25502.70209560874
new: 522.1089089250661
path: .spaces[2].metrics.halstead.estimated_program_length
old: 137.26120593818493
new: 62.05374780501027
path: .spaces[2].metrics.halstead.N1
old: 126.0
new: 13.0
path: .spaces[2].metrics.halstead.n2
old: 23.0
new: 11.0
path: .spaces[2].metrics.halstead.time
old: 1416.8167830893744
new: 29.006050495837005
path: .spaces[2].metrics.halstead.volume
old: 1150.1218592137277
new: 110.44611534953322
path: .spaces[2].metrics.halstead.bugs
old: 0.2888037826378705
new: 0.021613220347869225
path: .spaces[2].metrics.halstead.vocabulary
old: 33.0
new: 19.0
path: .spaces[2].metrics.halstead.difficulty
old: 22.17391304347826
new: 4.7272727272727275
path: .spaces[2].metrics.halstead.length
old: 228.0
new: 26.0
path: .spaces[2].metrics.halstead.level
old: 0.045098039215686274
new: 0.2115384615384615
path: .spaces[2].metrics.halstead.purity_ratio
old: 0.6020228330622146
new: 2.3866826078850103
Code
nsresult NS_DispatchMemoryPressure(MemoryPressureState aState) {
NS_DispatchEventualMemoryPressure(aState);
nsCOMPtr event =
new Runnable("NS_DispatchEventualMemoryPressure");
return NS_DispatchToMainThread(event);
}