# Global Metrics

path: .metrics.halstead.N1
old: 151.0
new: 228.0
path: .metrics.halstead.n1
old: 20.0
new: 26.0
path: .metrics.halstead.estimated_program_length
old: 319.76794634993746
new: 476.6248684081795
path: .metrics.halstead.n2
old: 43.0
new: 60.0
path: .metrics.halstead.purity_ratio
old: 1.2842086198792668
new: 1.203598152545908
path: .metrics.halstead.difficulty
old: 22.79069767441861
new: 36.4
path: .metrics.halstead.level
old: 0.04387755102040816
new: 0.027472527472527472
path: .metrics.halstead.time
old: 1884.4649185173769
new: 5146.15281556544
path: .metrics.halstead.bugs
old: 0.3492897060256371
new: 0.6824154765610917
path: .metrics.halstead.effort
old: 33920.36853331278
new: 92630.75068017792
path: .metrics.halstead.length
old: 249.0
new: 396.0
path: .metrics.halstead.vocabulary
old: 63.0
new: 86.0
path: .metrics.halstead.volume
old: 1488.3427009514792
new: 2544.8008428620305
path: .metrics.halstead.N2
old: 98.0
new: 168.0
path: .metrics.nexits.sum
old: 2.0
new: 8.0
path: .metrics.nexits.average
old: 1.0
new: 1.1428571428571428
path: .metrics.nargs.average
old: 1.0
new: 1.8571428571428572
path: .metrics.nargs.sum
old: 2.0
new: 13.0
path: .metrics.nom.functions
old: 2.0
new: 7.0
path: .metrics.nom.total
old: 2.0
new: 7.0
path: .metrics.mi.mi_visual_studio
old: 36.89283627759329
new: 27.743397053537915
path: .metrics.mi.mi_original
old: 63.08675003468453
new: 47.44120896154983
path: .metrics.mi.mi_sei
old: 46.0837490460172
new: 12.981780006112103
path: .metrics.loc.ploc
old: 43.0
new: 103.0
path: .metrics.loc.lloc
old: 16.0
new: 38.0
path: .metrics.loc.blank
old: 11.0
new: 21.0
path: .metrics.loc.sloc
old: 65.0
new: 132.0
path: .metrics.loc.cloc
old: 11.0
new: 8.0
path: .metrics.cognitive.average
old: 4.0
new: 1.1428571428571428
path: .metrics.cyclomatic.sum
old: 10.0
new: 16.0
path: .metrics.cyclomatic.average
old: 3.3333333333333335
new: 1.7777777777777777

# Spaces Data

## Minimal test - lines (41, 58)

path: .spaces[1].metrics.cognitive.sum
old: 8.0
new: 2.0
path: .spaces[1].metrics.cognitive.average
old: 8.0
new: 2.0
path: .spaces[1].metrics.loc.ploc
old: 38.0
new: 18.0
path: .spaces[1].metrics.loc.cloc
old: 8.0
new: 0.0
path: .spaces[1].metrics.loc.lloc
old: 15.0
new: 10.0
path: .spaces[1].metrics.loc.sloc
old: 54.0
new: 18.0
path: .spaces[1].metrics.loc.blank
old: 8.0
new: 0.0
path: .spaces[1].metrics.cyclomatic.sum
old: 8.0
new: 3.0
path: .spaces[1].metrics.cyclomatic.average
old: 8.0
new: 3.0
path: .spaces[1].metrics.mi.mi_sei
old: 50.14805895911055
new: 56.859237685729326
path: .spaces[1].metrics.mi.mi_visual_studio
old: 39.30093337834825
new: 53.60931226285778
path: .spaces[1].metrics.mi.mi_original
old: 67.2045960769755
new: 91.6719239694868
path: .spaces[1].metrics.halstead.bugs
old: 0.3429196694982772
new: 0.13554962864830933
path: .spaces[1].metrics.halstead.N2
old: 88.0
new: 34.0
path: .spaces[1].metrics.halstead.time
old: 1833.1498672598193
new: 455.5718439045603
path: .spaces[1].metrics.halstead.n1
old: 20.0
new: 17.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.1716452312370973
new: 1.4831874255695083
path: .spaces[1].metrics.halstead.volume
old: 1312.368654970098
new: 453.9954707422608
path: .spaces[1].metrics.halstead.N1
old: 139.0
new: 56.0
path: .spaces[1].metrics.halstead.length
old: 227.0
new: 90.0
path: .spaces[1].metrics.halstead.effort
old: 32996.69761067675
new: 8200.293190282086
path: .spaces[1].metrics.halstead.estimated_program_length
old: 265.9634674908211
new: 133.48686830125575
path: .spaces[1].metrics.halstead.difficulty
old: 25.142857142857142
new: 18.0625
path: .spaces[1].metrics.halstead.level
old: 0.03977272727272727
new: 0.05536332179930796
path: .spaces[1].metrics.halstead.vocabulary
old: 55.0
new: 33.0
path: .spaces[1].metrics.halstead.n2
old: 35.0
new: 16.0
path: .spaces[1].metrics.nargs.average
old: 1.0
new: 3.0
path: .spaces[1].metrics.nargs.sum
old: 1.0
new: 3.0

