Global Metrics

path: .metrics.cyclomatic.average
old: 2.0
new: 1.8571428571428572

path: .metrics.cyclomatic.sum
old: 22.0
new: 13.0

path: .metrics.cognitive.sum
old: 8.0
new: 7.0

path: .metrics.cognitive.average
old: 0.8
new: 1.75

path: .metrics.halstead.difficulty
old: 23.567901234567906
new: 45.34285714285714

path: .metrics.halstead.effort
old: 64745.273617183346
new: 90841.21762941344

path: .metrics.halstead.n2
old: 81.0
new: 35.0

path: .metrics.halstead.N2
old: 166.0
new: 138.0

path: .metrics.halstead.bugs
old: 0.5374657478516447
new: 0.6735978771960517

path: .metrics.halstead.estimated_program_length
old: 617.5697752229659
new: 283.56683058238514

path: .metrics.halstead.length
old: 410.0
new: 342.0

path: .metrics.halstead.purity_ratio
old: 1.5062677444462582
new: 0.8291427794806583

path: .metrics.halstead.N1
old: 244.0
new: 204.0

path: .metrics.halstead.time
old: 3596.959645399075
new: 5046.734312745191

path: .metrics.halstead.level
old: 0.04243059193294919
new: 0.02205419029615627

path: .metrics.halstead.vocabulary
old: 104.0
new: 58.0

path: .metrics.halstead.volume
old: 2747.1802844378476
new: 2003.4295003336297

path: .metrics.nom.functions
old: 10.0
new: 4.0

path: .metrics.nom.total
old: 10.0
new: 4.0

path: .metrics.loc.lloc
old: 41.0
new: 21.0

path: .metrics.loc.blank
old: 22.0
new: 17.0

path: .metrics.loc.cloc
old: 10.0
new: 20.0

path: .metrics.loc.ploc
old: 92.0
new: 55.0

path: .metrics.loc.sloc
old: 124.0
new: 92.0

path: .metrics.mi.mi_sei
old: 15.172913028626358
new: 38.349536103464025

path: .metrics.mi.mi_visual_studio
old: 27.29597719702933
new: 32.294399530729926

path: .metrics.mi.mi_original
old: 46.676121006920155
new: 55.22342319754817

path: .metrics.nexits.average
old: 0.8
new: 1.5

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

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

path: .metrics.nargs.sum
old: 10.0
new: 6.0

Spaces Data

Minimal test - lines (91, 91)

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

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

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

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

path: .spaces[4].metrics.mi.mi_original
old: 118.5957224919718
new: 159.95690398326485

path: .spaces[4].metrics.mi.mi_sei
old: 95.6002484366076
new: 155.17000000000002

path: .spaces[4].metrics.mi.mi_visual_studio
old: 69.35422367951567
new: 93.54204911302038

path: .spaces[4].metrics.loc.lloc
old: 3.0
new: 0.0

path: .spaces[4].metrics.loc.sloc
old: 6.0
new: 1.0

path: .spaces[4].metrics.loc.ploc
old: 6.0
new: 1.0

path: .spaces[4].metrics.cognitive.sum
old: 1.0
new: 0.0

path: .spaces[4].metrics.cognitive.average
old: 1.0
new: null

path: .spaces[4].metrics.halstead.n1
old: 9.0
new: 3.0

path: .spaces[4].metrics.halstead.time
old: 27.348234169259634
new: 0.6666666666666666

path: .spaces[4].metrics.halstead.N1
old: 13.0
new: 3.0

path: .spaces[4].metrics.halstead.N2
old: 8.0
new: 1.0

path: .spaces[4].metrics.halstead.difficulty
old: 6.0
new: 1.5

path: .spaces[4].metrics.halstead.purity_ratio
old: 2.0971000008241782
new: 1.188721875540867

path: .spaces[4].metrics.halstead.vocabulary
old: 15.0
new: 4.0

path: .spaces[4].metrics.halstead.effort
old: 492.2682150466734
new: 12.0

path: .spaces[4].metrics.halstead.volume
old: 82.0447025077789
new: 8.0

path: .spaces[4].metrics.halstead.bugs
old: 0.020781645965528363
new: 0.0017471609294725976

path: .spaces[4].metrics.halstead.level
old: 0.16666666666666666
new: 0.6666666666666666

path: .spaces[4].metrics.halstead.n2
old: 6.0
new: 1.0

path: .spaces[4].metrics.halstead.length
old: 21.0
new: 4.0

path: .spaces[4].metrics.halstead.estimated_program_length
old: 44.039100017307746
new: 4.754887502163468

path: .spaces[4].metrics.nexits.average
old: 0.0
new: null

path: .spaces[4].metrics.cyclomatic.sum
old: 2.0
new: 1.0

