Global Metrics
path: .metrics.nom.functions
old: 7.0
new: 3.0
path: .metrics.nom.total
old: 7.0
new: 3.0
path: .metrics.cognitive.average
old: 3.2857142857142856
new: 0.0
path: .metrics.cognitive.sum
old: 23.0
new: 0.0
path: .metrics.nexits.sum
old: 8.0
new: 2.0
path: .metrics.nexits.average
old: 1.1428571428571428
new: 0.6666666666666666
path: .metrics.nargs.average
old: 1.0
new: 0.6666666666666666
path: .metrics.nargs.sum
old: 7.0
new: 2.0
path: .metrics.loc.lloc
old: 39.0
new: 2.0
path: .metrics.loc.ploc
old: 518.0
new: 27.0
path: .metrics.loc.blank
old: 27.0
new: 10.0
path: .metrics.loc.cloc
old: 87.0
new: 10.0
path: .metrics.loc.sloc
old: 632.0
new: 47.0
path: .metrics.cyclomatic.average
old: 2.363636363636364
new: 1.0
path: .metrics.cyclomatic.sum
old: 26.0
new: 6.0
path: .metrics.halstead.volume
old: 15550.20930434267
new: 623.2327926967881
path: .metrics.halstead.bugs
old: 2.158072890853071
new: 0.0955225964634524
path: .metrics.halstead.length
old: 1919.0
new: 111.0
path: .metrics.halstead.estimated_program_length
old: 2107.54247590989
new: 235.76932453692504
path: .metrics.halstead.n1
old: 25.0
new: 12.0
path: .metrics.halstead.purity_ratio
old: 1.098250378275086
new: 2.1240479688011265
path: .metrics.halstead.vocabulary
old: 275.0
new: 49.0
path: .metrics.halstead.level
old: 0.029850746268656716
new: 0.1284722222222222
path: .metrics.halstead.N2
old: 670.0
new: 48.0
path: .metrics.halstead.difficulty
old: 33.5
new: 7.783783783783784
path: .metrics.halstead.n2
old: 250.0
new: 37.0
path: .metrics.halstead.time
old: 28940.667316415525
new: 269.50607251753
path: .metrics.halstead.effort
old: 520932.01169547945
new: 4851.10930531554
path: .metrics.halstead.N1
old: 1249.0
new: 63.0
path: .metrics.mi.mi_original
old: 10.358479051284576
new: 73.7860242645295
path: .metrics.mi.mi_sei
old: -30.926620492943247
new: 64.12617205729948
path: .metrics.mi.mi_visual_studio
old: 6.057590088470512
new: 43.14972179212252
Spaces Data
Minimal test - lines (19, 45)
path: .spaces[0].metrics.cyclomatic.average
old: 2.5
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 25.0
new: 5.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 6.319903897447292
new: 48.77185210977856
path: .spaces[0].metrics.mi.mi_original
old: 10.807035664634869
new: 83.39986710772132
path: .spaces[0].metrics.mi.mi_sei
old: -30.93741716639308
new: 59.81607508610371
path: .spaces[0].metrics.nexits.sum
old: 8.0
new: 2.0
path: .spaces[0].metrics.nexits.average
old: 1.1428571428571428
new: 0.6666666666666666
path: .spaces[0].metrics.halstead.level
old: 0.029700598802395207
new: 0.12790697674418605
path: .spaces[0].metrics.halstead.estimated_program_length
old: 2088.737089720313
new: 209.48455594748285
path: .spaces[0].metrics.halstead.volume
old: 15513.815439143356
new: 576.6445751146158
path: .spaces[0].metrics.halstead.n1
old: 25.0
new: 12.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.0895863796141436
new: 1.9950910090236464
path: .spaces[0].metrics.halstead.length
old: 1917.0
new: 105.0
path: .spaces[0].metrics.halstead.N1
old: 1249.0
new: 62.0
path: .spaces[0].metrics.halstead.difficulty
old: 33.66935483870968
new: 7.818181818181818
path: .spaces[0].metrics.halstead.n2
old: 248.0
new: 33.0
path: .spaces[0].metrics.halstead.vocabulary
old: 273.0
new: 45.0
path: .spaces[0].metrics.halstead.time
old: 29018.897606820577
new: 250.4617851507927
path: .spaces[0].metrics.halstead.bugs
old: 2.1619601704926237
new: 0.0909678778003082
path: .spaces[0].metrics.halstead.N2
old: 668.0
new: 43.0
path: .spaces[0].metrics.halstead.effort
old: 522340.1569227703
new: 4508.312132714269
path: .spaces[0].metrics.nargs.sum
old: 7.0
new: 2.0
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 0.6666666666666666
path: .spaces[0].metrics.loc.lloc
old: 39.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 516.0
new: 21.0
path: .spaces[0].metrics.loc.cloc
old: 82.0
new: 1.0
path: .spaces[0].metrics.loc.blank
old: 26.0
new: 5.0
path: .spaces[0].metrics.loc.sloc
old: 624.0
new: 27.0
path: .spaces[0].metrics.cognitive.sum
old: 23.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 3.2857142857142856
new: 0.0
path: .spaces[0].metrics.nom.functions
old: 7.0
new: 3.0
path: .spaces[0].metrics.nom.total
old: 7.0
new: 3.0
Code
class nsMemoryImpl : public nsIMemory {
public:
// We don't use the generic macros because we are a special static object
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aResult) override;
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) override { return 1; }
NS_IMETHOD_(MozExternalRefCountType) Release(void) override { return 1; }
NS_DECL_NSIMEMORY
static nsresult Create(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult FlushMemory(const char16_t* aReason, bool aImmediate);
void RunFlushers(const char16_t* aReason);
protected:
struct FlushEvent : public nsIRunnable {
constexpr FlushEvent() : mReason(nullptr) {}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIRUNNABLE
const char16_t* mReason;
};
static mozilla::Atomic sIsFlushing;
static FlushEvent sFlushEvent;
static PRIntervalTime sLastFlushTime;
};
Minimal test - lines (23, 23)
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 11.09787307005297
new: 155.2836050228807
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: -30.727150882335284
new: 148.4278547652622
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 6.489984251492965
new: 90.80912574437468
path: .spaces[0].spaces[0].metrics.nexits.average
old: 1.1428571428571428
new: 1.0
path: .spaces[0].spaces[0].metrics.nexits.sum
old: 8.0
new: 1.0
path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 24.0
new: 1.0
path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.6666666666666665
new: 1.0
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 7.0
new: 1.0
path: .spaces[0].spaces[0].metrics.loc.cloc
old: 81.0
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.blank
old: 27.0
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 514.0
new: 1.0
path: .spaces[0].spaces[0].metrics.loc.lloc
old: 39.0
new: 1.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 622.0
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.0858188568907488
new: 1.944234353490973
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.029625187406296855
new: 0.4
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 272.0
new: 7.0
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 15487.4913409944
new: 19.651484454403228
path: .spaces[0].spaces[0].metrics.halstead.time
old: 29043.40059728763
new: 2.7293728408893374
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 667.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.length
old: 1915.0
new: 7.0
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 247.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 1248.0
new: 5.0
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 2079.343110945784
new: 13.60964047443681
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 33.75506072874494
new: 2.5
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 522781.21075117734
new: 49.12871113600807
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 2.163177010586682
new: 0.004471319041702271
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 25.0
new: 5.0
path: .spaces[0].spaces[0].metrics.nom.functions
old: 7.0
new: 1.0
path: .spaces[0].spaces[0].metrics.nom.total
old: 7.0
new: 1.0
path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 23.0
new: 0.0
path: .spaces[0].spaces[0].metrics.cognitive.average
old: 3.2857142857142856
new: 0.0
Code
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) override { return 1; }