# Global Metrics

path: .metrics.cyclomatic.sum
old: 59.0
new: 9.0
path: .metrics.cyclomatic.average
old: 6.555555555555555
new: 1.0
path: .metrics.loc.sloc
old: 403.0
new: 136.0
path: .metrics.loc.lloc
old: 171.0
new: 4.0
path: .metrics.loc.cloc
old: 59.0
new: 71.0
path: .metrics.loc.blank
old: 66.0
new: 17.0
path: .metrics.loc.ploc
old: 278.0
new: 48.0
path: .metrics.halstead.estimated_program_length
old: 1283.7294640107664
new: 158.14481635314195
path: .metrics.halstead.bugs
old: 2.4740798526140138
new: 0.2440354937196513
path: .metrics.halstead.time
old: 35524.66130176433
new: 1100.4970234891157
path: .metrics.halstead.length
old: 1458.0
new: 180.0
path: .metrics.halstead.level
old: 0.0171900826446281
new: 0.047337278106508875
path: .metrics.halstead.n1
old: 30.0
new: 13.0
path: .metrics.halstead.difficulty
old: 58.17307692307692
new: 21.125
path: .metrics.halstead.purity_ratio
old: 0.8804728834093047
new: 0.8785823130730108
path: .metrics.halstead.vocabulary
old: 186.0
new: 37.0
path: .metrics.halstead.volume
old: 10992.09354659551
new: 937.701605813211
path: .metrics.halstead.N1
old: 853.0
new: 102.0
path: .metrics.halstead.n2
old: 156.0
new: 24.0
path: .metrics.halstead.N2
old: 605.0
new: 78.0
path: .metrics.halstead.effort
old: 639443.9034317579
new: 19808.94642280408
path: .metrics.nexits.average
old: 1.875
new: 0.2857142857142857
path: .metrics.nexits.sum
old: 15.0
new: 2.0
path: .metrics.mi.mi_sei
old: -24.648205222003153
new: 47.76440078250886
path: .metrics.mi.mi_visual_studio
old: 6.936598694290714
new: 31.438096836409184
path: .metrics.mi.mi_original
old: 11.86158376723712
new: 53.759145590259706
path: .metrics.nom.functions
old: 8.0
new: 7.0
path: .metrics.nom.total
old: 8.0
new: 7.0
path: .metrics.cognitive.sum
old: 83.0
new: 0.0
path: .metrics.cognitive.average
old: 10.375
new: 0.0
path: .metrics.nargs.average
old: 2.5
new: 0.8571428571428571
path: .metrics.nargs.sum
old: 20.0
new: 6.0

# Spaces Data

## Minimal test - lines (117, 120)

path: .spaces[1].metrics.halstead.bugs
old: 0.11398294503295676
new: 0.025798404612506903
path: .spaces[1].metrics.halstead.length
old: 89.0
new: 23.0
path: .spaces[1].metrics.halstead.estimated_program_length
old: 112.1057163358342
new: 35.60964047443681
path: .spaces[1].metrics.halstead.level
old: 0.06837606837606838
new: 0.125
path: .spaces[1].metrics.halstead.N2
old: 36.0
new: 10.0
path: .spaces[1].metrics.halstead.n2
old: 16.0
new: 5.0
path: .spaces[1].metrics.halstead.volume
old: 432.3603085663539
new: 85.11011351724513
path: .spaces[1].metrics.halstead.N1
old: 53.0
new: 13.0
path: .spaces[1].metrics.halstead.n1
old: 13.0
new: 8.0
path: .spaces[1].metrics.halstead.time
old: 351.2927507101626
new: 37.82671711877561
path: .spaces[1].metrics.halstead.difficulty
old: 14.625
new: 8.0
path: .spaces[1].metrics.halstead.effort
old: 6323.2695127829265
new: 680.880908137961
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.2596147902902717
new: 1.5482452380189915
path: .spaces[1].metrics.halstead.vocabulary
old: 29.0
new: 13.0
path: .spaces[1].metrics.cyclomatic.sum
old: 3.0
new: 1.0
path: .spaces[1].metrics.cyclomatic.average
old: 3.0
new: 1.0
path: .spaces[1].metrics.mi.mi_sei
old: 72.43669526493774
new: 105.03145491368996
path: .spaces[1].metrics.mi.mi_visual_studio
old: 49.9165464748243
new: 73.2184285493049
path: .spaces[1].metrics.mi.mi_original
old: 85.35729447194956
new: 125.20351281931138
path: .spaces[1].metrics.loc.blank
old: 7.0
new: 0.0
path: .spaces[1].metrics.loc.cloc
old: 3.0
new: 0.0
path: .spaces[1].metrics.loc.sloc
old: 27.0
new: 4.0
path: .spaces[1].metrics.loc.ploc
old: 17.0
new: 4.0
path: .spaces[1].metrics.loc.lloc
old: 11.0
new: 1.0
path: .spaces[1].metrics.nexits.sum
old: 2.0
new: 1.0
path: .spaces[1].metrics.nexits.average
old: 2.0
new: 1.0
path: .spaces[1].metrics.cognitive.sum
old: 2.0
new: 0.0
path: .spaces[1].metrics.cognitive.average
old: 2.0
new: 0.0

