Global Metrics

path: .metrics.cyclomatic.sum
old: 195.0
new: 24.0

path: .metrics.cyclomatic.average
old: 1.3928571428571428
new: 6.0

path: .metrics.nexits.average
old: 0.6031746031746031
new: 2.6666666666666665

path: .metrics.nexits.sum
old: 76.0
new: 8.0

path: .metrics.loc.lloc
old: 144.0
new: 36.0

path: .metrics.loc.sloc
old: 1072.0
new: 123.0

path: .metrics.loc.cloc
old: 349.0
new: 37.0

path: .metrics.loc.ploc
old: 577.0
new: 70.0

path: .metrics.loc.blank
old: 146.0
new: 16.0

path: .metrics.cognitive.average
old: 0.0873015873015873
new: 10.0

path: .metrics.cognitive.sum
old: 11.0
new: 30.0

path: .metrics.halstead.bugs
old: 3.14906545345936
new: 0.6664794674542962

path: .metrics.halstead.length
old: 2563.0
new: 311.0

path: .metrics.halstead.effort
old: 918236.2069414144
new: 89405.04862997943

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

path: .metrics.halstead.time
old: 51013.12260785635
new: 4966.947146109968

path: .metrics.halstead.vocabulary
old: 388.0
new: 62.0

path: .metrics.halstead.n2
old: 361.0
new: 32.0

path: .metrics.halstead.level
old: 0.0240042556021012
new: 0.020711974110032363

path: .metrics.halstead.purity_ratio
old: 1.2467364913244956
new: 0.9878029513448732

path: .metrics.halstead.volume
old: 22041.57661452561
new: 1851.7550525303184

path: .metrics.halstead.estimated_program_length
old: 3195.385627264682
new: 307.20671786825557

path: .metrics.halstead.N2
old: 1114.0
new: 103.0

path: .metrics.halstead.N1
old: 1449.0
new: 208.0

path: .metrics.halstead.difficulty
old: 41.659279778393355
new: 48.28125

path: .metrics.mi.mi_original
old: -38.88552386812053
new: 48.39838988685504

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

path: .metrics.mi.mi_sei
old: -73.28388765889835
new: 34.12030546045857

path: .metrics.nargs.sum
old: 61.0
new: 3.0

path: .metrics.nargs.average
old: 0.4841269841269842
new: 1.0

path: .metrics.nom.functions
old: 126.0
new: 3.0

path: .metrics.nom.total
old: 126.0
new: 3.0

Spaces Data

Minimal test - lines (109, 123)

path: .spaces[2].metrics.cyclomatic.average
old: 1.0
new: 5.0

path: .spaces[2].metrics.cyclomatic.sum
old: 2.0
new: 5.0

path: .spaces[2].metrics.halstead.length
old: 7.0
new: 50.0

path: .spaces[2].metrics.halstead.level
old: 0.5
new: 0.037037037037037035

path: .spaces[2].metrics.halstead.n2
old: 3.0
new: 5.0

path: .spaces[2].metrics.halstead.volume
old: 19.651484454403228
new: 226.17809780285063

path: .spaces[2].metrics.halstead.bugs
old: 0.0038532659414573967
new: 0.11136659793599556

path: .spaces[2].metrics.halstead.difficulty
old: 2.0
new: 27.0

path: .spaces[2].metrics.halstead.N2
old: 3.0
new: 15.0

path: .spaces[2].metrics.halstead.vocabulary
old: 7.0
new: 23.0

path: .spaces[2].metrics.halstead.purity_ratio
old: 1.8221267860233523
new: 1.7333658100079683

path: .spaces[2].metrics.halstead.time
old: 2.1834982727114696
new: 339.267146704276

path: .spaces[2].metrics.halstead.N1
old: 4.0
new: 35.0

path: .spaces[2].metrics.halstead.estimated_program_length
old: 12.754887502163468
new: 86.66829050039843

path: .spaces[2].metrics.halstead.n1
old: 4.0
new: 18.0

path: .spaces[2].metrics.halstead.effort
old: 39.302968908806456
new: 6106.808640676968

path: .spaces[2].metrics.mi.mi_sei
old: 115.79785476526216
new: 65.88753216217899

