Global Metrics
path: .metrics.mi.mi_sei
old: -52.191304630663794
new: -52.225654572602
path: .metrics.mi.mi_original
old: -16.793911641052887
new: -16.817721206459765
path: .metrics.halstead.N2
old: 857.0
new: 867.0
path: .metrics.halstead.effort
old: 1043880.8634346346
new: 1060908.0456230638
path: .metrics.halstead.length
old: 2179.0
new: 2189.0
path: .metrics.halstead.purity_ratio
old: 1.192087864951167
new: 1.1866420546955654
path: .metrics.halstead.level
old: 0.017472997636358196
new: 0.017271463638245645
path: .metrics.halstead.volume
old: 18239.727859432925
new: 18323.434733501
path: .metrics.halstead.bugs
old: 3.4301467664071565
new: 3.46734647383606
path: .metrics.halstead.time
old: 57993.38130192415
new: 58939.335867947986
path: .metrics.halstead.difficulty
old: 57.23116438356164
new: 57.898972602739725
Spaces Data
Minimal test - lines (202, 205)
path: .spaces[12].metrics.halstead.N2
old: 6.0
new: 7.0
path: .spaces[12].metrics.halstead.length
old: 15.0
new: 16.0
path: .spaces[12].metrics.halstead.time
old: 10.378294855911893
new: 12.91521137624591
path: .spaces[12].metrics.halstead.level
old: 0.2777777777777778
new: 0.23809523809523808
path: .spaces[12].metrics.halstead.purity_ratio
old: 1.8079610319175832
new: 1.6949634674227343
path: .spaces[12].metrics.halstead.bugs
old: 0.01089292262669305
new: 0.012602637011514735
path: .spaces[12].metrics.halstead.difficulty
old: 3.6
new: 4.2
path: .spaces[12].metrics.halstead.effort
old: 186.8093074064141
new: 232.4738047724264
path: .spaces[12].metrics.halstead.volume
old: 51.89147427955946
new: 55.35090589819676
path: .spaces[12].metrics.mi.mi_sei
old: 108.74338677859146
new: 108.25921787575577
path: .spaces[12].metrics.mi.mi_visual_studio
old: 74.72305726660727
new: 74.52679977542871
path: .spaces[12].metrics.mi.mi_original
old: 127.77642792589845
new: 127.4408276159831
Code
function attachThread(targetFront, options = {}) {
dump("Attaching to thread.\n");
return targetFront.attachThread(options);
}
Minimal test - lines (438, 441)
path: .spaces[33].metrics.halstead.level
old: 0.2222222222222222
new: 0.2
path: .spaces[33].metrics.halstead.effort
old: 376.9281372837028
new: 437.84581603662446
path: .spaces[33].metrics.halstead.volume
old: 83.76180828526729
new: 87.56916320732489
path: .spaces[33].metrics.halstead.bugs
old: 0.017393398644619574
new: 0.019220272822236643
path: .spaces[33].metrics.halstead.length
old: 22.0
new: 23.0
path: .spaces[33].metrics.halstead.purity_ratio
old: 1.7864985867639298
new: 1.7088247351654982
path: .spaces[33].metrics.halstead.time
old: 20.940452071316823
new: 24.32476755759025
path: .spaces[33].metrics.halstead.difficulty
old: 4.5
new: 5.0
path: .spaces[33].metrics.halstead.N2
old: 9.0
new: 10.0
path: .spaces[33].metrics.mi.mi_sei
old: 105.15125244839123
new: 104.81777469380872
path: .spaces[33].metrics.mi.mi_visual_studio
old: 73.26698838756
new: 73.1318134370522
path: .spaces[33].metrics.mi.mi_original
old: 125.2865501427276
new: 125.05540097735926
Code
function getFileUrl(name, allowMissing = false) {
const file = do_get_file(name, allowMissing);
return Services.io.newFileURI(file).spec;
}
Minimal test - lines (835, 913)
path: .spaces[65].metrics.mi.mi_original
old: 62.743619342453854
new: 62.71464990819669
path: .spaces[65].metrics.mi.mi_visual_studio
old: 36.69217505406658
new: 36.67523386444251
path: .spaces[65].metrics.mi.mi_sei
old: 45.8771376504086
new: 45.83534359126844
path: .spaces[65].metrics.halstead.bugs
old: 0.19016006908974872
new: 0.19288209993102828
path: .spaces[65].metrics.halstead.effort
old: 13625.764289037015
new: 13919.376129263674
path: .spaces[65].metrics.halstead.level
old: 0.07256235827664399
new: 0.07142857142857142
path: .spaces[65].metrics.halstead.purity_ratio
old: 1.1916366978145612
new: 1.1850164939378136
path: .spaces[65].metrics.halstead.volume
old: 988.7175901342054
new: 994.2411520902624
path: .spaces[65].metrics.halstead.time
old: 756.986904946501
new: 773.2986738479818
path: .spaces[65].metrics.halstead.N2
old: 63.0
new: 64.0
path: .spaces[65].metrics.halstead.length
old: 179.0
new: 180.0
path: .spaces[65].metrics.halstead.difficulty
old: 13.78125
new: 14.0
Code
function threadFrontTest(test, options = {}) {
const {
principal = systemPrincipal,
doNotRunWorker = false,
wantXrays = true,
waitForFinish = false,
} = options;
async function runThreadFrontTestWithServer(server, test) {
// Setup a server and connect a client to it.
initTestDevToolsServer(server);
// Create a custom debuggee and register it to the server.
// We are using a custom Sandbox as debuggee. Create a new zone because
// debugger and debuggee must be in different compartments.
const debuggee = Cu.Sandbox(principal, { freshZone: true, wantXrays });
const scriptName = "debuggee.js";
debuggee.__name = scriptName;
server.addTestGlobal(debuggee);
const client = new DevToolsClient(server.connectPipe());
await client.connect();
// Attach to the fake tab target and retrieve the ThreadFront instance.
// Automatically resume as the thread is paused by default after attach.
const { targetFront, threadFront } = await attachTestThread(
client,
scriptName
);
// Cross the client/server boundary to retrieve the target actor & thread
// actor instances, used by some tests.
const rootActor = client.transport._serverConnection.rootActor;
const targetActor = rootActor._parameters.tabList.getTargetActorForTab(
"debuggee.js"
);
const { threadActor } = targetActor;
// Run the test function
const args = {
threadActor,
threadFront,
debuggee,
client,
server,
targetFront,
};
if (waitForFinish) {
// Use dispatchToMainThread so that the test function does not have to
// finish executing before the test itself finishes.
const promise = new Promise(
resolve => (threadFrontTestFinished = resolve)
);
Services.tm.dispatchToMainThread(() => test(args));
await promise;
} else {
await test(args);
}
// Cleanup the client after the test ran
await client.close();
server.removeTestGlobal(debuggee);
// Also cleanup the created server
server.destroy();
}
return async () => {
dump(">>> Run thread front test against a regular DevToolsServer\n");
await runThreadFrontTestWithServer(DevToolsServer, test);
// Skip tests that fail in the worker context
if (!doNotRunWorker) {
dump(">>> Run thread front test against a worker DevToolsServer\n");
await runThreadFrontTestWithServer(WorkerDevToolsServer, test);
}
};
}
Minimal test - lines (675, 680)
path: .spaces[55].metrics.mi.mi_original
old: 116.62230985365346
new: 116.44602178493992
path: .spaces[55].metrics.mi.mi_sei
old: 92.65139595027368
new: 92.39706602777277
path: .spaces[55].metrics.mi.mi_visual_studio
old: 68.20018120096694
new: 68.09708876312276
path: .spaces[55].metrics.halstead.time
old: 45.260191438125986
new: 50.42249444035256
path: .spaces[55].metrics.halstead.length
old: 29.0
new: 30.0
path: .spaces[55].metrics.halstead.volume
old: 125.33591475173353
new: 129.65784284662087
path: .spaces[55].metrics.halstead.purity_ratio
old: 2.290984893025767
new: 2.2146187299249083
path: .spaces[55].metrics.halstead.level
old: 0.15384615384615383
new: 0.14285714285714285
path: .spaces[55].metrics.halstead.bugs
old: 0.029076224029483923
new: 0.031247117932665436
path: .spaces[55].metrics.halstead.effort
old: 814.6834458862678
new: 907.604899926346
path: .spaces[55].metrics.halstead.N2
old: 13.0
new: 14.0
path: .spaces[55].metrics.halstead.difficulty
old: 6.5
new: 7.0
Code
async function blackBox(sourceFront, range = null) {
dumpn("Black boxing source: " + sourceFront.actor);
const pausedInSource = await sourceFront.blackBox(range);
ok(true, "blackBox didn't throw");
return pausedInSource;
}
Minimal test - lines (688, 692)
path: .spaces[56].metrics.mi.mi_sei
old: 98.75069065971186
new: 98.44444347663332
path: .spaces[56].metrics.mi.mi_original
old: 120.85001878490476
new: 120.63774441339945
path: .spaces[56].metrics.mi.mi_visual_studio
old: 70.67252560520747
new: 70.54838854584763
path: .spaces[56].metrics.halstead.time
old: 26.64420222444666
new: 30.27750252778029
path: .spaces[56].metrics.halstead.difficulty
old: 4.888888888888889
new: 5.333333333333333
path: .spaces[56].metrics.halstead.purity_ratio
old: 2.188721875540867
new: 2.1011730005192324
path: .spaces[56].metrics.halstead.effort
old: 479.5956400400398
new: 544.9950455000452
path: .spaces[56].metrics.halstead.length
old: 24.0
new: 25.0
path: .spaces[56].metrics.halstead.N2
old: 11.0
new: 12.0
path: .spaces[56].metrics.halstead.bugs
old: 0.020423440109251106
new: 0.022240290111135968
path: .spaces[56].metrics.halstead.level
old: 0.20454545454545453
new: 0.1875
path: .spaces[56].metrics.halstead.volume
old: 98.09910819000814
new: 102.18657103125848
Code
async function unBlackBox(sourceFront, range = null) {
dumpn("Un-black boxing source: " + sourceFront.actor);
await sourceFront.unblackBox(range);
ok(true, "unblackBox didn't throw");
}
Minimal test - lines (399, 412)
path: .spaces[30].metrics.mi.mi_visual_studio
old: 58.96001558560061
new: 58.886736481383586
path: .spaces[30].metrics.mi.mi_original
old: 100.82162665137704
new: 100.69631938316591
path: .spaces[30].metrics.mi.mi_sei
old: 90.1749996108851
new: 89.99421943644955
path: .spaces[30].metrics.halstead.difficulty
old: 7.0
new: 7.5
path: .spaces[30].metrics.halstead.time
old: 66.48713752299687
new: 72.97368752524045
path: .spaces[30].metrics.halstead.level
old: 0.14285714285714285
new: 0.13333333333333333
path: .spaces[30].metrics.halstead.N2
old: 14.0
new: 15.0
path: .spaces[30].metrics.halstead.effort
old: 1196.7684754139436
new: 1313.5263754543282
path: .spaces[30].metrics.halstead.purity_ratio
old: 1.3916743908771128
new: 1.3585392863324195
path: .spaces[30].metrics.halstead.volume
old: 170.9669250591348
new: 175.1368500605771
path: .spaces[30].metrics.halstead.length
old: 41.0
new: 42.0
path: .spaces[30].metrics.halstead.bugs
old: 0.03757383343164935
new: 0.039979553894945646
Code
function initTestDevToolsServer(server = DevToolsServer) {
if (server === WorkerDevToolsServer) {
const { createRootActor } = worker.require("xpcshell-test/testactors");
server.setRootActor(createRootActor);
} else {
const { createRootActor } = require("xpcshell-test/testactors");
server.setRootActor(createRootActor);
}
// Allow incoming connections.
server.init(function() {
return true;
});
}
Minimal test - lines (447, 466)
path: .spaces[34].metrics.mi.mi_sei
old: 55.7898215573033
new: 55.5870520729008
path: .spaces[34].metrics.mi.mi_original
old: 90.78950889828052
new: 90.64895980186334
path: .spaces[34].metrics.mi.mi_visual_studio
old: 53.09328005747398
new: 53.011087603428855
path: .spaces[34].metrics.halstead.N2
old: 29.0
new: 31.0
path: .spaces[34].metrics.halstead.volume
old: 354.63261264431276
new: 364.3485746345679
path: .spaces[34].metrics.halstead.effort
old: 4178.01546771581
new: 4588.514861804089
path: .spaces[34].metrics.halstead.time
old: 232.1119704286561
new: 254.91749232244945
path: .spaces[34].metrics.halstead.level
old: 0.08488063660477453
new: 0.0794044665012407
path: .spaces[34].metrics.halstead.purity_ratio
old: 1.5356947443264957
new: 1.4947428844777892
path: .spaces[34].metrics.halstead.bugs
old: 0.08646866905425181
new: 0.09204358106535376
path: .spaces[34].metrics.halstead.difficulty
old: 11.78125
new: 12.59375
path: .spaces[34].metrics.halstead.length
old: 73.0
new: 75.0
Code
function getFilePath(
name,
allowMissing = false,
usePlatformPathSeparator = false
) {
const file = do_get_file(name, allowMissing);
let path = Services.io.newFileURI(file).spec;
let filePrePath = "file://";
if ("nsILocalFileWin" in Ci && file instanceof Ci.nsILocalFileWin) {
filePrePath += "/";
}
path = path.slice(filePrePath.length);
if (usePlatformPathSeparator && path.match(/^\w:/)) {
path = path.replace(/\//g, "\\");
}
return path;
}
Minimal test - lines (417, 427)
path: .spaces[31].metrics.mi.mi_original
old: 105.09946516644648
new: 104.96781256492818
path: .spaces[31].metrics.mi.mi_sei
old: 76.02744506310641
new: 75.83751050777583
path: .spaces[31].metrics.mi.mi_visual_studio
old: 61.46167553593362
new: 61.38468571048431
path: .spaces[31].metrics.halstead.bugs
old: 0.04325677188562626
new: 0.04570181188069797
path: .spaces[31].metrics.halstead.time
old: 82.12786564323689
new: 89.18863237274594
path: .spaces[31].metrics.halstead.N2
old: 17.0
new: 18.0
path: .spaces[31].metrics.halstead.effort
old: 1478.301581578264
new: 1605.395382709427
path: .spaces[31].metrics.halstead.level
old: 0.1176470588235294
new: 0.1111111111111111
path: .spaces[31].metrics.halstead.difficulty
old: 8.5
new: 9.0
path: .spaces[31].metrics.halstead.volume
old: 173.9178331268546
new: 178.37726474549189
path: .spaces[31].metrics.halstead.length
old: 39.0
new: 40.0
path: .spaces[31].metrics.halstead.purity_ratio
old: 1.951474246410783
new: 1.9026873902505137
Code
async function startTestDevToolsServer(title, server = DevToolsServer) {
initTestDevToolsServer(server);
addTestGlobal(title);
DevToolsServer.registerActors({ target: true });
const transport = DevToolsServer.connectPipe();
const client = new DevToolsClient(transport);
await connect(client);
return client;
}
Minimal test - lines (356, 360)
path: .spaces[26].metrics.mi.mi_original
old: 122.58207451918727
new: 122.315349388372
path: .spaces[26].metrics.mi.mi_visual_studio
old: 71.68542369543115
new: 71.52944408676726
path: .spaces[26].metrics.mi.mi_sei
old: 101.24951887810454
new: 100.86471585459692
path: .spaces[26].metrics.halstead.bugs
old: 0.017152321325890632
new: 0.019040520993546816
path: .spaces[26].metrics.halstead.difficulty
old: 5.25
new: 5.833333333333333
path: .spaces[26].metrics.halstead.effort
old: 369.1188618845739
new: 431.7179671164607
path: .spaces[26].metrics.halstead.purity_ratio
old: 1.850592603091061
new: 1.7580629729365085
path: .spaces[26].metrics.halstead.level
old: 0.1904761904761905
new: 0.17142857142857143
path: .spaces[26].metrics.halstead.volume
old: 70.30835464468075
new: 74.00879436282185
path: .spaces[26].metrics.halstead.length
old: 19.0
new: 20.0
path: .spaces[26].metrics.halstead.time
old: 20.506603438031885
new: 23.98433150647004
path: .spaces[26].metrics.halstead.N2
old: 9.0
new: 10.0
Code
function addTestGlobal(name, server = DevToolsServer) {
const global = testGlobal(name);
server.addTestGlobal(global);
return global;
}