### Code

    const nsTPromiseFlatString TPromiseFlatString(
        const typename nsTPromiseFlatString::substring_type& aString) {
      return nsTPromiseFlatString(aString);
    }

## Minimal test - lines (123, 126)

path: .spaces[2].metrics.loc.blank
old: 3.0
new: 0.0
path: .spaces[2].metrics.loc.sloc
old: 25.0
new: 4.0
path: .spaces[2].metrics.loc.lloc
old: 10.0
new: 1.0
path: .spaces[2].metrics.loc.ploc
old: 22.0
new: 4.0
path: .spaces[2].metrics.nexits.sum
old: 2.0
new: 1.0
path: .spaces[2].metrics.nexits.average
old: 2.0
new: 1.0
path: .spaces[2].metrics.mi.mi_original
old: 85.60900853393436
new: 125.20351281931138
path: .spaces[2].metrics.mi.mi_visual_studio
old: 50.06374768066337
new: 73.2184285493049
path: .spaces[2].metrics.mi.mi_sei
old: 48.315939372337624
new: 105.03145491368996
path: .spaces[2].metrics.cyclomatic.average
old: 5.0
new: 1.0
path: .spaces[2].metrics.cyclomatic.sum
old: 5.0
new: 1.0
path: .spaces[2].metrics.halstead.bugs
old: 0.12875845367530048
new: 0.025798404612506903
path: .spaces[2].metrics.halstead.effort
old: 7591.813149634473
new: 680.880908137961
path: .spaces[2].metrics.halstead.level
old: 0.06312292358803986
new: 0.125
path: .spaces[2].metrics.halstead.N2
old: 43.0
new: 10.0
path: .spaces[2].metrics.halstead.volume
old: 479.2174413390531
new: 85.11011351724513
path: .spaces[2].metrics.halstead.length
old: 95.0
new: 23.0
path: .spaces[2].metrics.halstead.estimated_program_length
old: 134.01359166423458
new: 35.60964047443681
path: .spaces[2].metrics.halstead.n2
old: 19.0
new: 5.0
path: .spaces[2].metrics.halstead.time
old: 421.7673972019152
new: 37.82671711877561
path: .spaces[2].metrics.halstead.difficulty
old: 15.842105263157896
new: 8.0
path: .spaces[2].metrics.halstead.N1
old: 52.0
new: 13.0
path: .spaces[2].metrics.halstead.n1
old: 14.0
new: 8.0
path: .spaces[2].metrics.halstead.purity_ratio
old: 1.4106693859393111
new: 1.5482452380189915
path: .spaces[2].metrics.halstead.vocabulary
old: 33.0
new: 13.0
path: .spaces[2].metrics.cognitive.average
old: 5.0
new: 0.0
path: .spaces[2].metrics.cognitive.sum
old: 5.0
new: 0.0