path: .spaces[2].metrics.mi.mi_visual_studio
old: 77.54130782031488
new: 57.186379259742914

path: .spaces[2].metrics.mi.mi_original
old: 132.59563637273845
new: 97.78870853416038

path: .spaces[2].metrics.nargs.average
old: null
new: 1.0

path: .spaces[2].metrics.nargs.sum
old: 0.0
new: 1.0

path: .spaces[2].metrics.nexits.average
old: null
new: 2.0

path: .spaces[2].metrics.nexits.sum
old: 0.0
new: 2.0

path: .spaces[2].metrics.cognitive.sum
old: 0.0
new: 3.0

path: .spaces[2].metrics.cognitive.average
old: null
new: 3.0

path: .spaces[2].metrics.nom.total
old: 0.0
new: 1.0

path: .spaces[2].metrics.nom.functions
old: 0.0
new: 1.0

path: .spaces[2].metrics.loc.blank
old: 0.0
new: 3.0

path: .spaces[2].metrics.loc.ploc
old: 4.0
new: 12.0

path: .spaces[2].metrics.loc.sloc
old: 4.0
new: 15.0

path: .spaces[2].metrics.loc.lloc
old: 0.0
new: 7.0

Code

int64_t nsCRT::atoll(const char* aStr) {
  if (!aStr) {
    return 0;
  }

  int64_t ll = 0;

  while (*aStr && *aStr >= '0' && *aStr <= '9') {
    ll *= 10;
    ll += *aStr - '0';
    aStr++;
  }

  return ll;
}

Minimal test - lines (81, 105)

path: .spaces[1].metrics.nexits.average
old: null
new: 5.0

path: .spaces[1].metrics.nexits.sum
old: 0.0
new: 5.0

path: .spaces[1].metrics.cyclomatic.sum
old: 2.0
new: 10.0

path: .spaces[1].metrics.cyclomatic.average
old: 1.0
new: 10.0

path: .spaces[1].metrics.halstead.N2
old: 6.0
new: 24.0

path: .spaces[1].metrics.halstead.N1
old: 6.0
new: 62.0

path: .spaces[1].metrics.halstead.effort
old: 64.8
new: 11654.22926780266

path: .spaces[1].metrics.halstead.difficulty
old: 1.8
new: 28.5

path: .spaces[1].metrics.halstead.purity_ratio
old: 1.36371066471669
new: 1.2175653808770712

path: .spaces[1].metrics.halstead.bugs
old: 0.005377685695868596
new: 0.17134355906444795

path: .spaces[1].metrics.halstead.estimated_program_length
old: 16.36452797660028
new: 104.71062275542812

path: .spaces[1].metrics.halstead.n2
old: 5.0
new: 8.0

path: .spaces[1].metrics.halstead.volume
old: 36.0
new: 408.9203251860583

path: .spaces[1].metrics.halstead.level
old: 0.5555555555555556
new: 0.03508771929824561

path: .spaces[1].metrics.halstead.length
old: 12.0
new: 86.0

path: .spaces[1].metrics.halstead.n1
old: 3.0
new: 19.0

path: .spaces[1].metrics.halstead.time
old: 3.5999999999999996
new: 647.4571815445922

path: .spaces[1].metrics.halstead.vocabulary
old: 8.0
new: 27.0

path: .spaces[1].metrics.cognitive.average
old: null
new: 20.0

path: .spaces[1].metrics.cognitive.sum
old: 0.0
new: 20.0

path: .spaces[1].metrics.loc.lloc
old: 0.0
new: 13.0

path: .spaces[1].metrics.loc.sloc
old: 5.0
new: 25.0

path: .spaces[1].metrics.loc.ploc
old: 5.0
new: 25.0

path: .spaces[1].metrics.loc.cloc
old: 0.0
new: 2.0

path: .spaces[1].metrics.mi.mi_original
old: 125.8328073385958
new: 85.28390590491124

path: .spaces[1].metrics.mi.mi_visual_studio
old: 73.5864370401145
new: 49.873629184158624

path: .spaces[1].metrics.mi.mi_sei
old: 106.04115485532472
new: 69.57053187436846

