# Global Metrics

path: .metrics.cyclomatic.average
old: 4.025
new: 1.181818181818182
path: .metrics.cyclomatic.sum
old: 322.0
new: 13.0
path: .metrics.loc.sloc
old: 1750.0
new: 100.0
path: .metrics.loc.lloc
old: 625.0
new: 10.0
path: .metrics.loc.ploc
old: 1346.0
new: 38.0
path: .metrics.loc.cloc
old: 180.0
new: 47.0
path: .metrics.loc.blank
old: 224.0
new: 15.0
path: .metrics.halstead.effort
old: 4074730.865937559
new: 39707.84058319243
path: .metrics.halstead.estimated_program_length
old: 7215.472286193588
new: 289.07014134687967
path: .metrics.halstead.purity_ratio
old: 1.12215743175639
new: 1.3382876914207391
path: .metrics.halstead.level
old: 0.015145902786352226
new: 0.032
path: .metrics.halstead.time
old: 226373.93699653103
new: 2205.9911435106906
path: .metrics.halstead.N2
old: 2492.0
new: 85.0
path: .metrics.halstead.difficulty
old: 66.02445652173913
new: 31.25
path: .metrics.halstead.vocabulary
old: 775.0
new: 59.0
path: .metrics.halstead.length
old: 6430.0
new: 216.0
path: .metrics.halstead.N1
old: 3938.0
new: 131.0
path: .metrics.halstead.n1
old: 39.0
new: 25.0
path: .metrics.halstead.bugs
old: 8.503767244580796
new: 0.3879683147660053
path: .metrics.halstead.volume
old: 61715.47757603909
new: 1270.6508986621575
path: .metrics.halstead.n2
old: 736.0
new: 34.0
path: .metrics.nom.total
old: 90.0
new: 8.0
path: .metrics.nom.functions
old: 77.0
new: 8.0
path: .metrics.nom.closures
old: 13.0
new: 0.0
path: .metrics.cognitive.average
old: 3.5555555555555554
new: 0.375
path: .metrics.cognitive.sum
old: 320.0
new: 3.0
path: .metrics.mi.mi_sei
old: -136.50143170219738
new: 50.42886208386153
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 32.88910130975287
path: .metrics.mi.mi_original
old: -81.38891944297208
new: 56.24036323967741
path: .metrics.nargs.average
old: 1.0
new: 0.75
path: .metrics.nargs.sum
old: 90.0
new: 6.0
path: .metrics.nexits.sum
old: 104.0
new: 4.0
path: .metrics.nexits.average
old: 1.1555555555555554
new: 0.5

# Spaces Data

## Minimal test - lines (50, 100)

path: .spaces[0].metrics.cognitive.average
old: 3.5555555555555554
new: 0.375
path: .spaces[0].metrics.cognitive.sum
old: 320.0
new: 3.0
path: .spaces[0].metrics.nargs.sum
old: 90.0
new: 6.0
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 0.75
path: .spaces[0].metrics.cyclomatic.average
old: 4.063291139240507
new: 1.2
path: .spaces[0].metrics.cyclomatic.sum
old: 321.0
new: 12.0
path: .spaces[0].metrics.nexits.average
old: 1.1555555555555554
new: 0.5
path: .spaces[0].metrics.nexits.sum
old: 104.0
new: 4.0
path: .spaces[0].metrics.mi.mi_sei
old: -135.53516158974128
new: 53.08481916356519
path: .spaces[0].metrics.mi.mi_original
old: -80.61141655078887
new: 67.42452098207028
path: .spaces[0].metrics.mi.mi_visual_studio
old: 0.0
new: 39.42954443395923
path: .spaces[0].metrics.halstead.difficulty
old: 68.25
new: 31.818181818181817
path: .spaces[0].metrics.halstead.N2
old: 2450.0
new: 84.0
path: .spaces[0].metrics.halstead.level
old: 0.014652014652014652
new: 0.03142857142857143
path: .spaces[0].metrics.halstead.n2
old: 700.0
new: 33.0
path: .spaces[0].metrics.halstead.N1
old: 3930.0
new: 131.0
path: .spaces[0].metrics.halstead.n1
old: 39.0
new: 25.0
path: .spaces[0].metrics.halstead.length
old: 6380.0
new: 215.0
path: .spaces[0].metrics.halstead.effort
old: 4149447.5933446297
new: 40073.91544394088
path: .spaces[0].metrics.halstead.time
old: 230524.86629692384
new: 2226.3286357744933
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.069275621444868
new: 1.3142391194567309
path: .spaces[0].metrics.halstead.vocabulary
old: 739.0
new: 58.0
path: .spaces[0].metrics.halstead.volume
old: 60797.76693545244
new: 1259.465913952428
path: .spaces[0].metrics.halstead.bugs
old: 8.607405590521633
new: 0.3903491730058522
path: .spaces[0].metrics.halstead.estimated_program_length
old: 6821.978464818258
new: 282.5614106831971
path: .spaces[0].metrics.loc.cloc
old: 174.0
new: 9.0
path: .spaces[0].metrics.loc.ploc
old: 1307.0
new: 33.0
path: .spaces[0].metrics.loc.sloc
old: 1700.0
new: 51.0
path: .spaces[0].metrics.loc.blank
old: 219.0
new: 9.0
path: .spaces[0].metrics.loc.lloc
old: 625.0
new: 10.0
path: .spaces[0].metrics.nom.closures
old: 13.0
new: 0.0
path: .spaces[0].metrics.nom.total
old: 90.0
new: 8.0
path: .spaces[0].metrics.nom.functions
old: 77.0
new: 8.0