path: .spaces[4].metrics.cyclomatic.average
old: 2.0
new: 1.0

Code

template class nsTSubstringTuple;

Minimal test - lines (54, 67)

path: .spaces[2].metrics.cognitive.average
old: 0.0
new: 2.0

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

path: .spaces[2].metrics.nargs.average
old: 3.0
new: 2.0

path: .spaces[2].metrics.nargs.sum
old: 3.0
new: 2.0

path: .spaces[2].metrics.halstead.estimated_program_length
old: 81.83229392178727
new: 76.2388309575275

path: .spaces[2].metrics.halstead.n2
old: 14.0
new: 10.0

path: .spaces[2].metrics.halstead.volume
old: 208.0838499786226
new: 227.43101255050215

path: .spaces[2].metrics.halstead.level
old: 0.14814814814814814
new: 0.07936507936507936

path: .spaces[2].metrics.halstead.length
old: 46.0
new: 51.0

path: .spaces[2].metrics.halstead.purity_ratio
old: 1.7789629113432015
new: 1.494879038382892

path: .spaces[2].metrics.halstead.N1
old: 25.0
new: 30.0

path: .spaces[2].metrics.halstead.effort
old: 1404.5659873557024
new: 2865.630758136327

path: .spaces[2].metrics.halstead.time
old: 78.03144374198347
new: 159.2017087853515

path: .spaces[2].metrics.halstead.difficulty
old: 6.75
new: 12.6

path: .spaces[2].metrics.halstead.n1
old: 9.0
new: 12.0

path: .spaces[2].metrics.halstead.bugs
old: 0.04180615023426746
new: 0.06724999121715433

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

path: .spaces[2].metrics.cyclomatic.sum
old: 1.0
new: 3.0

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

path: .spaces[2].metrics.mi.mi_visual_studio
old: 60.091940603469965
new: 58.09220299164947

path: .spaces[2].metrics.mi.mi_original
old: 102.75721843193364
new: 99.3376671157206

path: .spaces[2].metrics.mi.mi_sei
old: 94.27103926237986
new: 88.0340985479136

path: .spaces[2].metrics.loc.lloc
old: 4.0
new: 5.0

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

path: .spaces[2].metrics.loc.sloc
old: 12.0
new: 14.0

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

path: .spaces[2].metrics.nexits.average
old: 0.0
new: 3.0

Code

bool nsTSubstringTuple::IsDependentOn(const char_type* aStart,
                                         const char_type* aEnd) const {
  // we start with the right-most fragment since it is faster to check.

  if (mFragB->IsDependentOn(aStart, aEnd)) {
    return true;
  }

  if (mHead) {
    return mHead->IsDependentOn(aStart, aEnd);
  }

  return mFragA->IsDependentOn(aStart, aEnd);
}

Minimal test - lines (92, 92)

path: .spaces[5].metrics.cognitive.average
old: 2.0
new: null

path: .spaces[5].metrics.cognitive.sum
old: 2.0
new: 0.0

path: .spaces[5].metrics.loc.sloc
old: 12.0
new: 1.0

path: .spaces[5].metrics.loc.blank
old: 1.0
new: 0.0

path: .spaces[5].metrics.loc.lloc
old: 3.0
new: 0.0

path: .spaces[5].metrics.loc.ploc
old: 11.0
new: 1.0

path: .spaces[5].metrics.mi.mi_visual_studio
old: 58.13657491680937
new: 93.54204911302038

path: .spaces[5].metrics.mi.mi_sei
old: 68.33349280315754
new: 155.17000000000002

path: .spaces[5].metrics.mi.mi_original
old: 99.41354310774403
new: 159.95690398326485

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

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

path: .spaces[5].metrics.halstead.n1
old: 13.0
new: 3.0

path: .spaces[5].metrics.halstead.effort
old: 3437.2587692711872
new: 12.0

path: .spaces[5].metrics.halstead.bugs
old: 0.07591953936163959
new: 0.0017471609294725976

path: .spaces[5].metrics.halstead.N1
old: 41.0
new: 3.0

path: .spaces[5].metrics.halstead.level
old: 0.0923076923076923
new: 0.6666666666666666

path: .spaces[5].metrics.halstead.volume
old: 317.28542485580186
new: 8.0

path: .spaces[5].metrics.halstead.N2
old: 25.0
new: 1.0

path: .spaces[5].metrics.halstead.difficulty
old: 10.833333333333334
new: 1.5

path: .spaces[5].metrics.halstead.n2
old: 15.0
new: 1.0

path: .spaces[5].metrics.halstead.length
old: 66.0
new: 4.0

path: .spaces[5].metrics.halstead.time
old: 190.95882051506595
new: 0.6666666666666666

