Global Metrics

path: .metrics.nexits.sum
old: 6.0
new: 3.0

path: .metrics.nexits.average
old: 0.4
new: 1.5

path: .metrics.cyclomatic.sum
old: 15.0
new: 7.0

path: .metrics.cyclomatic.average
old: 1.6666666666666667
new: 1.75

path: .metrics.nargs.sum
old: 15.0
new: 6.0

path: .metrics.nargs.average
old: 1.0
new: 3.0

path: .metrics.halstead.length
old: 443.0
new: 101.0

path: .metrics.halstead.N2
old: 185.0
new: 39.0

path: .metrics.halstead.purity_ratio
old: 0.9568840412148062
new: 1.6564090683595605

path: .metrics.halstead.bugs
old: 0.9065011396986724
new: 0.14339595612965436

path: .metrics.halstead.time
old: 7878.833242958565
new: 495.6952223832953

path: .metrics.halstead.vocabulary
old: 79.0
new: 39.0

path: .metrics.halstead.estimated_program_length
old: 423.8996302581592
new: 167.29731590431558

path: .metrics.halstead.N1
old: 258.0
new: 62.0

path: .metrics.halstead.n1
old: 28.0
new: 18.0

path: .metrics.halstead.n2
old: 51.0
new: 21.0

path: .metrics.halstead.volume
old: 2792.5748714424567
new: 533.8256241050872

path: .metrics.halstead.effort
old: 141818.99837325417
new: 8922.514002899316

path: .metrics.halstead.difficulty
old: 50.78431372549019
new: 16.714285714285715

path: .metrics.halstead.level
old: 0.019691119691119693
new: 0.059829059829059825

path: .metrics.loc.sloc
old: 130.0
new: 36.0

path: .metrics.loc.ploc
old: 85.0
new: 25.0

path: .metrics.loc.blank
old: 11.0
new: 4.0

path: .metrics.loc.cloc
old: 34.0
new: 7.0

path: .metrics.loc.lloc
old: 32.0
new: 5.0

path: .metrics.cognitive.average
old: 0.4666666666666667
new: 2.0

path: .metrics.cognitive.sum
old: 7.0
new: 4.0

path: .metrics.nom.total
old: 15.0
new: 2.0

path: .metrics.nom.functions
old: 7.0
new: 2.0

path: .metrics.nom.closures
old: 8.0
new: 0.0

path: .metrics.mi.mi_sei
old: 29.85873493026747
new: 70.08523539684788

path: .metrics.mi.mi_visual_studio
old: 27.74000077378423
new: 46.01206617201506

path: .metrics.mi.mi_original
old: 47.435401323171035
new: 78.68063315414575

Spaces Data

Minimal test - lines (16, 34)

path: .spaces[0].metrics.halstead.effort
old: 144171.90064478669
new: 8771.073958975892

path: .spaces[0].metrics.halstead.estimated_program_length
old: 409.7267201792581
new: 144.5455183272174

path: .spaces[0].metrics.halstead.length
old: 440.0
new: 95.0

path: .spaces[0].metrics.halstead.n1
old: 28.0
new: 18.0

path: .spaces[0].metrics.halstead.vocabulary
old: 77.0
new: 35.0

path: .spaces[0].metrics.halstead.difficulty
old: 52.285714285714285
new: 18.0

path: .spaces[0].metrics.halstead.n2
old: 49.0
new: 17.0

path: .spaces[0].metrics.halstead.N2
old: 183.0
new: 34.0

path: .spaces[0].metrics.halstead.volume
old: 2757.3860779057563
new: 487.2818866097718

path: .spaces[0].metrics.halstead.purity_ratio
old: 0.9311970913164958
new: 1.5215317718654462

path: .spaces[0].metrics.halstead.time
old: 8009.550035821482
new: 487.2818866097718

path: .spaces[0].metrics.halstead.bugs
old: 0.9165000532521268
new: 0.14176877737478305

path: .spaces[0].metrics.halstead.level
old: 0.01912568306010929
new: 0.05555555555555555

path: .spaces[0].metrics.halstead.N1
old: 257.0
new: 61.0

path: .spaces[0].metrics.mi.mi_sei
old: 30.170316012693934
new: 54.374787800195165

path: .spaces[0].metrics.mi.mi_original
old: 48.89359329032932
new: 89.73810609067267

path: .spaces[0].metrics.mi.mi_visual_studio
old: 28.592744614227673
new: 52.47842461442847

path: .spaces[0].metrics.cyclomatic.average
old: 1.75
new: 2.0

path: .spaces[0].metrics.cyclomatic.sum
old: 14.0
new: 6.0

path: .spaces[0].metrics.nargs.average
old: 1.0
new: 3.0

path: .spaces[0].metrics.nargs.sum
old: 15.0
new: 6.0

path: .spaces[0].metrics.nom.functions
old: 7.0
new: 2.0

path: .spaces[0].metrics.nom.closures
old: 8.0
new: 0.0

path: .spaces[0].metrics.nom.total
old: 15.0
new: 2.0

path: .spaces[0].metrics.nexits.average
old: 0.4
new: 1.5

path: .spaces[0].metrics.nexits.sum
old: 6.0
new: 3.0

path: .spaces[0].metrics.cognitive.average
old: 0.4666666666666667
new: 2.0

path: .spaces[0].metrics.cognitive.sum
old: 7.0
new: 4.0

path: .spaces[0].metrics.loc.cloc
old: 28.0
new: 0.0

path: .spaces[0].metrics.loc.blank
old: 10.0
new: 1.0

