Global Metrics
path: .metrics.mi.mi_visual_studio
old: 19.67064785842518
new: 19.653187892722297
path: .metrics.mi.mi_sei
old: 13.376201210618788
new: 13.333127326472308
path: .metrics.mi.mi_original
old: 33.63680783790706
new: 33.606951296555124
path: .metrics.halstead.bugs
old: 0.7857479833005104
new: 0.7962914159342248
path: .metrics.halstead.N2
old: 209.0
new: 212.0
path: .metrics.halstead.level
old: 0.03144224196855776
new: 0.03099730458221024
path: .metrics.halstead.time
old: 6358.201534367768
new: 6486.604634534679
path: .metrics.halstead.effort
old: 114447.62761861982
new: 116758.8834216242
path: .metrics.halstead.purity_ratio
old: 1.410314084020841
new: 1.4022397667459123
path: .metrics.halstead.difficulty
old: 31.804347826086957
new: 32.26086956521739
path: .metrics.halstead.length
old: 521.0
new: 524.0
path: .metrics.halstead.volume
old: 3598.4900003120383
new: 3619.210672098864
Spaces Data
Minimal test - lines (112, 125)
path: .spaces[3].metrics.mi.mi_sei
old: 66.7888113191957
new: 66.53448139669479
path: .spaces[3].metrics.mi.mi_original
old: 98.6251560861576
new: 98.44886801744406
path: .spaces[3].metrics.mi.mi_visual_studio
old: 57.675529874945966
new: 57.57243743710179
path: .spaces[3].metrics.halstead.difficulty
old: 10.0
new: 11.0
path: .spaces[3].metrics.halstead.bugs
old: 0.06505136278972949
new: 0.07090339444722354
path: .spaces[3].metrics.halstead.level
old: 0.1
new: 0.09090909090909093
path: .spaces[3].metrics.halstead.effort
old: 2726.2550365218335
new: 3102.2902139731204
path: .spaces[3].metrics.halstead.length
old: 58.0
new: 60.0
path: .spaces[3].metrics.halstead.volume
old: 272.62550365218334
new: 282.0263830884655
path: .spaces[3].metrics.halstead.purity_ratio
old: 1.6588178046839377
new: 1.6035238778611398
path: .spaces[3].metrics.halstead.N2
old: 20.0
new: 22.0
path: .spaces[3].metrics.halstead.time
old: 151.45861314010187
new: 172.34945633184003
Code
const createHost = async function(
type = "bottom",
src = CHROME_URL_ROOT + "dummy.html"
) {
const host = new Hosts[type](gBrowser.selectedTab);
const iframe = await host.create();
await new Promise(resolve => {
iframe.setAttribute("src", src);
DOMHelpers.onceDOMReady(iframe.contentWindow, resolve);
});
return { host: host, win: iframe.contentWindow, doc: iframe.contentDocument };
};
Minimal test - lines (178, 187)
path: .spaces[6].metrics.halstead.N2
old: 14.0
new: 15.0
path: .spaces[6].metrics.halstead.volume
old: 152.0
new: 156.0
path: .spaces[6].metrics.halstead.difficulty
old: 7.0
new: 7.5
path: .spaces[6].metrics.halstead.level
old: 0.14285714285714285
new: 0.13333333333333333
path: .spaces[6].metrics.halstead.purity_ratio
old: 1.263157894736842
new: 1.2307692307692308
path: .spaces[6].metrics.halstead.effort
old: 1064.0
new: 1170.0
path: .spaces[6].metrics.halstead.bugs
old: 0.03474080124518833
new: 0.03701144033861044
path: .spaces[6].metrics.halstead.length
old: 38.0
new: 39.0
path: .spaces[6].metrics.halstead.time
old: 59.111111111111114
new: 65.0
path: .spaces[6].metrics.mi.mi_original
old: 106.4239427850958
new: 106.28887025579888
path: .spaces[6].metrics.mi.mi_visual_studio
old: 62.23622385093322
new: 62.15723406771863
path: .spaces[6].metrics.mi.mi_sei
old: 78.3455417929181
new: 78.15067332474105
Code
function waitUntil(predicate, interval = 10) {
if (predicate()) {
return Promise.resolve(true);
}
return new Promise(resolve => {
setTimeout(function() {
waitUntil(predicate).then(() => resolve(true));
}, interval);
});
}