Global Metrics

path: .metrics.halstead.bugs
old: 3.476750241842485
new: 3.48052407175518

path: .metrics.halstead.level
old: 0.014938775510204082
new: 0.014921722113502936

path: .metrics.halstead.N2
old: 875.0
new: 876.0

path: .metrics.halstead.length
old: 2061.0
new: 2062.0

path: .metrics.halstead.effort
old: 1065226.8933993853
new: 1066961.73578431

path: .metrics.halstead.purity_ratio
old: 0.7326438661929126
new: 0.7322885587893272

path: .metrics.halstead.difficulty
old: 66.93989071038251
new: 67.01639344262296

path: .metrics.halstead.volume
old: 15913.18542792551
new: 15920.906527114215

path: .metrics.halstead.time
old: 59179.2718555214
new: 59275.65198801723

path: .metrics.mi.mi_original
old: -12.55085058382521
new: -12.55337301899472

path: .metrics.mi.mi_sei
old: -62.85574572524975
new: -62.85938482995978

Spaces Data

Minimal test - lines (50, 94)

path: .spaces[2].metrics.halstead.effort
old: 15706.101233571058
new: 16165.53482144566

path: .spaces[2].metrics.halstead.length
old: 136.0
new: 137.0

path: .spaces[2].metrics.halstead.N2
old: 46.0
new: 47.0

path: .spaces[2].metrics.halstead.volume
old: 718.8147017652658
new: 724.100103984128

path: .spaces[2].metrics.halstead.bugs
old: 0.20905361098569092
new: 0.213110802043262

path: .spaces[2].metrics.halstead.difficulty
old: 21.85
new: 22.325

path: .spaces[2].metrics.halstead.time
old: 872.5611796428366
new: 898.0852678580922

path: .spaces[2].metrics.halstead.purity_ratio
old: 1.229038122449819
new: 1.220067041264054

path: .spaces[2].metrics.halstead.level
old: 0.04576659038901602
new: 0.04479283314669653

path: .spaces[2].metrics.mi.mi_original
old: 72.36852890460266
new: 72.33043349612386

path: .spaces[2].metrics.mi.mi_sei
old: 45.96787020407657
new: 45.91291014718359

path: .spaces[2].metrics.mi.mi_visual_studio
old: 42.32077713719453
new: 42.29849912054027

Code

function getFocusedElementForBrowser(browser, dontCheckExtraFocus = false) {
  return SpecialPowers.spawn(
    browser,
    [dontCheckExtraFocus],
    dontCheckExtraFocusChild => {
      const { Services } = ChromeUtils.import(
        "resource://gre/modules/Services.jsm"
      );

      let focusedWindow = {};
      let node = Services.focus.getFocusedElementForWindow(
        content,
        false,
        focusedWindow
      );
      let details = "Focus is " + (node ? node.id : "");

      /* Check focus manager properties. Add an error onto the string if they are
       not what is expected which will cause matching to fail in the parent process. */
      let doc = content.document;
      if (!dontCheckExtraFocusChild) {
        if (Services.focus.focusedElement != node) {
          details += "";
        }
        if (
          Services.focus.focusedWindow &&
          Services.focus.focusedWindow != content
        ) {
          details += "";
        }
        if ((Services.focus.focusedWindow == content) != doc.hasFocus()) {
          details += "";
        }
        if (
          (Services.focus.focusedElement &&
            doc.activeElement != Services.focus.focusedElement) ||
          (!Services.focus.focusedElement && doc.activeElement != doc.body)
        ) {
          details += "";
        }
      }
      return details;
    }
  );
}