Global Metrics

path: .metrics.halstead.length
old: 1089.0
new: 3514.0

path: .metrics.halstead.time
old: 17352.91986363497
new: 186761.8421595124

path: .metrics.halstead.effort
old: 312352.55754542944
new: 3361713.158871223

path: .metrics.halstead.purity_ratio
old: 1.1615286581275706
new: 0.7493566625307854

path: .metrics.halstead.bugs
old: 1.5345302574383544
new: 7.4803028526668625

path: .metrics.halstead.volume
old: 8184.597123891323
new: 29505.66920107305

path: .metrics.halstead.vocabulary
old: 183.0
new: 337.0

path: .metrics.halstead.n1
old: 27.0
new: 47.0

path: .metrics.halstead.level
old: 0.02620307382212144
new: 0.008776974062528375

path: .metrics.halstead.n2
old: 156.0
new: 290.0

path: .metrics.halstead.N1
old: 648.0
new: 2108.0

path: .metrics.halstead.N2
old: 441.0
new: 1406.0

path: .metrics.halstead.estimated_program_length
old: 1264.9047087009244
new: 2633.2393121331797

path: .metrics.halstead.difficulty
old: 38.16346153846154
new: 113.93448275862067

path: .metrics.loc.cloc
old: 28.0
new: 88.0

path: .metrics.loc.blank
old: 41.0
new: 92.0

path: .metrics.loc.lloc
old: 90.0
new: 359.0

path: .metrics.loc.ploc
old: 225.0
new: 647.0

path: .metrics.loc.sloc
old: 294.0
new: 827.0

path: .metrics.nexits.average
old: 1.6666666666666667
new: 0.7619047619047619

path: .metrics.nexits.sum
old: 20.0
new: 16.0

path: .metrics.cognitive.average
old: 6.166666666666667
new: 12.285714285714286

path: .metrics.cognitive.sum
old: 74.0
new: 258.0

path: .metrics.nom.functions
old: 12.0
new: 21.0

path: .metrics.nom.total
old: 12.0
new: 21.0

path: .metrics.mi.mi_visual_studio
old: 10.283017297683145
new: 0.0

path: .metrics.mi.mi_original
old: 17.58395957903818
new: -31.36859210027805

path: .metrics.mi.mi_sei
old: -20.913636774857775
new: -79.03372426986995

path: .metrics.nargs.average
old: 1.9166666666666667
new: 1.0952380952380951

path: .metrics.cyclomatic.sum
old: 63.0
new: 174.0

path: .metrics.cyclomatic.average
old: 4.5
new: 7.25

Spaces Data

Minimal test - lines (38, 68)

path: .spaces[0].metrics.nom.functions
old: 12.0
new: 1.0

path: .spaces[0].metrics.nom.total
old: 12.0
new: 1.0

path: .spaces[0].metrics.cyclomatic.sum
old: 62.0
new: 7.0

path: .spaces[0].metrics.cyclomatic.average
old: 4.769230769230769
new: 7.0

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

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

path: .spaces[0].metrics.mi.mi_visual_studio
old: 11.412131031412123
new: 45.677690806997504

path: .spaces[0].metrics.mi.mi_original
old: 19.51474406371473
new: 78.10885127996573

path: .spaces[0].metrics.mi.mi_sei
old: -19.76260090895049
new: 60.87372091727255

path: .spaces[0].metrics.cognitive.average
old: 6.166666666666667
new: 13.0

path: .spaces[0].metrics.cognitive.sum
old: 74.0
new: 13.0

path: .spaces[0].metrics.loc.lloc
old: 89.0
new: 15.0

path: .spaces[0].metrics.loc.cloc
old: 22.0
new: 3.0

path: .spaces[0].metrics.loc.sloc
old: 268.0
new: 31.0

path: .spaces[0].metrics.loc.ploc
old: 208.0
new: 25.0

path: .spaces[0].metrics.loc.blank
old: 38.0
new: 3.0

path: .spaces[0].metrics.halstead.level
old: 0.024166009981612818
new: 0.03522504892367906

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.0377533560278775
new: 1.297768402569221

path: .spaces[0].metrics.halstead.N2
old: 423.0
new: 73.0

path: .spaces[0].metrics.halstead.vocabulary
old: 165.0
new: 48.0

path: .spaces[0].metrics.halstead.N1
old: 646.0
new: 97.0

path: .spaces[0].metrics.halstead.estimated_program_length
old: 1109.358337593801
new: 220.6206284367676

path: .spaces[0].metrics.halstead.difficulty
old: 41.380434782608695
new: 28.38888888888889

path: .spaces[0].metrics.halstead.n1
old: 27.0
new: 21.0

path: .spaces[0].metrics.halstead.length
old: 1069.0
new: 170.0

path: .spaces[0].metrics.halstead.n2
old: 138.0
new: 27.0

path: .spaces[0].metrics.halstead.volume
old: 7874.598447028778
new: 949.4436251225966

path: .spaces[0].metrics.halstead.time
old: 18103.017082028113
new: 1497.424976659404

path: .spaces[0].metrics.halstead.bugs
old: 1.57843870895521
new: 0.29965656524630063

path: .spaces[0].metrics.halstead.effort
old: 325854.30747650604
new: 26953.64957986927

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

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

Code

int main(int argc, char** argv) {
  leaky* l = new leaky;

  l->initialize(argc, argv);
  l->outputfd = stdout;

  for (int i = 0; i < l->numLogFiles; i++) {
    if (l->output_dir || l->numLogFiles > 1) {
      char name[2048];  // XXX fix
      if (l->output_dir)
        snprintf(name, sizeof(name), "%s/%s.html", l->output_dir,
                 argv[l->logFileIndex + i]);
      else
        snprintf(name, sizeof(name), "%s.html", argv[l->logFileIndex + i]);

      fprintf(stderr, "opening %s\n", name);
      l->outputfd = fopen(name, "w");
      // if an error we won't process the file
    }
    if (l->outputfd) {  // paranoia
      l->open(argv[l->logFileIndex + i]);

      if (l->outputfd != stderr) {
        fclose(l->outputfd);
        l->outputfd = nullptr;
      }
    }
  }

  return 0;
}