Global Metrics

path: .metrics.nom.closures
old: 3.0
new: 1.0

path: .metrics.nom.functions
old: 18.0
new: 1.0

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

path: .metrics.nexits.average
old: 1.9047619047619049
new: 1.0

path: .metrics.nexits.sum
old: 40.0
new: 2.0

path: .metrics.cyclomatic.sum
old: 125.0
new: 4.0

path: .metrics.cyclomatic.average
old: 5.208333333333333
new: 1.3333333333333333

path: .metrics.halstead.effort
old: 1802265.5466723377
new: 2210.8659947262186

path: .metrics.halstead.n1
old: 46.0
new: 13.0

path: .metrics.halstead.time
old: 100125.86370401876
new: 122.82588859590103

path: .metrics.halstead.bugs
old: 4.9365620354355775
new: 0.056570110256548456

path: .metrics.halstead.purity_ratio
old: 1.2006238216215623
new: 2.5989700410034846

path: .metrics.halstead.vocabulary
old: 423.0
new: 34.0

path: .metrics.halstead.difficulty
old: 71.25729442970822
new: 8.047619047619047

path: .metrics.halstead.length
old: 2899.0
new: 54.0

path: .metrics.halstead.n2
old: 377.0
new: 21.0

path: .metrics.halstead.level
old: 0.014033650982727814
new: 0.1242603550295858

path: .metrics.halstead.volume
old: 25292.365660194733
new: 274.7229934275183

path: .metrics.halstead.N2
old: 1168.0
new: 26.0

path: .metrics.halstead.estimated_program_length
old: 3480.608458880909
new: 140.34438221418816

path: .metrics.halstead.N1
old: 1731.0
new: 28.0

path: .metrics.mi.mi_original
old: -21.37219493768951
new: 84.73310924909352

path: .metrics.mi.mi_sei
old: -60.186866021231424
new: 81.92185748154753

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

path: .metrics.nargs.sum
old: 15.0
new: 1.0

path: .metrics.nargs.average
old: 0.7142857142857143
new: 0.5

path: .metrics.cognitive.average
old: 8.333333333333334
new: 0.5

path: .metrics.cognitive.sum
old: 175.0
new: 1.0

path: .metrics.loc.lloc
old: 320.0
new: 4.0

path: .metrics.loc.cloc
old: 213.0
new: 8.0

path: .metrics.loc.sloc
old: 940.0
new: 32.0

path: .metrics.loc.blank
old: 120.0
new: 8.0

path: .metrics.loc.ploc
old: 607.0
new: 16.0

Spaces Data

Minimal test - lines (14, 32)

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

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

path: .spaces[0].metrics.mi.mi_visual_studio
old: 0.0
new: 54.96856053251733

path: .spaces[0].metrics.mi.mi_sei
old: -57.13067395998131
new: 84.29887808318503

path: .spaces[0].metrics.mi.mi_original
old: -18.62241992577765
new: 93.99623851060464

path: .spaces[0].metrics.nargs.average
old: 0.6
new: 0.5

path: .spaces[0].metrics.nargs.sum
old: 12.0
new: 1.0

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

path: .spaces[0].metrics.cognitive.average
old: 8.7
new: 0.5

path: .spaces[0].metrics.loc.sloc
old: 849.0
new: 19.0

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

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

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

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

path: .spaces[0].metrics.cyclomatic.average
old: 5.545454545454546
new: 1.5

path: .spaces[0].metrics.cyclomatic.sum
old: 122.0
new: 3.0

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.130169629608594
new: 2.3518516927417994

path: .spaces[0].metrics.halstead.difficulty
old: 71.40236686390533
new: 8.411764705882353

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

path: .spaces[0].metrics.halstead.bugs
old: 4.689964663430806
new: 0.054032418729740905

path: .spaces[0].metrics.halstead.effort
old: 1668922.7618050154
new: 2063.7804563882887

path: .spaces[0].metrics.halstead.n1
old: 44.0
new: 13.0

path: .spaces[0].metrics.halstead.level
old: 0.01400513797961382
new: 0.11888111888111888

path: .spaces[0].metrics.halstead.volume
old: 23373.493556397418
new: 245.34452978042592