path: .spaces[5].metrics.halstead.vocabulary
old: 28.0
new: 4.0

path: .spaces[5].metrics.halstead.estimated_program_length
old: 106.70907526996196
new: 4.754887502163468

path: .spaces[5].metrics.halstead.purity_ratio
old: 1.6168041707569996
new: 1.188721875540867

path: .spaces[5].metrics.cyclomatic.sum
old: 6.0
new: 1.0

path: .spaces[5].metrics.cyclomatic.average
old: 6.0
new: 1.0

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

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

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

Code

template class nsTSubstringTuple;

Minimal test - lines (70, 89)

path: .spaces[3].metrics.nargs.average
old: 0.0
new: 2.0

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

path: .spaces[3].metrics.halstead.time
old: 10.381025296523006
new: 558.5830307423549

path: .spaces[3].metrics.halstead.n2
old: 4.0
new: 23.0

path: .spaces[3].metrics.halstead.volume
old: 49.82892142331043
new: 583.9731685033711

path: .spaces[3].metrics.halstead.length
old: 15.0
new: 109.0

path: .spaces[3].metrics.halstead.bugs
old: 0.010894833099444995
new: 0.15528121030478473

path: .spaces[3].metrics.halstead.vocabulary
old: 10.0
new: 41.0

path: .spaces[3].metrics.halstead.N1
old: 10.0
new: 65.0

path: .spaces[3].metrics.halstead.n1
old: 6.0
new: 18.0

path: .spaces[3].metrics.halstead.N2
old: 5.0
new: 44.0

path: .spaces[3].metrics.halstead.difficulty
old: 3.75
new: 17.217391304347824

path: .spaces[3].metrics.halstead.effort
old: 186.8584553374141
new: 10054.494553362389

path: .spaces[3].metrics.halstead.purity_ratio
old: 1.5673183336217955
new: 1.643124541424522

path: .spaces[3].metrics.halstead.level
old: 0.26666666666666666
new: 0.05808080808080809

path: .spaces[3].metrics.halstead.estimated_program_length
old: 23.509775004326936
new: 179.1005750152729

path: .spaces[3].metrics.cyclomatic.average
old: 1.0
new: 3.0

path: .spaces[3].metrics.cyclomatic.sum
old: 1.0
new: 3.0

path: .spaces[3].metrics.nexits.average
old: 0.0
new: 2.0

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

path: .spaces[3].metrics.cognitive.sum
old: 0.0
new: 1.0

path: .spaces[3].metrics.cognitive.average
old: 0.0
new: 1.0

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

path: .spaces[3].metrics.loc.ploc
old: 4.0
new: 15.0

path: .spaces[3].metrics.loc.sloc
old: 4.0
new: 20.0

path: .spaces[3].metrics.loc.lloc
old: 2.0
new: 4.0

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

path: .spaces[3].metrics.mi.mi_original
old: 127.98733440181226
new: 88.65589097379346

path: .spaces[3].metrics.mi.mi_visual_studio
old: 74.84639438702472
new: 51.8455502770722

path: .spaces[3].metrics.mi.mi_sei
old: 109.04766050548368
new: 76.03481395863004

Code

auto nsTSubstringTuple::IsDependentOnWithLength(const char_type* aStart,
                                                   const char_type* aEnd) const
    -> std::pair {
  // we start with the right-most fragment since it is faster to check for
  // dependency.
  const bool rightDependentOn = mFragB->IsDependentOn(aStart, aEnd);

  if (rightDependentOn) {
    return {true, Length()};
  }

  const auto [leftDependentOn, leftLen] =
      mHead ? mHead->IsDependentOnWithLength(aStart, aEnd)
            : std::pair{mFragA->IsDependentOn(aStart, aEnd), mFragA->Length()};

  const auto checkedLen =
      mozilla::CheckedInt{leftLen} + mFragB->Length();
  MOZ_RELEASE_ASSERT(checkedLen.isValid(), "Substring tuple length is invalid");
  return {leftDependentOn, checkedLen.value()};
}

Minimal test - lines (35, 46)

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

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

path: .spaces[1].metrics.halstead.difficulty
old: 4.0
new: 20.1875

path: .spaces[1].metrics.halstead.estimated_program_length
old: 20.264662506490403
new: 133.48686830125575

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

path: .spaces[1].metrics.halstead.level
old: 0.25
new: 0.04953560371517028

path: .spaces[1].metrics.halstead.volume
old: 31.69925001442312
new: 469.1286531003362

path: .spaces[1].metrics.halstead.time
old: 7.044277780982916
new: 526.140815803502

path: .spaces[1].metrics.halstead.effort
old: 126.79700005769249
new: 9470.534684463037