### Code

    const nsTPromiseFlatString TPromiseFlatString(
        const typename nsTPromiseFlatString::substring_tuple_type& aString) {
      return nsTPromiseFlatString(aString);
    }

## Minimal test - lines (72, 109)

path: .spaces[0].metrics.mi.mi_original
old: 67.30984619070904
new: 78.42574896648551
path: .spaces[0].metrics.mi.mi_visual_studio
old: 39.36248315246143
new: 45.863011091512
path: .spaces[0].metrics.mi.mi_sei
old: 43.253420065788774
new: 66.92640017916379
path: .spaces[0].metrics.halstead.level
old: 0.04851425106124924
new: 0.06349206349206349
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.2438942383116751
new: 1.0390247573655718
path: .spaces[0].metrics.halstead.volume
old: 1324.0660332153964
new: 495.1575569719331
path: .spaces[0].metrics.halstead.length
old: 227.0
new: 103.0
path: .spaces[0].metrics.halstead.n2
old: 40.0
new: 16.0
path: .spaces[0].metrics.halstead.n1
old: 17.0
new: 12.0
path: .spaces[0].metrics.halstead.vocabulary
old: 57.0
new: 28.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 282.3639920967503
new: 107.01955000865388
path: .spaces[0].metrics.halstead.N1
old: 130.0
new: 61.0
path: .spaces[0].metrics.halstead.time
old: 1516.2395060917977
new: 433.26286235044154
path: .spaces[0].metrics.halstead.effort
old: 27292.311109652357
new: 7798.731522307948
path: .spaces[0].metrics.halstead.bugs
old: 0.30216137917425256
new: 0.1310875334154894
path: .spaces[0].metrics.halstead.difficulty
old: 20.6125
new: 15.75
path: .spaces[0].metrics.halstead.N2
old: 97.0
new: 42.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 5.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 5.0
path: .spaces[0].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 1.0
new: 0.0
path: .spaces[0].metrics.nargs.average
old: 5.0
new: 0.8
path: .spaces[0].metrics.nargs.sum
old: 5.0
new: 4.0
path: .spaces[0].metrics.cyclomatic.sum
old: 10.0
new: 6.0
path: .spaces[0].metrics.cyclomatic.average
old: 10.0
new: 1.0
path: .spaces[0].metrics.cognitive.sum
old: 12.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 12.0
new: 0.0
path: .spaces[0].metrics.loc.cloc
old: 4.0
new: 6.0
path: .spaces[0].metrics.loc.blank
old: 8.0
new: 7.0
path: .spaces[0].metrics.loc.sloc
old: 52.0
new: 38.0
path: .spaces[0].metrics.loc.ploc
old: 40.0
new: 25.0
path: .spaces[0].metrics.loc.lloc
old: 29.0
new: 2.0

### Code

    class nsTPromiseFlatString : public nsTString {
     public:
      typedef nsTPromiseFlatString self_type;
      typedef nsTString base_string_type;
      typedef typename base_string_type::substring_type substring_type;
      typedef typename base_string_type::string_type string_type;
      typedef typename base_string_type::substring_tuple_type substring_tuple_type;
      typedef typename base_string_type::char_type char_type;
      typedef typename base_string_type::size_type size_type;

      // These are only for internal use within the string classes:
      typedef typename base_string_type::DataFlags DataFlags;
      typedef typename base_string_type::ClassFlags ClassFlags;

     private:
      void Init(const substring_type&);

      // NOT TO BE IMPLEMENTED
      void operator=(const self_type&) = delete;

      // NOT TO BE IMPLEMENTED
      nsTPromiseFlatString() = delete;

      // NOT TO BE IMPLEMENTED
      nsTPromiseFlatString(const string_type& aStr) = delete;

     public:
      explicit nsTPromiseFlatString(const substring_type& aStr) : string_type() {
        Init(aStr);
      }

      explicit nsTPromiseFlatString(const substring_tuple_type& aTuple)
          : string_type() {
        // nothing else to do here except assign the value of the tuple
        // into ourselves.
        this->Assign(aTuple);
      }
    };