Global Metrics
path: .metrics.loc.ploc
old: 1032.0
new: 137.0
path: .metrics.loc.lloc
old: 508.0
new: 71.0
path: .metrics.loc.cloc
old: 354.0
new: 20.0
path: .metrics.loc.sloc
old: 1542.0
new: 175.0
path: .metrics.loc.blank
old: 156.0
new: 18.0
path: .metrics.nargs.average
old: 0.6231884057971014
new: 0.35714285714285715
path: .metrics.nargs.sum
old: 43.0
new: 5.0
path: .metrics.cognitive.sum
old: 183.0
new: 25.0
path: .metrics.cognitive.average
old: 2.652173913043478
new: 1.7857142857142858
path: .metrics.nom.closures
old: 1.0
new: 5.0
path: .metrics.nom.functions
old: 68.0
new: 9.0
path: .metrics.nom.total
old: 69.0
new: 14.0
path: .metrics.cyclomatic.average
old: 3.557142857142857
new: 2.9
path: .metrics.cyclomatic.sum
old: 249.0
new: 29.0
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 21.60320203322994
path: .metrics.mi.mi_sei
old: -103.5137210133946
new: 5.552583539163514
path: .metrics.mi.mi_original
old: -60.279085447196174
new: 36.9414754768232
path: .metrics.nexits.sum
old: 53.0
new: 14.0
path: .metrics.nexits.average
old: 0.7681159420289855
new: 1.0
path: .metrics.halstead.effort
old: 3440435.443888111
new: 199922.74089978728
path: .metrics.halstead.volume
old: 39885.15639709199
new: 4480.538023002325
path: .metrics.halstead.estimated_program_length
old: 4100.709249200858
new: 645.2053969742467
path: .metrics.halstead.bugs
old: 7.59663081304067
new: 1.139690365095249
path: .metrics.halstead.level
old: 0.011593054730309632
new: 0.022411347517730495
path: .metrics.halstead.time
old: 191135.3024382284
new: 11106.818938877072
path: .metrics.halstead.N2
old: 1683.0
new: 235.0
path: .metrics.halstead.N1
old: 2789.0
new: 427.0
path: .metrics.halstead.purity_ratio
old: 0.9169743401611936
new: 0.9746305090245418
path: .metrics.halstead.n2
old: 439.0
new: 79.0
path: .metrics.halstead.length
old: 4472.0
new: 662.0
path: .metrics.halstead.difficulty
old: 86.25854214123007
new: 44.62025316455696
path: .metrics.halstead.n1
old: 45.0
new: 30.0
path: .metrics.halstead.vocabulary
old: 484.0
new: 109.0
Spaces Data
Minimal test - lines (14, 26)
path: .spaces[0].metrics.loc.sloc
old: 1485.0
new: 13.0
path: .spaces[0].metrics.loc.lloc
old: 508.0
new: 7.0
path: .spaces[0].metrics.loc.cloc
old: 347.0
new: 2.0
path: .spaces[0].metrics.loc.blank
old: 150.0
new: 0.0
path: .spaces[0].metrics.loc.ploc
old: 988.0
new: 13.0
path: .spaces[0].metrics.nexits.sum
old: 53.0
new: 2.0
path: .spaces[0].metrics.nexits.average
old: 0.7681159420289855
new: 2.0
path: .spaces[0].metrics.cognitive.average
old: 2.652173913043478
new: 1.0
path: .spaces[0].metrics.cognitive.sum
old: 183.0
new: 1.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 0.0
new: 59.744554967779635
path: .spaces[0].metrics.mi.mi_original
old: -59.328892769075246
new: 102.16318899490318
path: .spaces[0].metrics.mi.mi_sei
old: -102.0024063004878
new: 100.43983732448314
path: .spaces[0].metrics.nom.functions
old: 68.0
new: 1.0
path: .spaces[0].metrics.nom.closures
old: 1.0
new: 0.0
path: .spaces[0].metrics.nom.total
old: 69.0
new: 1.0
path: .spaces[0].metrics.halstead.N1
old: 2775.0
new: 22.0
path: .spaces[0].metrics.halstead.n1
old: 45.0
new: 10.0
path: .spaces[0].metrics.halstead.time
old: 195488.56543435628
new: 68.43988803603074
path: .spaces[0].metrics.halstead.bugs
old: 7.711543660162195
new: 0.038305982766198496
path: .spaces[0].metrics.halstead.N2
old: 1646.0
new: 17.0
path: .spaces[0].metrics.halstead.volume
old: 39050.20675262232
new: 173.9178331268546
path: .spaces[0].metrics.halstead.vocabulary
old: 456.0
new: 22.0
path: .spaces[0].metrics.halstead.length
old: 4421.0
new: 39.0
path: .spaces[0].metrics.halstead.n2
old: 411.0
new: 12.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.8631178835620917
new: 1.954841819423782
path: .spaces[0].metrics.halstead.estimated_program_length
old: 3815.8441632280073
new: 76.2388309575275
path: .spaces[0].metrics.halstead.level
old: 0.01109761036857027
new: 0.1411764705882353
path: .spaces[0].metrics.halstead.difficulty
old: 90.1094890510949
new: 7.083333333333333
path: .spaces[0].metrics.halstead.effort
old: 3518794.177818413
new: 1231.917984648553
path: .spaces[0].metrics.cyclomatic.average
old: 3.5942028985507246
new: 2.0
path: .spaces[0].metrics.cyclomatic.sum
old: 248.0
new: 2.0
path: .spaces[0].metrics.nargs.sum
old: 43.0
new: 2.0
path: .spaces[0].metrics.nargs.average
old: 0.6231884057971014
new: 2.0
Code
nsresult nsSegmentedBuffer::Init(uint32_t aSegmentSize, uint32_t aMaxSize) {
if (mSegmentArrayCount != 0) {
return NS_ERROR_FAILURE; // initialized more than once
}
mSegmentSize = aSegmentSize;
mMaxSize = aMaxSize;
#if 0 // testing...
mSegmentArrayCount = 2;
#else
mSegmentArrayCount = NS_SEGMENTARRAY_INITIAL_COUNT;
#endif
return NS_OK;
}