path: .spaces[0].metrics.loc.sloc
old: 121.0
new: 19.0

path: .spaces[0].metrics.loc.ploc
old: 83.0
new: 18.0

path: .spaces[0].metrics.loc.lloc
old: 31.0
new: 5.0

Code

class nsStaticAtomUtils {
 public:
  static mozilla::Maybe Lookup(nsAtom* aAtom,
                                         const nsStaticAtom* aAtoms,
                                         uint32_t aCount) {
    if (aAtom->IsStatic()) {
      ptrdiff_t index = aAtom->AsStatic() - aAtoms;
      if (index >= 0 && index < static_cast(aCount)) {
        return mozilla::Some(static_cast(index));
      }
    }
    return mozilla::Nothing();
  }

  static bool IsMember(nsAtom* aAtom, const nsStaticAtom* aAtoms,
                       uint32_t aCount) {
    return Lookup(aAtom, aAtoms, aCount).isSome();
  }
};

Minimal test - lines (30, 33)

path: .spaces[0].spaces[1].metrics.loc.lloc
old: 4.0
new: 1.0

path: .spaces[0].spaces[1].metrics.loc.blank
old: 1.0
new: 0.0

path: .spaces[0].spaces[1].metrics.loc.ploc
old: 8.0
new: 4.0

path: .spaces[0].spaces[1].metrics.loc.sloc
old: 9.0
new: 4.0

path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 12.27777777777778
new: 5.5

path: .spaces[0].spaces[1].metrics.halstead.n1
old: 13.0
new: 8.0

path: .spaces[0].spaces[1].metrics.halstead.level
old: 0.08144796380090497
new: 0.18181818181818185

path: .spaces[0].spaces[1].metrics.halstead.effort
old: 2299.580238010633
new: 572.0

path: .spaces[0].spaces[1].metrics.halstead.N2
old: 17.0
new: 11.0

path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 22.0
new: 16.0

path: .spaces[0].spaces[1].metrics.halstead.volume
old: 187.29612798276648
new: 104.0

path: .spaces[0].spaces[1].metrics.halstead.n2
old: 9.0
new: 8.0

path: .spaces[0].spaces[1].metrics.halstead.length
old: 42.0
new: 26.0

path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.05807347183693701
new: 0.022969035790571857

path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 1.8246438416384525
new: 1.8461538461538465

path: .spaces[0].spaces[1].metrics.halstead.time
old: 127.75445766725738
new: 31.77777777777778

path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 76.63504134881501
new: 48.0

path: .spaces[0].spaces[1].metrics.halstead.N1
old: 25.0
new: 15.0

path: .spaces[0].spaces[1].metrics.nargs.sum
old: 2.0
new: 3.0

path: .spaces[0].spaces[1].metrics.nargs.average
old: 2.0
new: 3.0

path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: 80.16149320129931
new: 103.52771346566632

path: .spaces[0].spaces[1].metrics.mi.mi_original
old: 107.964968977734
new: 124.16119867432266

path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 63.13740875890876
new: 72.60888811363898

Code

  static bool IsMember(nsAtom* aAtom, const nsStaticAtom* aAtoms,
                       uint32_t aCount) {
    return Lookup(aAtom, aAtoms, aCount).isSome();
  }

Minimal test - lines (18, 28)

path: .spaces[0].spaces[0].metrics.cognitive.average
old: 1.0
new: 4.0

path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 1.0
new: 4.0

path: .spaces[0].spaces[0].metrics.nexits.sum
old: 1.0
new: 2.0

path: .spaces[0].spaces[0].metrics.nexits.average
old: 1.0
new: 2.0

path: .spaces[0].spaces[0].metrics.halstead.n1
old: 17.0
new: 16.0

path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 89.138352755659
new: 117.30296890880646

path: .spaces[0].spaces[0].metrics.halstead.volume
old: 275.09775004326934
new: 323.85477931016226

path: .spaces[0].spaces[0].metrics.halstead.N1
old: 38.0
new: 44.0

path: .spaces[0].spaces[0].metrics.halstead.n2
old: 7.0
new: 14.0

path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.0374331550802139
new: 0.07954545454545454

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.1259986277482097
new: 0.08499017179128546

path: .spaces[0].spaces[0].metrics.halstead.length
old: 60.0
new: 66.0

path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 26.714285714285715
new: 12.571428571428571

path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.4856392125943167
new: 1.777317710739492

path: .spaces[0].spaces[0].metrics.halstead.effort
old: 7349.039894013053
new: 4071.317225613469

path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 24.0
new: 30.0

path: .spaces[0].spaces[0].metrics.halstead.time
old: 408.27999411183623
new: 226.18429031185937

path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 74.58500210667002
new: 70.67335100969262

path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 60.83570979508937
new: 59.16757983827854

path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 104.02906374960284
new: 101.17656152345631

path: .spaces[0].spaces[0].metrics.loc.sloc
old: 10.0
new: 11.0

path: .spaces[0].spaces[0].metrics.loc.lloc
old: 6.0
new: 4.0

path: .spaces[0].spaces[0].metrics.loc.ploc
old: 10.0
new: 11.0

path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 2.0
new: 4.0

path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.0
new: 4.0

Code

  static mozilla::Maybe Lookup(nsAtom* aAtom,
                                         const nsStaticAtom* aAtoms,
                                         uint32_t aCount) {
    if (aAtom->IsStatic()) {
      ptrdiff_t index = aAtom->AsStatic() - aAtoms;
      if (index >= 0 && index < static_cast(aCount)) {
        return mozilla::Some(static_cast(index));
      }
    }
    return mozilla::Nothing();
  }