Global Metrics
path: .metrics.halstead.difficulty
old: 44.245222929936304
new: 31.943661971830984
path: .metrics.halstead.N2
old: 421.0
new: 216.0
path: .metrics.halstead.bugs
old: 1.6459674317685404
new: 0.7586070761113629
path: .metrics.halstead.volume
old: 7842.370410230862
new: 3398.775779105704
path: .metrics.halstead.estimated_program_length
old: 1311.7204635148144
new: 528.8707113631864
path: .metrics.halstead.length
old: 1036.0
new: 521.0
path: .metrics.halstead.level
old: 0.022601310012236375
new: 0.03130511463844797
path: .metrics.halstead.effort
old: 346987.4270998005
new: 108569.3446057991
path: .metrics.halstead.n1
old: 33.0
new: 21.0
path: .metrics.halstead.vocabulary
old: 190.0
new: 92.0
path: .metrics.halstead.N1
old: 615.0
new: 305.0
path: .metrics.halstead.purity_ratio
old: 1.266139443547118
new: 1.015106931599206
path: .metrics.halstead.time
old: 19277.07928332225
new: 6031.630255877728
path: .metrics.halstead.n2
old: 157.0
new: 71.0
path: .metrics.nexits.sum
old: 12.0
new: 17.0
path: .metrics.nexits.average
old: 1.0909090909090908
new: 1.3076923076923077
path: .metrics.nom.total
old: 11.0
new: 13.0
path: .metrics.nom.functions
old: 11.0
new: 13.0
path: .metrics.nargs.sum
old: 12.0
new: 23.0
path: .metrics.nargs.average
old: 1.0909090909090908
new: 1.7692307692307692
path: .metrics.cyclomatic.sum
old: 58.0
new: 28.0
path: .metrics.cyclomatic.average
old: 2.9
new: 1.8666666666666667
path: .metrics.loc.blank
old: 43.0
new: 32.0
path: .metrics.loc.cloc
old: 130.0
new: 6.0
path: .metrics.loc.lloc
old: 73.0
new: 37.0
path: .metrics.loc.ploc
old: 221.0
new: 106.0
path: .metrics.loc.sloc
old: 394.0
new: 144.0
path: .metrics.mi.mi_visual_studio
old: 8.311797606283392
new: 24.425109664752977
path: .metrics.mi.mi_sei
old: -10.440359769745363
new: 2.9562373596005056
path: .metrics.mi.mi_original
old: 14.2131739067446
new: 41.76693752672759
path: .metrics.cognitive.sum
old: 38.0
new: 13.0
path: .metrics.cognitive.average
old: 3.4545454545454546
new: 1.0
Spaces Data
Minimal test - lines (15, 15)
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 16.0
new: 11.60964047443681
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.5
new: 0.4
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 4.0
new: 5.0
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 8.0
new: 5.0
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.0057689982812296325
new: 0.00381864321284214
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 72.0
new: 38.77443751081734
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 8.0
new: 6.0
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 4.0
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.3333333333333333
new: 1.9349400790728015
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 2.0
new: 2.5
path: .spaces[0].spaces[0].metrics.halstead.length
old: 12.0
new: 6.0
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 4.0
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 36.0
new: 15.509775004326936
path: .spaces[0].spaces[0].metrics.halstead.time
old: 4.0
new: 2.1541354172676304
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 5.0
new: 1.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 5.0
new: 1.0
path: .spaces[0].spaces[0].metrics.nexits.average
old: null
new: 0.0
path: .spaces[0].spaces[0].metrics.nargs.average
old: null
new: 0.0
path: .spaces[0].spaces[0].metrics.cognitive.average
old: null
new: 0.0
path: .spaces[0].spaces[0].metrics.nom.total
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].metrics.nom.functions
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 126.06280733859585
new: 156.51435355291963
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 106.27115485532474
new: 150.2034495661308
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 73.72093996409113
new: 91.5288617268536
Code
~nsINIParserImpl() = default;
Minimal test - lines (32, 46)
path: .spaces[1].metrics.mi.mi_original
old: 21.19045659924008
new: 97.10604391112965
path: .spaces[1].metrics.mi.mi_sei
old: -1.062951393906488
new: 64.69901557713328
path: .spaces[1].metrics.mi.mi_visual_studio
old: 12.392079882596535
new: 56.78716018194716
path: .spaces[1].metrics.nom.total
old: 8.0
new: 1.0
path: .spaces[1].metrics.nom.functions
old: 8.0
new: 1.0
path: .spaces[1].metrics.halstead.estimated_program_length
old: 1147.4413809742164
new: 111.90632784293425
path: .spaces[1].metrics.halstead.time
old: 16654.530214889146
new: 175.31913635749277
path: .spaces[1].metrics.halstead.bugs
old: 1.4930763161116474
new: 0.07171554399480354
path: .spaces[1].metrics.halstead.volume
old: 6794.752903635483
new: 281.76289771739914
path: .spaces[1].metrics.halstead.vocabulary
old: 171.0
new: 29.0
path: .spaces[1].metrics.halstead.N2
old: 369.0
new: 24.0
path: .spaces[1].metrics.halstead.n2
old: 138.0
new: 15.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.2526652630722883
new: 1.9294194455678315
path: .spaces[1].metrics.halstead.N1
old: 547.0
new: 34.0
path: .spaces[1].metrics.halstead.effort
old: 299781.54386800464
new: 3155.74445443487
path: .spaces[1].metrics.halstead.length
old: 916.0
new: 58.0
path: .spaces[1].metrics.halstead.level
old: 0.022665681202266568
new: 0.08928571428571429
path: .spaces[1].metrics.halstead.difficulty
old: 44.119565217391305
new: 11.2
path: .spaces[1].metrics.halstead.n1
old: 33.0
new: 14.0
path: .spaces[1].metrics.loc.sloc
old: 318.0
new: 15.0
path: .spaces[1].metrics.loc.lloc
old: 67.0
new: 6.0
path: .spaces[1].metrics.loc.blank
old: 32.0
new: 3.0
path: .spaces[1].metrics.loc.cloc
old: 109.0
new: 0.0
path: .spaces[1].metrics.loc.ploc
old: 177.0
new: 12.0
path: .spaces[1].metrics.nargs.average
old: 1.25
new: 2.0
path: .spaces[1].metrics.nargs.sum
old: 10.0
new: 2.0
path: .spaces[1].metrics.nexits.sum
old: 9.0
new: 2.0
path: .spaces[1].metrics.nexits.average
old: 1.125
new: 2.0
path: .spaces[1].metrics.cyclomatic.average
old: 3.5384615384615383
new: 3.0
path: .spaces[1].metrics.cyclomatic.sum
old: 46.0
new: 3.0
path: .spaces[1].metrics.cognitive.sum
old: 34.0
new: 3.0
path: .spaces[1].metrics.cognitive.average
old: 4.25
new: 3.0
Code
nsINIParserFactory::CreateINIParser(nsIFile* aINIFile, nsIINIParser** aResult) {
*aResult = nullptr;
RefPtr p(new nsINIParserImpl());
if (aINIFile) {
nsresult rv = p->Init(aINIFile);
if (NS_FAILED(rv)) {
return rv;
}
}
p.forget(aResult);
return NS_OK;
}
Minimal test - lines (20, 22)
path: .spaces[0].spaces[1].metrics.halstead.N1
old: 14.0
new: 7.0
path: .spaces[0].spaces[1].metrics.halstead.N2
old: 9.0
new: 8.0
path: .spaces[0].spaces[1].metrics.halstead.length
old: 23.0
new: 15.0
path: .spaces[0].spaces[1].metrics.halstead.n2
old: 8.0
new: 6.0
path: .spaces[0].spaces[1].metrics.halstead.time
old: 33.585176903163344
new: 11.949875002403854
path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 2.6979890350004463
new: 2.067970000576925
path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.023831909562642074
new: 0.011966560027609794
path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 62.05374780501027
new: 31.019550008653873
path: .spaces[0].spaces[1].metrics.halstead.n1
old: 11.0
new: 6.0
path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 19.0
new: 12.0
path: .spaces[0].spaces[1].metrics.halstead.volume
old: 97.70233280920246
new: 53.77443751081734
path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 6.1875
new: 4.0
path: .spaces[0].spaces[1].metrics.halstead.level
old: 0.16161616161616163
new: 0.25
path: .spaces[0].spaces[1].metrics.halstead.effort
old: 604.5331842569402
new: 215.09775004326937
path: .spaces[0].spaces[1].metrics.loc.ploc
old: 3.0
new: 2.0
path: .spaces[0].spaces[1].metrics.loc.sloc
old: 4.0
new: 3.0
path: .spaces[0].spaces[1].metrics.loc.blank
old: 0.0
new: 1.0
path: .spaces[0].spaces[1].metrics.loc.cloc
old: 1.0
new: 0.0
path: .spaces[0].spaces[1].metrics.mi.mi_original
old: 124.48601908248672
new: 132.2515302053208
path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: 138.9677237808766
new: 115.19959464458498
path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 72.79884156870568
new: 77.34007614346245
Code
NS_DECL_NSIINIPARSERWRITER
nsresult Init(nsIFile* aINIFile) { return mParser.Init(aINIFile); }
Minimal test - lines (14, 27)
path: .spaces[0].metrics.mi.mi_original
old: 72.26322048109878
new: 99.95662473800635
path: .spaces[0].metrics.mi.mi_visual_studio
old: 42.25919326380046
new: 58.45416651345401
path: .spaces[0].metrics.mi.mi_sei
old: 68.66548880743018
new: 68.8115343997215
path: .spaces[0].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[0].metrics.nargs.average
old: 0.6666666666666666
new: 0.5
path: .spaces[0].metrics.nexits.average
old: 1.0
new: 0.5
path: .spaces[0].metrics.nexits.sum
old: 3.0
new: 1.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.8333333333333333
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 11.0
new: 3.0
path: .spaces[0].metrics.nom.functions
old: 3.0
new: 2.0
path: .spaces[0].metrics.nom.total
old: 3.0
new: 2.0
path: .spaces[0].metrics.halstead.length
old: 110.0
new: 42.0
path: .spaces[0].metrics.halstead.vocabulary
old: 52.0
new: 28.0
path: .spaces[0].metrics.halstead.n1
old: 18.0
new: 13.0
path: .spaces[0].metrics.halstead.effort
old: 6971.302455303135
new: 1662.3833320475192
path: .spaces[0].metrics.halstead.purity_ratio
old: 2.254839878440665
new: 2.540692268332428
path: .spaces[0].metrics.halstead.level
old: 0.08994708994708996
new: 0.12145748987854252
path: .spaces[0].metrics.halstead.volume
old: 627.04836899552
new: 201.90890672641936
path: .spaces[0].metrics.halstead.bugs
old: 0.12164325391178152
new: 0.04677705354906297
path: .spaces[0].metrics.halstead.difficulty
old: 11.117647058823527
new: 8.233333333333333
path: .spaces[0].metrics.halstead.n2
old: 34.0
new: 15.0
path: .spaces[0].metrics.halstead.N1
old: 68.0
new: 23.0
path: .spaces[0].metrics.halstead.time
old: 387.29458085017416
new: 92.35462955819553
path: .spaces[0].metrics.halstead.N2
old: 42.0
new: 19.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 248.03238662847315
new: 106.70907526996196
path: .spaces[0].metrics.loc.lloc
old: 6.0
new: 1.0
path: .spaces[0].metrics.loc.sloc
old: 48.0
new: 14.0
path: .spaces[0].metrics.loc.ploc
old: 25.0
new: 11.0
path: .spaces[0].metrics.loc.blank
old: 7.0
new: 3.0
path: .spaces[0].metrics.loc.cloc
old: 16.0
new: 0.0
path: .spaces[0].metrics.cognitive.sum
old: 4.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 1.3333333333333333
new: 0.0
Code
class nsINIParserImpl final : public nsIINIParser, public nsIINIParserWriter {
~nsINIParserImpl() = default;
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIINIPARSER
NS_DECL_NSIINIPARSERWRITER
nsresult Init(nsIFile* aINIFile) { return mParser.Init(aINIFile); }
private:
nsINIParser mParser;
bool ContainsNull(const nsACString& aStr);
};