path: .spaces[1].metrics.nargs.average
old: null
new: 2.0

path: .spaces[1].metrics.nargs.sum
old: 0.0
new: 2.0

path: .spaces[1].metrics.nom.functions
old: 0.0
new: 1.0

path: .spaces[1].metrics.nom.total
old: 0.0
new: 1.0

Code

int32_t nsCRT::strcmp(const char16_t* aStr1, const char16_t* aStr2) {
  if (aStr1 && aStr2) {
    for (;;) {
      char16_t c1 = *aStr1++;
      char16_t c2 = *aStr2++;
      if (c1 != c2) {
        if (c1 < c2) {
          return -1;
        }
        return 1;
      }
      if (c1 == 0 || c2 == 0) {
        break;
      }
    }
  } else {
    if (aStr1) {  // aStr2 must have been null
      return -1;
    }
    if (aStr2) {  // aStr1 must have been null
      return 1;
    }
  }
  return 0;
}

Minimal test - lines (33, 68)

path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 8.0

path: .spaces[0].metrics.cyclomatic.average
old: 1.0
new: 8.0

path: .spaces[0].metrics.loc.ploc
old: 1.0
new: 28.0

path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 2.0

path: .spaces[0].metrics.loc.sloc
old: 1.0
new: 36.0

path: .spaces[0].metrics.loc.blank
old: 0.0
new: 6.0

path: .spaces[0].metrics.loc.lloc
old: 0.0
new: 16.0

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

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

path: .spaces[0].metrics.halstead.n2
old: 1.0
new: 17.0

path: .spaces[0].metrics.halstead.effort
old: 0.0
new: 28880.5799129538

path: .spaces[0].metrics.halstead.N2
old: 1.0
new: 55.0

path: .spaces[0].metrics.halstead.difficulty
old: 0.0
new: 33.970588235294116

path: .spaces[0].metrics.halstead.estimated_program_length
old: null
new: 161.72553417960972

path: .spaces[0].metrics.halstead.level
old: null
new: 0.02943722943722944

path: .spaces[0].metrics.halstead.vocabulary
old: 1.0
new: 38.0

path: .spaces[0].metrics.halstead.purity_ratio
old: null
new: 0.9983057665408008

path: .spaces[0].metrics.halstead.N1
old: 0.0
new: 107.0

path: .spaces[0].metrics.halstead.time
old: 0.0
new: 1604.4766618307667

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

path: .spaces[0].metrics.halstead.bugs
old: 0.0
new: 0.3137733238334167

path: .spaces[0].metrics.halstead.volume
old: 0.0
new: 850.1642571778608

path: .spaces[0].metrics.halstead.length
old: 1.0
new: 162.0

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

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

path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 7.0

path: .spaces[0].metrics.cognitive.average
old: null
new: 7.0

path: .spaces[0].metrics.mi.mi_original
old: null
new: 76.03075940933097

path: .spaces[0].metrics.mi.mi_sei
old: null
new: 52.65730084058508

path: .spaces[0].metrics.mi.mi_visual_studio
old: null
new: 44.462432403117525

path: .spaces[0].metrics.nargs.average
old: null
new: 0.0

Code

char* nsCRT::strtok(char* aString, const char* aDelims, char** aNewStr) {
  NS_ASSERTION(aString,
               "Unlike regular strtok, the first argument cannot be null.");

  char delimTable[DELIM_TABLE_SIZE];
  uint32_t i;
  char* result;
  char* str = aString;

  for (i = 0; i < DELIM_TABLE_SIZE; ++i) {
    delimTable[i] = '\0';
  }

  for (i = 0; aDelims[i]; i++) {
    SET_DELIM(delimTable, static_cast(aDelims[i]));
  }
  NS_ASSERTION(aDelims[i] == '\0', "too many delimiters");

  // skip to beginning
  while (*str && IS_DELIM(delimTable, static_cast(*str))) {
    str++;
  }
  result = str;

  // fix up the end of the token
  while (*str) {
    if (IS_DELIM(delimTable, static_cast(*str))) {
      *str++ = '\0';
      break;
    }
    str++;
  }
  *aNewStr = str;

  return str == result ? nullptr : result;
}