Global Metrics
path: .metrics.nargs.sum
old: 2.0
new: 15.0
path: .metrics.nargs.average
old: 1.0
new: 0.5555555555555556
path: .metrics.nom.functions
old: 2.0
new: 11.0
path: .metrics.nom.closures
old: 0.0
new: 16.0
path: .metrics.nom.total
old: 2.0
new: 27.0
path: .metrics.loc.cloc
old: 7.0
new: 49.0
path: .metrics.loc.lloc
old: 5.0
new: 231.0
path: .metrics.loc.sloc
old: 57.0
new: 3.0
path: .metrics.loc.ploc
old: 42.0
new: 555.0
path: .metrics.loc.blank
old: 8.0
new: 0.0
path: .metrics.halstead.purity_ratio
old: 2.1982670583548054
new: 0.8876099972624572
path: .metrics.halstead.level
old: 0.0921875
new: 0.014474482887425876
path: .metrics.halstead.n2
old: 59.0
new: 310.0
path: .metrics.halstead.volume
old: 1164.7890951227296
new: 25923.115350279917
path: .metrics.halstead.length
old: 187.0
new: 3078.0
path: .metrics.halstead.bugs
old: 0.18082657266893057
new: 4.915882593842979
path: .metrics.halstead.vocabulary
old: 75.0
new: 343.0
path: .metrics.halstead.estimated_program_length
old: 411.07593991234864
new: 2732.063571573843
path: .metrics.halstead.N2
old: 80.0
new: 1298.0
path: .metrics.halstead.N1
old: 107.0
new: 1780.0
path: .metrics.halstead.difficulty
old: 10.847457627118644
new: 69.08709677419355
path: .metrics.halstead.effort
old: 12635.000353873676
new: 1790952.778893371
path: .metrics.halstead.n1
old: 16.0
new: 33.0
path: .metrics.halstead.time
old: 701.9444641040932
new: 99497.37660518728
path: .metrics.mi.mi_original
old: 67.6390338210954
new: 67.69545118559685
path: .metrics.mi.mi_sei
old: 48.221664364538
new: 35.311802361811
path: .metrics.mi.mi_visual_studio
old: 39.55499053865229
new: 39.58798314947184
path: .metrics.nexits.sum
old: 0.0
new: 38.0
path: .metrics.nexits.average
old: 0.0
new: 1.4074074074074074
path: .metrics.cyclomatic.average
old: 1.6666666666666667
new: 12.909090909090908
path: .metrics.cyclomatic.sum
old: 5.0
new: 142.0
path: .metrics.cognitive.sum
old: 3.0
new: 179.0
path: .metrics.cognitive.average
old: 1.5
new: 6.62962962962963
Spaces Data
Minimal test - lines (317, 354)
path: .spaces[1].metrics.halstead.effort
old: 6955.2655789159335
new: 24011.36264005953
path: .spaces[1].metrics.halstead.estimated_program_length
old: 192.38196255841365
new: 315.51765025522434
path: .spaces[1].metrics.halstead.length
old: 103.0
new: 172.0
path: .spaces[1].metrics.halstead.vocabulary
old: 43.0
new: 63.0
path: .spaces[1].metrics.halstead.N2
old: 42.0
new: 71.0
path: .spaces[1].metrics.halstead.difficulty
old: 12.444444444444445
new: 23.355263157894736
path: .spaces[1].metrics.halstead.level
old: 0.08035714285714285
new: 0.04281690140845071
path: .spaces[1].metrics.halstead.time
old: 386.40364327310743
new: 1333.9645911144185
path: .spaces[1].metrics.halstead.n1
old: 16.0
new: 25.0
path: .spaces[1].metrics.halstead.n2
old: 27.0
new: 38.0
path: .spaces[1].metrics.halstead.volume
old: 558.9052697343161
new: 1028.0921468419856
path: .spaces[1].metrics.halstead.bugs
old: 0.12145662914669922
new: 0.2774320407742385
path: .spaces[1].metrics.halstead.N1
old: 61.0
new: 101.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.8677860442564431
new: 1.8344049433443277
path: .spaces[1].metrics.nargs.sum
old: 1.0
new: 2.0
path: .spaces[1].metrics.nom.total
old: 1.0
new: 2.0
path: .spaces[1].metrics.nom.closures
old: 0.0
new: 1.0
path: .spaces[1].metrics.loc.sloc
old: 27.0
new: 38.0
path: .spaces[1].metrics.loc.ploc
old: 23.0
new: 29.0
path: .spaces[1].metrics.loc.lloc
old: 4.0
new: 16.0
path: .spaces[1].metrics.loc.cloc
old: 0.0
new: 5.0
path: .spaces[1].metrics.cognitive.average
old: 3.0
new: 11.0
path: .spaces[1].metrics.cognitive.sum
old: 3.0
new: 22.0
path: .spaces[1].metrics.cyclomatic.average
old: 3.0
new: 12.0
path: .spaces[1].metrics.cyclomatic.sum
old: 3.0
new: 12.0
path: .spaces[1].metrics.mi.mi_visual_studio
old: 49.13587531974992
new: 42.83433438690814
path: .spaces[1].metrics.mi.mi_sei
old: 45.82323063375679
new: 57.83558383369295
path: .spaces[1].metrics.mi.mi_original
old: 84.02234679677235
new: 73.24671180161292
path: .spaces[1].metrics.nexits.average
old: 0.0
new: 2.0
path: .spaces[1].metrics.nexits.sum
old: 0.0
new: 4.0
Code
nsClipboard::GetNativeClipboardData(nsITransferable* aTransferable, int32_t aWhichClipboard) {
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
if ((aWhichClipboard != kGlobalClipboard && aWhichClipboard != kFindClipboard) || !aTransferable)
return NS_ERROR_FAILURE;
NSPasteboard* cocoaPasteboard;
if (aWhichClipboard == kFindClipboard) {
cocoaPasteboard = [NSPasteboard pasteboardWithName:NSFindPboard];
} else {
cocoaPasteboard = [NSPasteboard generalPasteboard];
}
if (!cocoaPasteboard) return NS_ERROR_FAILURE;
// get flavor list that includes all acceptable flavors (including ones obtained through
// conversion)
nsTArray flavors;
nsresult rv = aTransferable->FlavorsTransferableCanImport(flavors);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
// If we were the last ones to put something on the pasteboard, then just use the cached
// transferable. Otherwise clear it because it isn't relevant any more.
if (mCachedClipboard == aWhichClipboard && mChangeCount == [cocoaPasteboard changeCount]) {
if (mTransferable) {
for (uint32_t i = 0; i < flavors.Length(); i++) {
nsCString& flavorStr = flavors[i];
nsCOMPtr dataSupports;
rv = mTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(dataSupports));
if (NS_SUCCEEDED(rv)) {
aTransferable->SetTransferData(flavorStr.get(), dataSupports);
return NS_OK; // maybe try to fill in more types? Is there a point?
}
}
}
} else {
EmptyClipboard(aWhichClipboard);
}
Minimal test - lines (95, 95)
path: .spaces[0].metrics.halstead.time
old: 98.66084141876198
new: 4.754887502163468
path: .spaces[0].metrics.halstead.n2
old: 30.0
new: 3.0
path: .spaces[0].metrics.halstead.difficulty
old: 4.8
new: 3.0
path: .spaces[0].metrics.halstead.N1
old: 38.0
new: 6.0
path: .spaces[0].metrics.halstead.N2
old: 32.0
new: 3.0
path: .spaces[0].metrics.halstead.vocabulary
old: 39.0
new: 9.0
path: .spaces[0].metrics.halstead.bugs
old: 0.0488828995445354
new: 0.006473720020679235
path: .spaces[0].metrics.halstead.effort
old: 1775.8951455377155
new: 85.58797503894243
path: .spaces[0].metrics.halstead.estimated_program_length
old: 175.7360428812364
new: 20.264662506490403
path: .spaces[0].metrics.halstead.length
old: 70.0
new: 9.0
path: .spaces[0].metrics.halstead.n1
old: 9.0
new: 6.0
path: .spaces[0].metrics.halstead.volume
old: 369.9781553203574
new: 28.52932501298081
path: .spaces[0].metrics.halstead.level
old: 0.20833333333333337
new: 0.3333333333333333
path: .spaces[0].metrics.halstead.purity_ratio
old: 2.510514898303377
new: 2.2516291673878226
path: .spaces[0].metrics.loc.sloc
old: 19.0
new: 1.0
path: .spaces[0].metrics.loc.cloc
old: 4.0
new: 0.0
path: .spaces[0].metrics.loc.ploc
old: 15.0
new: 1.0
path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 0.0
path: .spaces[0].metrics.mi.mi_sei
old: 90.213553016361
new: 145.63125671373976
path: .spaces[0].metrics.mi.mi_original
old: 92.3201799235563
new: 153.34515096830847
path: .spaces[0].metrics.mi.mi_visual_studio
old: 53.988409312021226
new: 89.67552688205174
Code
void nsClipboard::ClearSelectionCache() { sSelectionCache = nullptr; }