Global Metrics
path: .metrics.nargs.average
old: 2.0
new: 1.0
path: .metrics.nargs.sum
old: 48.0
new: 7.0
path: .metrics.halstead.purity_ratio
old: 0.8538820987123437
new: 1.80513184998042
path: .metrics.halstead.length
old: 615.0
new: 243.0
path: .metrics.halstead.N1
old: 288.0
new: 138.0
path: .metrics.halstead.time
old: 2215.9704620959624
new: 1225.0431982193363
path: .metrics.halstead.vocabulary
old: 86.0
new: 79.0
path: .metrics.halstead.estimated_program_length
old: 525.1374907080914
new: 438.647039545242
path: .metrics.halstead.n1
old: 5.0
new: 17.0
path: .metrics.halstead.level
old: 0.09908256880733944
new: 0.06946778711484594
path: .metrics.halstead.volume
old: 3952.15282414179
new: 1531.818721807036
path: .metrics.halstead.N2
old: 327.0
new: 105.0
path: .metrics.halstead.n2
old: 81.0
new: 62.0
path: .metrics.halstead.effort
old: 39887.468317727325
new: 22050.77756794806
path: .metrics.halstead.difficulty
old: 10.092592592592592
new: 14.39516129032258
path: .metrics.halstead.bugs
old: 0.3891374781808013
new: 0.26211669553456485
path: .metrics.cyclomatic.average
old: 1.0
new: 1.4285714285714286
path: .metrics.cyclomatic.sum
old: 25.0
new: 10.0
path: .metrics.nom.closures
old: 0.0
new: 2.0
path: .metrics.nom.functions
old: 24.0
new: 5.0
path: .metrics.nom.total
old: 24.0
new: 7.0
path: .metrics.cognitive.average
old: 0.0
new: 0.5714285714285714
path: .metrics.cognitive.sum
old: 0.0
new: 4.0
path: .metrics.mi.mi_original
old: 38.238624698646674
new: 59.372026413721784
path: .metrics.mi.mi_sei
old: -12.19587184138291
new: 34.3659257095249
path: .metrics.mi.mi_visual_studio
old: 22.361768829617937
new: 34.72048328287824
path: .metrics.loc.sloc
old: 178.0
new: 81.0
path: .metrics.loc.ploc
old: 147.0
new: 62.0
path: .metrics.loc.blank
old: 30.0
new: 11.0
path: .metrics.loc.lloc
old: 36.0
new: 22.0
path: .metrics.loc.cloc
old: 1.0
new: 8.0
path: .metrics.nexits.average
old: 0.0
new: 1.0
path: .metrics.nexits.sum
old: 0.0
new: 7.0
Spaces Data
Minimal test - lines (53, 81)
path: .spaces[3].metrics.nom.closures
old: 0.0
new: 2.0
path: .spaces[3].metrics.nom.total
old: 1.0
new: 3.0
path: .spaces[3].metrics.nexits.sum
old: 0.0
new: 2.0
path: .spaces[3].metrics.nexits.average
old: 0.0
new: 0.6666666666666666
path: .spaces[3].metrics.cyclomatic.sum
old: 1.0
new: 3.0
path: .spaces[3].metrics.cyclomatic.average
old: 1.0
new: 3.0
path: .spaces[3].metrics.loc.lloc
old: 4.0
new: 11.0
path: .spaces[3].metrics.loc.ploc
old: 11.0
new: 26.0
path: .spaces[3].metrics.loc.sloc
old: 14.0
new: 29.0
path: .spaces[3].metrics.mi.mi_visual_studio
old: 58.06533285173629
new: 47.240078786026494
path: .spaces[3].metrics.mi.mi_sei
old: 67.64863872462323
new: 41.146284433026096
path: .spaces[3].metrics.mi.mi_original
old: 99.29171917646906
new: 80.78053472410531
path: .spaces[3].metrics.nargs.average
old: 2.0
new: 1.3333333333333333
path: .spaces[3].metrics.nargs.sum
old: 2.0
new: 4.0
path: .spaces[3].metrics.halstead.N2
old: 31.0
new: 61.0
path: .spaces[3].metrics.halstead.time
old: 71.95209920932851
new: 649.6498943414489
path: .spaces[3].metrics.halstead.effort
old: 1295.137785767913
new: 11693.69809814608
path: .spaces[3].metrics.halstead.n2
old: 15.0
new: 37.0
path: .spaces[3].metrics.halstead.bugs
old: 0.039605551156879144
new: 0.1717301951529247
path: .spaces[3].metrics.halstead.purity_ratio
old: 1.2105689553200794
new: 1.808528571238117
path: .spaces[3].metrics.halstead.vocabulary
old: 20.0
new: 54.0
path: .spaces[3].metrics.halstead.volume
old: 250.67182950346705
new: 834.4586878137029
path: .spaces[3].metrics.halstead.n1
old: 5.0
new: 17.0
path: .spaces[3].metrics.halstead.difficulty
old: 5.166666666666667
new: 14.013513513513514
path: .spaces[3].metrics.halstead.length
old: 58.0
new: 145.0
path: .spaces[3].metrics.halstead.estimated_program_length
old: 70.2129994085646
new: 262.23664282952694
path: .spaces[3].metrics.halstead.N1
old: 27.0
new: 84.0
path: .spaces[3].metrics.halstead.level
old: 0.1935483870967742
new: 0.07135969141755062
path: .spaces[3].metrics.cognitive.average
old: 0.0
new: 1.0
path: .spaces[3].metrics.cognitive.sum
old: 0.0
new: 3.0
Code
nsSharePicker::Share(const nsACString& aTitle, const nsACString& aText,
nsIURI* aUrl, Promise** aPromise) {
mozilla::ErrorResult result;
RefPtr promise = Promise::Create(GetGlobalObject(), result);
if (NS_WARN_IF(result.Failed())) {
return result.StealNSResult();
}
nsAutoCString urlString;
if (aUrl) {
nsresult rv = aUrl->GetSpec(urlString);
MOZ_ASSERT(NS_SUCCEEDED(rv));
mozilla::Unused << rv;
} else {
urlString.SetIsVoid(true);
}
auto mozPromise =
WindowsUIUtils::Share(NS_ConvertUTF8toUTF16_MaybeVoid(aTitle),
NS_ConvertUTF8toUTF16_MaybeVoid(aText),
NS_ConvertUTF8toUTF16_MaybeVoid(urlString));
mozPromise->Then(
mozilla::GetCurrentSerialEventTarget(), __func__,
[promise]() { promise->MaybeResolveWithUndefined(); },
[promise]() { promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR); });
promise.forget(aPromise);
return NS_OK;
}
Minimal test - lines (37, 44)
path: .spaces[1].metrics.loc.ploc
old: 5.0
new: 8.0
path: .spaces[1].metrics.loc.lloc
old: 1.0
new: 5.0
path: .spaces[1].metrics.loc.sloc
old: 5.0
new: 8.0
path: .spaces[1].metrics.nargs.average
old: 2.0
new: 1.0
path: .spaces[1].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[1].metrics.halstead.vocabulary
old: 14.0
new: 16.0
path: .spaces[1].metrics.halstead.volume
old: 72.33974351909448
new: 100.0
path: .spaces[1].metrics.halstead.bugs
old: 0.011435672812068764
new: 0.020998684164914547
path: .spaces[1].metrics.halstead.effort
old: 200.94373199748463
new: 500.0
path: .spaces[1].metrics.halstead.n2
old: 9.0
new: 8.0
path: .spaces[1].metrics.halstead.level
old: 0.36
new: 0.2
path: .spaces[1].metrics.halstead.estimated_program_length
old: 40.13896548741762
new: 48.0
path: .spaces[1].metrics.halstead.difficulty
old: 2.7777777777777777
new: 5.0
path: .spaces[1].metrics.halstead.length
old: 19.0
new: 25.0
path: .spaces[1].metrics.halstead.n1
old: 5.0
new: 8.0
path: .spaces[1].metrics.halstead.time
old: 11.163540666526924
new: 27.77777777777778
path: .spaces[1].metrics.halstead.N1
old: 9.0
new: 15.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 2.112577130916717
new: 1.92
path: .spaces[1].metrics.cognitive.average
old: 0.0
new: 1.0
path: .spaces[1].metrics.cognitive.sum
old: 0.0
new: 1.0
path: .spaces[1].metrics.nexits.sum
old: 0.0
new: 2.0
path: .spaces[1].metrics.nexits.average
old: 0.0
new: 2.0
path: .spaces[1].metrics.mi.mi_sei
old: 101.0358386582233
new: 87.39194781317144
path: .spaces[1].metrics.mi.mi_visual_studio
old: 71.59880858317844
new: 66.02699535535005
path: .spaces[1].metrics.mi.mi_original
old: 122.43396267723514
new: 112.90616205764856
path: .spaces[1].metrics.cyclomatic.average
old: 1.0
new: 2.0
path: .spaces[1].metrics.cyclomatic.sum
old: 1.0
new: 2.0
Code
nsSharePicker::Init(mozIDOMWindowProxy* aOpenerWindow) {
if (mInited) {
return NS_ERROR_FAILURE;
}
mOpenerWindow = aOpenerWindow;
mInited = true;
return NS_OK;
}
Minimal test - lines (24, 34)
path: .spaces[0].metrics.nargs.average
old: 2.0
new: 0.5
path: .spaces[0].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[0].metrics.halstead.N2
old: 10.0
new: 16.0
path: .spaces[0].metrics.halstead.effort
old: 200.94373199748463
new: 1103.2703718585194
path: .spaces[0].metrics.halstead.level
old: 0.36
new: 0.15277777777777776
path: .spaces[0].metrics.halstead.n1
old: 5.0
new: 9.0
path: .spaces[0].metrics.halstead.n2
old: 9.0
new: 11.0
path: .spaces[0].metrics.halstead.vocabulary
old: 14.0
new: 20.0
path: .spaces[0].metrics.halstead.volume
old: 72.33974351909448
new: 168.55519570060713
path: .spaces[0].metrics.halstead.N1
old: 9.0
new: 23.0
path: .spaces[0].metrics.halstead.length
old: 19.0
new: 39.0
path: .spaces[0].metrics.halstead.time
old: 11.163540666526924
new: 61.29279843658441
path: .spaces[0].metrics.halstead.estimated_program_length
old: 40.13896548741762
new: 66.58307281799108
path: .spaces[0].metrics.halstead.purity_ratio
old: 2.112577130916717
new: 1.7072582773843867
path: .spaces[0].metrics.halstead.difficulty
old: 2.7777777777777777
new: 6.545454545454546
path: .spaces[0].metrics.halstead.bugs
old: 0.011435672812068764
new: 0.035590442054476666
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 3.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 2.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 5.0
new: 11.0
path: .spaces[0].metrics.loc.sloc
old: 5.0
new: 11.0
path: .spaces[0].metrics.loc.lloc
old: 1.0
new: 3.0
path: .spaces[0].metrics.mi.mi_original
old: 122.43396267723514
new: 104.80232759186984
path: .spaces[0].metrics.mi.mi_visual_studio
old: 71.59880858317844
new: 61.2879108724385
path: .spaces[0].metrics.mi.mi_sei
old: 101.0358386582233
new: 75.80240587661184
path: .spaces[0].metrics.nexits.sum
old: 0.0
new: 2.0
path: .spaces[0].metrics.nexits.average
old: 0.0
new: 1.0
Code
namespace {
inline NS_ConvertUTF8toUTF16 NS_ConvertUTF8toUTF16_MaybeVoid(
const nsACString& aStr) {
auto str = NS_ConvertUTF8toUTF16(aStr);
str.SetIsVoid(aStr.IsVoid());
return str;
}
inline nsIGlobalObject* GetGlobalObject() {
return xpc::NativeGlobal(xpc::PrivilegedJunkScope());
}
} // namespace
Minimal test - lines (47, 50)
path: .spaces[2].metrics.mi.mi_visual_studio
old: 71.59880858317844
new: 74.41840954484594
path: .spaces[2].metrics.mi.mi_sei
old: 101.0358386582233
new: 107.991818253432
path: .spaces[2].metrics.mi.mi_original
old: 122.43396267723514
new: 127.25548032168658
path: .spaces[2].metrics.nexits.average
old: 0.0
new: 1.0
path: .spaces[2].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[2].metrics.halstead.estimated_program_length
old: 40.13896548741762
new: 31.26112492884004
path: .spaces[2].metrics.halstead.time
old: 11.163540666526924
new: 13.383860002692316
path: .spaces[2].metrics.halstead.difficulty
old: 2.7777777777777777
new: 4.2
path: .spaces[2].metrics.halstead.effort
old: 200.94373199748463
new: 240.9094800484617
path: .spaces[2].metrics.halstead.bugs
old: 0.011435672812068764
new: 0.012905693264191683
path: .spaces[2].metrics.halstead.N2
old: 10.0
new: 6.0
path: .spaces[2].metrics.halstead.n1
old: 5.0
new: 7.0
path: .spaces[2].metrics.halstead.purity_ratio
old: 2.112577130916717
new: 1.9538203080525025
path: .spaces[2].metrics.halstead.vocabulary
old: 14.0
new: 12.0
path: .spaces[2].metrics.halstead.length
old: 19.0
new: 16.0
path: .spaces[2].metrics.halstead.N1
old: 9.0
new: 10.0
path: .spaces[2].metrics.halstead.n2
old: 9.0
new: 5.0
path: .spaces[2].metrics.halstead.level
old: 0.36
new: 0.23809523809523808
path: .spaces[2].metrics.halstead.volume
old: 72.33974351909448
new: 57.3594000115385
path: .spaces[2].metrics.nargs.average
old: 2.0
new: 1.0
path: .spaces[2].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[2].metrics.loc.ploc
old: 5.0
new: 4.0
path: .spaces[2].metrics.loc.lloc
old: 1.0
new: 2.0
path: .spaces[2].metrics.loc.sloc
old: 5.0
new: 4.0
Code
nsSharePicker::GetOpenerWindow(mozIDOMWindowProxy** aOpenerWindow) {
*aOpenerWindow = mOpenerWindow;
return NS_OK;
}