Global Metrics

path: .metrics.halstead.time
old: 29561.676563842855
new: 29743.767575835176

path: .metrics.halstead.level
old: 0.015805733170486388
new: 0.015735641227380016

path: .metrics.halstead.volume
old: 8410.391493125779
new: 8424.670595830577

path: .metrics.halstead.difficulty
old: 63.268181818181816
new: 63.55

path: .metrics.halstead.N2
old: 449.0
new: 451.0

path: .metrics.halstead.bugs
old: 2.188835494628565
new: 2.19781466985484

path: .metrics.halstead.effort
old: 532110.1781491714
new: 535387.8163650332

path: .metrics.halstead.length
old: 1178.0
new: 1180.0

path: .metrics.halstead.purity_ratio
old: 0.763607516222161
new: 0.7623132661946659

path: .metrics.mi.mi_original
old: 16.727944295935927
new: 16.71912325904539

path: .metrics.mi.mi_visual_studio
old: 9.782423564874811
new: 9.777265063769232

path: .metrics.mi.mi_sei
old: -26.83601927775598
new: -26.848745343933444

Spaces Data

Minimal test - lines (377, 385)

path: .spaces[7].metrics.halstead.volume
old: 76.14709844115208
new: 79.9544533632097

path: .spaces[7].metrics.halstead.difficulty
old: 3.5
new: 4.0

path: .spaces[7].metrics.halstead.purity_ratio
old: 1.9651484454403227
new: 1.8715699480384027

path: .spaces[7].metrics.halstead.level
old: 0.2857142857142857
new: 0.25

path: .spaces[7].metrics.halstead.N2
old: 7.0
new: 8.0

path: .spaces[7].metrics.halstead.length
old: 20.0
new: 21.0

path: .spaces[7].metrics.halstead.time
old: 14.806380252446235
new: 17.76765630293549

path: .spaces[7].metrics.halstead.bugs
old: 0.01380468012191284
new: 0.015588841634277276

path: .spaces[7].metrics.halstead.effort
old: 266.51484454403226
new: 319.8178134528388

path: .spaces[7].metrics.mi.mi_sei
old: 86.68348574852546
new: 86.31746124349017

path: .spaces[7].metrics.mi.mi_visual_studio
old: 65.73982080409681
new: 65.59145305340614

path: .spaces[7].metrics.mi.mi_original
old: 112.41509357500554
new: 112.1613847213245

Code

function promiseUpdateVisibility(condition = true) {
  if (condition) {
    return BrowserTestUtils.waitForEvent(
      gToolbar,
      "BookmarksToolbarVisibilityUpdated"
    );
  }
  return Promise.resolve();
}

Minimal test - lines (405, 432)

path: .spaces[9].metrics.halstead.N2
old: 34.0
new: 35.0

path: .spaces[9].metrics.halstead.effort
old: 5128.131061739804
new: 5336.338429016324

path: .spaces[9].metrics.halstead.length
old: 92.0
new: 93.0

path: .spaces[9].metrics.halstead.level
old: 0.09049773755656108
new: 0.08791208791208792

path: .spaces[9].metrics.halstead.time
old: 284.8961700966558
new: 296.4632460564624

path: .spaces[9].metrics.halstead.volume
old: 464.0842589809777
new: 469.1286531003362

path: .spaces[9].metrics.halstead.purity_ratio
old: 1.462437806886755
new: 1.4467126691782952

path: .spaces[9].metrics.halstead.difficulty
old: 11.05
new: 11.375

path: .spaces[9].metrics.halstead.bugs
old: 0.09912537029209484
new: 0.10179059548100626

path: .spaces[9].metrics.mi.mi_visual_studio
old: 48.81868015650801
new: 48.78580485607413

path: .spaces[9].metrics.mi.mi_sei
old: 45.44798690117945
new: 45.36688325491414

path: .spaces[9].metrics.mi.mi_original
old: 83.4799430676287
new: 83.42372630388677

Code

async function toggleToolbar(show, expectedMinChildCount = 0) {
  let promiseReady = Promise.resolve();
  if (show) {
    promiseReady = promiseUpdateVisibility();
  }

  await promiseSetToolbarVisibility(gToolbar, show);
  await promiseReady;

  if (show) {
    if (getPlacesChildren().length < expectedMinChildCount) {
      await new Promise(resolve => {
        info("Waiting for bookmark elements to appear");
        let mut = new MutationObserver(mutations => {
          let children = getPlacesChildren();
          info(`${children.length} bookmark elements appeared`);
          if (children.length >= expectedMinChildCount) {
            resolve();
            mut.disconnect();
          }
        });
        mut.observe(document.getElementById("PlacesToolbarItems"), {
          childList: true,
        });
      });
    }
  }
}