### Code

    namespace lul {

    using std::string;

    ////////////////////////////////////////////////////////////////
    // Module
    //
    Module::Module(const string& name, const string& os, const string& architecture,
                   const string& id)
        : name_(name), os_(os), architecture_(architecture), id_(id) {}

    Module::~Module() {}

    ////////////////////////////////////////////////////////////////
    // UniqueString
    //
    class UniqueString {
     public:
      explicit UniqueString(string str) { str_ = strdup(str.c_str()); }
      ~UniqueString() { free(reinterpret_cast(const_cast(str_))); }
      const char* str_;
    };

    const char* FromUniqueString(const UniqueString* ustr) { return ustr->str_; }

    bool IsEmptyUniqueString(const UniqueString* ustr) {
      return (ustr->str_)[0] == '\0';
    }

    ////////////////////////////////////////////////////////////////
    // UniqueStringUniverse
    //
    UniqueStringUniverse::~UniqueStringUniverse() {
      for (std::map::iterator it = map_.begin();
           it != map_.end(); it++) {
        delete it->second;
      }
    }

    const UniqueString* UniqueStringUniverse::ToUniqueString(string str) {
      std::map::iterator it = map_.find(str);
      if (it == map_.end()) {
        UniqueString* ustr = new UniqueString(str);
        map_[str] = ustr;
        return ustr;
      } else {
        return it->second;
      }
    }

    }  // namespace lul

## Minimal test - lines (57, 59)

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 8.610291247117281
new: 0.02662834774140083
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 738.0
new: 16.0
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 699.0
new: 10.0
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 60766.248344653206
new: 140.0
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.014637057511700224
new: 0.19607843137254904
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 68.31974248927038
new: 5.1
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 3929.0
new: 18.0
path: .spaces[0].spaces[0].metrics.halstead.time
old: 230640.8021636533
new: 39.666666666666664
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.0679030400835774
new: 1.3922587415200158
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 4151534.43894576
new: 714.0
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 39.0
new: 6.0
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 6811.085589653057
new: 48.72905595320056
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 2449.0
new: 17.0
path: .spaces[0].spaces[0].metrics.halstead.length
old: 6378.0
new: 35.0
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 0.0
new: 74.43037445965395
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: -80.35965004041842
new: 127.27594032600824
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: -135.32370924751874
new: 108.02133580020345
path: .spaces[0].spaces[0].metrics.nargs.average
old: 1.0
new: 4.0
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 90.0
new: 4.0
path: .spaces[0].spaces[0].metrics.nom.closures
old: 13.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nom.functions
old: 77.0
new: 1.0
path: .spaces[0].spaces[0].metrics.nom.total
old: 90.0
new: 1.0
path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 320.0
new: 0.0
path: .spaces[0].spaces[0].metrics.cognitive.average
old: 3.5555555555555554
new: 0.0
path: .spaces[0].spaces[0].metrics.nexits.sum
old: 104.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nexits.average
old: 1.1555555555555554
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.blank
old: 220.0
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 1305.0
new: 3.0
path: .spaces[0].spaces[0].metrics.loc.lloc
old: 625.0
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 1698.0
new: 3.0
path: .spaces[0].spaces[0].metrics.loc.cloc
old: 173.0
new: 0.0
path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 4.102564102564102
new: 1.0
path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 320.0
new: 1.0

### Code

    Module::Module(const string& name, const string& os, const string& architecture,
                   const string& id)
        : name_(name), os_(os), architecture_(architecture), id_(id) {}