Global Metrics
path: .metrics.halstead.volume
old: 4534.618386375596
new: 2911.9083094341117
path: .metrics.halstead.level
old: 0.027628798959856975
new: 0.02115842369743454
path: .metrics.halstead.vocabulary
old: 106.0
new: 59.0
path: .metrics.halstead.N1
old: 381.0
new: 296.0
path: .metrics.halstead.length
old: 674.0
new: 495.0
path: .metrics.halstead.estimated_program_length
old: 637.0368954500586
new: 293.5877465509226
path: .metrics.halstead.difficulty
old: 36.194117647058825
new: 47.2625
path: .metrics.halstead.N2
old: 293.0
new: 199.0
path: .metrics.halstead.n2
old: 85.0
new: 40.0
path: .metrics.halstead.time
old: 9118.139520055243
new: 7645.781470812762
path: .metrics.halstead.n1
old: 21.0
new: 19.0
path: .metrics.halstead.bugs
old: 0.9992279439783386
new: 0.8885359473632872
path: .metrics.halstead.effort
old: 164126.51136099437
new: 137624.0664746297
path: .metrics.halstead.purity_ratio
old: 0.9451585985905916
new: 0.5931065586887325
path: .metrics.loc.lloc
old: 29.0
new: 16.0
path: .metrics.loc.cloc
old: 17.0
new: 7.0
path: .metrics.loc.blank
old: 20.0
new: 16.0
path: .metrics.loc.ploc
old: 154.0
new: 79.0
path: .metrics.loc.sloc
old: 191.0
new: 102.0
path: .metrics.cognitive.sum
old: 10.0
new: 1.0
path: .metrics.cognitive.average
old: 1.6666666666666667
new: 0.1111111111111111
path: .metrics.nexits.sum
old: 4.0
new: 3.0
path: .metrics.nexits.average
old: 0.6666666666666666
new: 0.3333333333333333
path: .metrics.nom.functions
old: 6.0
new: 9.0
path: .metrics.nom.total
old: 6.0
new: 9.0
path: .metrics.mi.mi_visual_studio
old: 22.6209299246801
new: 30.44871814741508
path: .metrics.mi.mi_original
old: 38.68179017120298
new: 52.067308032079794
path: .metrics.mi.mi_sei
old: 3.927602146647015
new: 20.275934280853924
path: .metrics.nargs.average
old: 4.666666666666667
new: 2.111111111111111
path: .metrics.nargs.sum
old: 28.0
new: 19.0
path: .metrics.cyclomatic.sum
old: 15.0
new: 11.0
path: .metrics.cyclomatic.average
old: 1.6666666666666667
new: 1.1
Spaces Data
Minimal test - lines (10, 27)
path: .spaces[0].metrics.halstead.N1
old: 275.0
new: 51.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.99768782827682
new: 1.8011943956668948
path: .spaces[0].metrics.halstead.time
old: 5352.991835176339
new: 372.1257691350906
path: .spaces[0].metrics.halstead.difficulty
old: 31.384615384615383
new: 14.181818181818182
path: .spaces[0].metrics.halstead.estimated_program_length
old: 477.8924697445968
new: 162.10749561002052
path: .spaces[0].metrics.halstead.bugs
old: 0.7005806468280659
new: 0.1184459581754108
path: .spaces[0].metrics.halstead.effort
old: 96353.8530331741
new: 6698.263844431631
path: .spaces[0].metrics.halstead.volume
old: 3070.0982584099593
new: 472.3134762099226
path: .spaces[0].metrics.halstead.level
old: 0.03186274509803922
new: 0.07051282051282051
path: .spaces[0].metrics.halstead.n1
old: 20.0
new: 16.0
path: .spaces[0].metrics.halstead.length
old: 479.0
new: 90.0
path: .spaces[0].metrics.halstead.N2
old: 204.0
new: 39.0
path: .spaces[0].metrics.halstead.n2
old: 65.0
new: 22.0
path: .spaces[0].metrics.halstead.vocabulary
old: 85.0
new: 38.0
path: .spaces[0].metrics.mi.mi_sei
old: 12.03397321650236
new: 74.64688475467082
path: .spaces[0].metrics.mi.mi_visual_studio
old: 27.441749505589872
new: 53.623528884148016
path: .spaces[0].metrics.mi.mi_original
old: 46.92539165455868
new: 91.6962343918931
path: .spaces[0].metrics.nargs.average
old: 4.666666666666667
new: 3.0
path: .spaces[0].metrics.nargs.sum
old: 28.0
new: 3.0
path: .spaces[0].metrics.nom.functions
old: 6.0
new: 1.0
path: .spaces[0].metrics.nom.total
old: 6.0
new: 1.0
path: .spaces[0].metrics.cognitive.average
old: 1.3333333333333333
new: 1.0
path: .spaces[0].metrics.cognitive.sum
old: 8.0
new: 1.0
path: .spaces[0].metrics.loc.cloc
old: 8.0
new: 1.0
path: .spaces[0].metrics.loc.sloc
old: 132.0
new: 18.0
path: .spaces[0].metrics.loc.ploc
old: 110.0
new: 14.0
path: .spaces[0].metrics.loc.lloc
old: 28.0
new: 4.0
path: .spaces[0].metrics.loc.blank
old: 14.0
new: 3.0
path: .spaces[0].metrics.cyclomatic.sum
old: 14.0
new: 2.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.75
new: 2.0
path: .spaces[0].metrics.nexits.average
old: 0.6666666666666666
new: 0.0
path: .spaces[0].metrics.nexits.sum
old: 4.0
new: 0.0
Code
void nsTDependentSubstring::Rebind(const substring_type& str,
uint32_t startPos, uint32_t length) {
// If we currently own a buffer, release it.
this->Finalize();
size_type strLength = str.Length();
if (startPos > strLength) {
startPos = strLength;
}
char_type* newData =
const_cast(static_cast(str.Data())) +
startPos;
size_type newLength = XPCOM_MIN(length, strLength - startPos);
DataFlags newDataFlags = DataFlags(0);
this->SetData(newData, newLength, newDataFlags);
}