path: .spaces[1].metrics.halstead.N2
old: 4.0
new: 38.0

path: .spaces[1].metrics.halstead.n1
old: 6.0
new: 17.0

path: .spaces[1].metrics.halstead.vocabulary
old: 9.0
new: 33.0

path: .spaces[1].metrics.halstead.length
old: 10.0
new: 93.0

path: .spaces[1].metrics.halstead.n2
old: 3.0
new: 16.0

path: .spaces[1].metrics.halstead.purity_ratio
old: 2.0264662506490403
new: 1.435342669905976

path: .spaces[1].metrics.halstead.bugs
old: 0.008413009854528818
new: 0.14920901998976557

path: .spaces[1].metrics.loc.lloc
old: 1.0
new: 6.0

path: .spaces[1].metrics.loc.blank
old: 0.0
new: 1.0

path: .spaces[1].metrics.loc.ploc
old: 1.0
new: 11.0

path: .spaces[1].metrics.loc.sloc
old: 1.0
new: 12.0

path: .spaces[1].metrics.cognitive.average
old: 0.0
new: 2.0

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

path: .spaces[1].metrics.mi.mi_sei
old: 144.8408406278255
new: 66.3196404805646

path: .spaces[1].metrics.mi.mi_original
old: 152.79727628688778
new: 98.29995164215948

path: .spaces[1].metrics.mi.mi_visual_studio
old: 89.35513233151332
new: 57.48535183752016

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

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

Code

void nsTSubstringTuple::WriteTo(char_type* aBuf, uint32_t aBufLen) const {
  MOZ_RELEASE_ASSERT(aBufLen >= mFragB->Length(), "buffer too small");
  uint32_t headLen = aBufLen - mFragB->Length();
  if (mHead) {
    mHead->WriteTo(aBuf, headLen);
  } else {
    MOZ_RELEASE_ASSERT(mFragA->Length() == headLen, "buffer incorrectly sized");
    char_traits::copy(aBuf, mFragA->Data(), mFragA->Length());
  }

  char_traits::copy(aBuf + headLen, mFragB->Data(), mFragB->Length());
}

Minimal test - lines (15, 26)

path: .spaces[0].metrics.loc.ploc
old: 9.0
new: 11.0

path: .spaces[0].metrics.loc.lloc
old: 4.0
new: 6.0

path: .spaces[0].metrics.loc.sloc
old: 10.0
new: 12.0

path: .spaces[0].metrics.halstead.n1
old: 11.0
new: 14.0

path: .spaces[0].metrics.halstead.time
old: 80.27237128039165
new: 224.0283534673173

path: .spaces[0].metrics.halstead.bugs
old: 0.04260276732882897
new: 0.08444923893085841

path: .spaces[0].metrics.halstead.length
old: 44.0
new: 63.0

path: .spaces[0].metrics.halstead.N2
old: 18.0
new: 25.0

path: .spaces[0].metrics.halstead.level
old: 0.1414141414141414
new: 0.07428571428571429

path: .spaces[0].metrics.halstead.estimated_program_length
old: 91.35671671381672
new: 101.40868524464064

path: .spaces[0].metrics.halstead.purity_ratio
old: 2.0762890162231074
new: 1.6096616705498517

path: .spaces[0].metrics.halstead.volume
old: 204.32967235008783
new: 299.5579126362985

path: .spaces[0].metrics.halstead.N1
old: 26.0
new: 38.0

path: .spaces[0].metrics.halstead.effort
old: 1444.9026830470498
new: 4032.510362411711

path: .spaces[0].metrics.halstead.n2
old: 14.0
new: 13.0

path: .spaces[0].metrics.halstead.vocabulary
old: 25.0
new: 27.0

path: .spaces[0].metrics.halstead.difficulty
old: 7.071428571428571
new: 13.461538461538462

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

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

path: .spaces[0].metrics.mi.mi_sei
old: 76.81603930807948
new: 69.6848136036075

path: .spaces[0].metrics.mi.mi_original
old: 105.57550089548415
new: 100.63251190449276

path: .spaces[0].metrics.mi.mi_visual_studio
old: 61.7400590032071
new: 58.84942216637004

path: .spaces[0].metrics.cognitive.average
old: 1.0
new: 2.0

path: .spaces[0].metrics.cognitive.sum
old: 1.0
new: 2.0

Code

typename nsTSubstringTuple::size_type nsTSubstringTuple::Length() const {
  mozilla::CheckedInt len;
  if (mHead) {
    len = mHead->Length();
  } else {
    len = mFragA->Length();
  }

  len += mFragB->Length();
  MOZ_RELEASE_ASSERT(len.isValid(), "Substring tuple length is invalid");
  return len.value();
}