### Code

    StringUnicharInputStream::Read(char16_t* aBuf, uint32_t aCount,
                                   uint32_t* aReadCount) {
      if (mPos >= mLen) {
        *aReadCount = 0;
        return NS_OK;
      }
      nsAString::const_iterator iter;
      mString.BeginReading(iter);
      const char16_t* us = iter.get();
      uint32_t amount = mLen - mPos;
      if (amount > aCount) {
        amount = aCount;
      }
      memcpy(aBuf, us + mPos, sizeof(char16_t) * amount);
      mPos += amount;
      *aReadCount = amount;
      return NS_OK;
    }

## Minimal test - lines (24, 38)

path: .spaces[0].metrics.nom.functions
old: 1.0
new: 2.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 2.0
path: .spaces[0].metrics.loc.sloc
old: 3.0
new: 15.0
path: .spaces[0].metrics.loc.lloc
old: 1.0
new: 0.0
path: .spaces[0].metrics.loc.ploc
old: 3.0
new: 12.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 3.0
path: .spaces[0].metrics.halstead.n1
old: 9.0
new: 11.0
path: .spaces[0].metrics.halstead.difficulty
old: 5.142857142857143
new: 8.708333333333334
path: .spaces[0].metrics.halstead.bugs
old: 0.018439184525994783
new: 0.04882371397025653
path: .spaces[0].metrics.halstead.N2
old: 8.0
new: 19.0
path: .spaces[0].metrics.halstead.effort
old: 411.42857142857144
new: 1772.6708415298422
path: .spaces[0].metrics.halstead.n2
old: 7.0
new: 12.0
path: .spaces[0].metrics.halstead.time
old: 22.857142857142858
new: 98.48171341832456
path: .spaces[0].metrics.halstead.length
old: 20.0
new: 45.0
path: .spaces[0].metrics.halstead.N1
old: 12.0
new: 26.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 48.18080946738404
new: 81.07329781366414
path: .spaces[0].metrics.halstead.level
old: 0.1944444444444444
new: 0.11483253588516744
path: .spaces[0].metrics.halstead.vocabulary
old: 16.0
new: 23.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 2.4090404733692017
new: 1.8016288403036476
path: .spaces[0].metrics.halstead.volume
old: 80.0
new: 203.5602880225656
path: .spaces[0].metrics.mi.mi_original
old: 130.18594242327245
new: 98.79658321558108
path: .spaces[0].metrics.mi.mi_sei
old: 112.219581394903
new: 67.13794824809324
path: .spaces[0].metrics.mi.mi_visual_studio
old: 76.13213007208915
new: 57.775779658234555
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 0.5
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 3.0

### Code

    class StringUnicharInputStream final : public nsIUnicharInputStream {
     public:
      explicit StringUnicharInputStream(const nsAString& aString)
          : mString(aString), mPos(0), mLen(aString.Length()) {}

      NS_DECL_ISUPPORTS
      NS_DECL_NSIUNICHARINPUTSTREAM

      nsString mString;
      uint32_t mPos;
      uint32_t mLen;

     private:
      ~StringUnicharInputStream() = default;
    };