path: .spaces[0].metrics.halstead.time
old: 92717.93121138976
new: 114.65446979934936

path: .spaces[0].metrics.halstead.length
old: 2725.0
new: 50.0

path: .spaces[0].metrics.halstead.vocabulary
old: 382.0
new: 30.0

path: .spaces[0].metrics.halstead.estimated_program_length
old: 3079.712240683419
new: 117.59258463708996

path: .spaces[0].metrics.halstead.N1
old: 1628.0
new: 28.0

path: .spaces[0].metrics.halstead.N2
old: 1097.0
new: 22.0

path: .spaces[0].metrics.nom.total
old: 20.0
new: 2.0

path: .spaces[0].metrics.nom.closures
old: 3.0
new: 1.0

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

Code

namespace mozilla {

nsresult GetSelectedCityInfo(nsAString& aCountryCode) {
  NS_OBJC_BEGIN_TRY_BLOCK_RETURN;

  // Can be replaced with [[NSLocale currentLocale] countryCode] once we build
  // with the 10.12 SDK.
  id countryCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];

  if (![countryCode isKindOfClass:[NSString class]]) {
    return NS_ERROR_FAILURE;
  }

  return mozilla::CopyCocoaStringToXPCOMString((NSString*)countryCode, aCountryCode);

  NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
}

}  // namespace Mozilla

Minimal test - lines (16, 30)

path: .spaces[0].spaces[0].metrics.cognitive.average
old: 8.7
new: 0.5

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

path: .spaces[0].spaces[0].metrics.nargs.average
old: 0.6
new: 0.5

path: .spaces[0].spaces[0].metrics.nargs.sum
old: 12.0
new: 1.0

path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 5.761904761904762
new: 2.0

path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 121.0
new: 2.0

path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 71.54896142433235
new: 8.53125

path: .spaces[0].spaces[0].metrics.halstead.n2
old: 337.0
new: 16.0

path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 381.0
new: 29.0

path: .spaces[0].spaces[0].metrics.halstead.N1
old: 1627.0
new: 27.0

path: .spaces[0].spaces[0].metrics.halstead.N2
old: 1096.0
new: 21.0

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 4.692703708065341
new: 0.05272523899377648

path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.013976443264764432
new: 0.11721611721611722

path: .spaces[0].spaces[0].metrics.halstead.n1
old: 44.0
new: 13.0

path: .spaces[0].spaces[0].metrics.halstead.volume
old: 23346.041291544316
new: 233.18308776612344

path: .spaces[0].spaces[0].metrics.halstead.time
old: 92799.16709886523
new: 110.51906763915224

path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.1273855315748542
new: 2.3355357569965456

path: .spaces[0].spaces[0].metrics.halstead.effort
old: 1670385.0077795745
new: 1989.3432175047408

path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 3069.8708024783277
new: 112.1057163358342

path: .spaces[0].spaces[0].metrics.halstead.length
old: 2723.0
new: 48.0

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

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

path: .spaces[0].spaces[0].metrics.nom.total
old: 20.0
new: 2.0

path: .spaces[0].spaces[0].metrics.nom.closures
old: 3.0
new: 1.0

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

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

path: .spaces[0].spaces[0].metrics.loc.blank
old: 103.0
new: 4.0

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

path: .spaces[0].spaces[0].metrics.loc.sloc
old: 847.0
new: 15.0

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

path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: -56.87858017246076
new: 93.14844136271094

path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 0.0
new: 57.49713585336257

path: .spaces[0].spaces[0].metrics.mi.mi_original
old: -18.34810134998358
new: 98.32010230925

Code

nsresult GetSelectedCityInfo(nsAString& aCountryCode) {
  NS_OBJC_BEGIN_TRY_BLOCK_RETURN;

  // Can be replaced with [[NSLocale currentLocale] countryCode] once we build
  // with the 10.12 SDK.
  id countryCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];

  if (![countryCode isKindOfClass:[NSString class]]) {
    return NS_ERROR_FAILURE;
  }

  return mozilla::CopyCocoaStringToXPCOMString((NSString*)countryCode, aCountryCode);

  NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
}