Global Metrics
path: .metrics.loc.lloc
old: 0.0
new: 7.0
path: .metrics.loc.sloc
old: 80.0
new: 34.0
path: .metrics.loc.cloc
old: 30.0
new: 6.0
path: .metrics.loc.ploc
old: 40.0
new: 19.0
path: .metrics.loc.blank
old: 10.0
new: 9.0
path: .metrics.cognitive.sum
old: 0.0
new: 2.0
path: .metrics.cognitive.average
old: null
new: 2.0
path: .metrics.nargs.sum
old: 0.0
new: 2.0
path: .metrics.nargs.average
old: null
new: 2.0
path: .metrics.mi.mi_visual_studio
old: 38.35546809649407
new: 47.177446961106135
path: .metrics.mi.mi_sei
old: 59.75849913847354
new: 71.48622169371606
path: .metrics.mi.mi_original
old: 65.58785044500486
new: 80.67343430349149
path: .metrics.nexits.sum
old: 0.0
new: 3.0
path: .metrics.nexits.average
old: null
new: 3.0
path: .metrics.nom.functions
old: 0.0
new: 1.0
path: .metrics.nom.total
old: 0.0
new: 1.0
path: .metrics.halstead.estimated_program_length
old: 257.3293844521902
new: 211.20671786825557
path: .metrics.halstead.level
old: 0.20673076923076925
new: 0.0986842105263158
path: .metrics.halstead.bugs
old: 0.07418420339020458
new: 0.0950295673128675
path: .metrics.halstead.volume
old: 686.3634663785509
new: 475.0263282209031
path: .metrics.halstead.length
old: 121.0
new: 86.0
path: .metrics.halstead.N2
old: 52.0
new: 38.0
path: .metrics.halstead.time
old: 184.449096907931
new: 267.42222922065656
path: .metrics.halstead.purity_ratio
old: 2.126689127704051
new: 2.4558920682355296
path: .metrics.halstead.effort
old: 3320.0837443427577
new: 4813.600125971818
path: .metrics.halstead.n1
old: 8.0
new: 16.0
path: .metrics.halstead.n2
old: 43.0
new: 30.0
path: .metrics.halstead.vocabulary
old: 51.0
new: 46.0
path: .metrics.halstead.N1
old: 69.0
new: 48.0
path: .metrics.halstead.difficulty
old: 4.837209302325581
new: 10.133333333333333
path: .metrics.cyclomatic.average
old: 1.0
new: 1.6666666666666667
path: .metrics.cyclomatic.sum
old: 2.0
new: 5.0
Spaces Data
Minimal test - lines (13, 34)
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.cyclomatic.sum
old: 1.0
new: 4.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.0
new: 2.0
path: .spaces[0].metrics.loc.lloc
old: 0.0
new: 7.0
path: .spaces[0].metrics.loc.ploc
old: 12.0
new: 15.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 7.0
path: .spaces[0].metrics.loc.sloc
old: 12.0
new: 22.0
path: .spaces[0].metrics.nargs.average
old: null
new: 2.0
path: .spaces[0].metrics.nargs.sum
old: 0.0
new: 2.0
path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 2.0
path: .spaces[0].metrics.cognitive.average
old: null
new: 2.0
path: .spaces[0].metrics.halstead.vocabulary
old: 13.0
new: 43.0
path: .spaces[0].metrics.halstead.volume
old: 111.01319154423275
new: 450.3799746402741
path: .spaces[0].metrics.halstead.effort
old: 222.0263830884655
new: 4670.607144417657
path: .spaces[0].metrics.halstead.N2
old: 9.0
new: 35.0
path: .spaces[0].metrics.halstead.length
old: 30.0
new: 83.0
path: .spaces[0].metrics.halstead.n1
old: 4.0
new: 16.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 36.529325012980806
new: 192.38196255841365
path: .spaces[0].metrics.halstead.n2
old: 9.0
new: 27.0
path: .spaces[0].metrics.halstead.time
old: 12.334799060470308
new: 259.47817468986983
path: .spaces[0].metrics.halstead.bugs
old: 0.01222217416344232
new: 0.09313815661559094
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.2176441670993603
new: 2.317854970583297
path: .spaces[0].metrics.halstead.N1
old: 21.0
new: 48.0
path: .spaces[0].metrics.halstead.difficulty
old: 2.0
new: 10.37037037037037
path: .spaces[0].metrics.halstead.level
old: 0.5
new: 0.09642857142857145
path: .spaces[0].metrics.nexits.average
old: null
new: 3.0
path: .spaces[0].metrics.nexits.sum
old: 0.0
new: 3.0
path: .spaces[0].metrics.mi.mi_original
old: 106.02433728107636
new: 88.23263585988957
path: .spaces[0].metrics.mi.mi_sei
old: 77.36175347633944
new: 51.999213645229474
path: .spaces[0].metrics.mi.mi_visual_studio
old: 62.00253642168207
new: 51.59803266660208
Code
namespace mozilla {
nsresult CopyCocoaStringToXPCOMString(NSString* aFrom, nsAString& aTo) {
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
NSUInteger len = [aFrom length];
if (len > std::numeric_limits::max()) {
return NS_ERROR_OUT_OF_MEMORY;
}
if (!aTo.SetLength(len, mozilla::fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
[aFrom getCharacters:reinterpret_cast(aTo.BeginWriting()) range:NSMakeRange(0, len)];
return NS_OK;
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
}
} // namespace Mozilla