# Global Metrics

path: .metrics.loc.ploc
old: 331.0
new: 16.0
path: .metrics.loc.cloc
old: 73.0
new: 21.0
path: .metrics.loc.sloc
old: 482.0
new: 42.0
path: .metrics.loc.blank
old: 78.0
new: 5.0
path: .metrics.loc.lloc
old: 101.0
new: 2.0
path: .metrics.mi.mi_original
old: 12.274440995545348
new: 81.22103820471179
path: .metrics.mi.mi_sei
old: -24.85546516822304
new: 86.54385840456895
path: .metrics.mi.mi_visual_studio
old: 7.178035669909559
new: 47.49768316065017
path: .metrics.cognitive.average
old: 4.777777777777778
new: 0.0
path: .metrics.cognitive.sum
old: 43.0
new: 0.0
path: .metrics.halstead.purity_ratio
old: 1.572748111702035
new: 1.3588382207753282
path: .metrics.halstead.difficulty
old: 41.3
new: 14.055555555555555
path: .metrics.halstead.n1
old: 35.0
new: 11.0
path: .metrics.halstead.estimated_program_length
old: 1937.625673616907
new: 66.58307281799108
path: .metrics.halstead.bugs
old: 1.8342321363304703
new: 0.06897523160608798
path: .metrics.halstead.n2
old: 225.0
new: 9.0
path: .metrics.halstead.N2
old: 531.0
new: 23.0
path: .metrics.halstead.level
old: 0.02421307506053269
new: 0.07114624505928854
path: .metrics.halstead.length
old: 1232.0
new: 49.0
path: .metrics.halstead.vocabulary
old: 260.0
new: 20.0
path: .metrics.halstead.time
old: 22677.272784188255
new: 165.36710676641553
path: .metrics.halstead.N1
old: 701.0
new: 26.0
path: .metrics.halstead.volume
old: 9883.557145651055
new: 211.77447664948076
path: .metrics.halstead.effort
old: 408190.9101153886
new: 2976.6079217954793
path: .metrics.nargs.sum
old: 20.0
new: 1.0
path: .metrics.nargs.average
old: 2.2222222222222223
new: 0.3333333333333333
path: .metrics.nom.total
old: 9.0
new: 3.0
path: .metrics.nom.functions
old: 9.0
new: 3.0
path: .metrics.nexits.sum
old: 12.0
new: 1.0
path: .metrics.nexits.average
old: 1.3333333333333333
new: 0.3333333333333333
path: .metrics.cyclomatic.average
old: 3.357142857142857
new: 1.0
path: .metrics.cyclomatic.sum
old: 47.0
new: 6.0

# Spaces Data

## Minimal test - lines (14, 40)

path: .spaces[0].metrics.nom.functions
old: 0.0
new: 3.0
path: .spaces[0].metrics.nom.total
old: 0.0
new: 3.0
path: .spaces[0].metrics.cognitive.average
old: null
new: 0.0
path: .spaces[0].metrics.halstead.bugs
old: 0.008694593889651886
new: 0.0695556733346133
path: .spaces[0].metrics.halstead.estimated_program_length
old: 36.529325012980806
new: 57.70523225941349
path: .spaces[0].metrics.halstead.time
old: 7.400879436282185
new: 167.45889291506427
path: .spaces[0].metrics.halstead.level
old: 0.5
new: 0.06363636363636364
path: .spaces[0].metrics.halstead.volume
old: 66.60791492653966
new: 191.81655006634637
path: .spaces[0].metrics.halstead.n2
old: 9.0
new: 7.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 2.0294069451656003
new: 1.254461570856815
path: .spaces[0].metrics.halstead.difficulty
old: 2.0
new: 15.714285714285714
path: .spaces[0].metrics.halstead.effort
old: 133.21582985307933
new: 3014.260072471157
path: .spaces[0].metrics.halstead.vocabulary
old: 13.0
new: 18.0
path: .spaces[0].metrics.halstead.N2
old: 9.0
new: 20.0
path: .spaces[0].metrics.halstead.length
old: 18.0
new: 46.0
path: .spaces[0].metrics.halstead.n1
old: 4.0
new: 11.0
path: .spaces[0].metrics.halstead.N1
old: 9.0
new: 26.0
path: .spaces[0].metrics.mi.mi_original
old: 108.6806305246595
new: 89.12343764699321
path: .spaces[0].metrics.mi.mi_sei
old: 81.19397456600369
new: 96.3229310155854
path: .spaces[0].metrics.mi.mi_visual_studio
old: 63.555924283426606
new: 52.11896938420655
path: .spaces[0].metrics.nargs.sum
old: 0.0
new: 1.0
path: .spaces[0].metrics.nargs.average
old: null
new: 0.3333333333333333
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 5.0
path: .spaces[0].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[0].metrics.nexits.average
old: null
new: 0.3333333333333333
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 12.0
path: .spaces[0].metrics.loc.ploc
old: 11.0
new: 12.0
path: .spaces[0].metrics.loc.sloc
old: 12.0
new: 27.0
path: .spaces[0].metrics.loc.blank
old: 1.0
new: 3.0
path: .spaces[0].metrics.loc.lloc
old: 0.0
new: 2.0

### Code

    namespace mozilla {

    /**
     * Save the current value of a variable and restore it when the object
     * goes out of scope.  For example:
     *   {
     *     AutoRestore savePainting(mIsPainting);
     *     mIsPainting = true;
     *
     *     // ... your code here ...
     *
     *     // mIsPainting is reset to its old value at the end of this block
     *   }
     */
    template
    class MOZ_RAII AutoRestore {
     private:
      T& mLocation;
      T mValue;

     public:
      explicit AutoRestore(T& aValue) : mLocation(aValue), mValue(aValue) {}
      ~AutoRestore() { mLocation = mValue; }
      T SavedValue() const { return mValue; }
    };

    }  // namespace mozilla