Global Metrics

path: .metrics.mi.mi_visual_studio
old: 38.396932949748745
new: 27.209404917253792

path: .metrics.mi.mi_original
old: 65.65875534407036
new: 46.52808240850399

path: .metrics.mi.mi_sei
old: 47.969571419402286
new: 29.63878942134661

path: .metrics.nargs.sum
old: 10.0
new: 15.0

path: .metrics.nargs.average
old: 3.3333333333333335
new: 1.3636363636363635

path: .metrics.loc.lloc
old: 8.0
new: 16.0

path: .metrics.loc.blank
old: 3.0
new: 18.0

path: .metrics.loc.cloc
old: 9.0
new: 39.0

path: .metrics.loc.sloc
old: 60.0
new: 142.0

path: .metrics.loc.ploc
old: 48.0
new: 85.0

path: .metrics.cyclomatic.sum
old: 7.0
new: 19.0

path: .metrics.cyclomatic.average
old: 1.4
new: 1.0

path: .metrics.nom.total
old: 3.0
new: 11.0

path: .metrics.nom.functions
old: 3.0
new: 11.0

path: .metrics.cognitive.average
old: 0.3333333333333333
new: 0.0

path: .metrics.cognitive.sum
old: 1.0
new: 0.0

path: .metrics.halstead.N1
old: 134.0
new: 181.0

path: .metrics.halstead.effort
old: 28848.576642364325
new: 43278.89455104075

path: .metrics.halstead.vocabulary
old: 57.0
new: 84.0

path: .metrics.halstead.estimated_program_length
old: 281.1893365615893
new: 473.9886619036196

path: .metrics.halstead.N2
old: 94.0
new: 150.0

path: .metrics.halstead.level
old: 0.04609929078014184
new: 0.04888888888888889

path: .metrics.halstead.length
old: 228.0
new: 331.0

path: .metrics.halstead.purity_ratio
old: 1.2332865638666195
new: 1.4319899151166755

path: .metrics.halstead.difficulty
old: 21.692307692307693
new: 20.454545454545453

path: .metrics.halstead.n2
old: 39.0
new: 66.0

path: .metrics.halstead.volume
old: 1329.898923229561
new: 2115.85706693977

path: .metrics.halstead.time
old: 1602.6987023535737
new: 2404.383030613375

path: .metrics.halstead.bugs
old: 0.31354148111836405
new: 0.41089373370260673

path: .metrics.nexits.average
old: 0.6666666666666666
new: 0.3636363636363637

path: .metrics.nexits.sum
old: 2.0
new: 4.0

Spaces Data

Minimal test - lines (28, 80)

path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 17.509775004326936
new: 252.7242144196627

path: .spaces[0].spaces[1].metrics.halstead.level
old: 0.3333333333333333
new: 0.07645875251509054

path: .spaces[0].spaces[1].metrics.halstead.N2
old: 2.0
new: 71.0

path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 8.0
new: 52.0

path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.0057689982812296325
new: 0.17474983015243534

path: .spaces[0].spaces[1].metrics.halstead.volume
old: 24.0
new: 917.7707946207156

path: .spaces[0].spaces[1].metrics.halstead.n2
old: 2.0
new: 38.0

path: .spaces[0].spaces[1].metrics.halstead.time
old: 4.0
new: 666.8597732843505

path: .spaces[0].spaces[1].metrics.halstead.N1
old: 6.0
new: 90.0

path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 3.0
new: 13.078947368421051

path: .spaces[0].spaces[1].metrics.halstead.n1
old: 6.0
new: 14.0

path: .spaces[0].spaces[1].metrics.halstead.length
old: 8.0
new: 161.0

path: .spaces[0].spaces[1].metrics.halstead.effort
old: 72.0
new: 12003.47591911831

path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 2.188721875540867
new: 1.569715617513433

path: .spaces[0].spaces[1].metrics.loc.sloc
old: 1.0
new: 53.0

path: .spaces[0].spaces[1].metrics.loc.cloc
old: 0.0
new: 11.0

path: .spaces[0].spaces[1].metrics.loc.blank
old: 0.0
new: 3.0

path: .spaces[0].spaces[1].metrics.loc.lloc
old: 1.0
new: 9.0

path: .spaces[0].spaces[1].metrics.loc.ploc
old: 1.0
new: 39.0

path: .spaces[0].spaces[1].metrics.nexits.sum
old: 1.0
new: 2.0

path: .spaces[0].spaces[1].metrics.nexits.average
old: 1.0
new: 0.4

path: .spaces[0].spaces[1].metrics.nom.functions
old: 1.0
new: 5.0

path: .spaces[0].spaces[1].metrics.nom.total
old: 1.0
new: 5.0

path: .spaces[0].spaces[1].metrics.cyclomatic.sum
old: 1.0
new: 7.0

path: .spaces[0].spaces[1].metrics.nargs.sum
old: 0.0
new: 6.0

path: .spaces[0].spaces[1].metrics.nargs.average
old: 0.0
new: 1.2

path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 90.2012398141466
new: 40.7000836622594

path: .spaces[0].spaces[1].metrics.mi.mi_original
old: 154.24412008219068
new: 69.59714306246359

path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: 146.92819499625
new: 57.850395712703744

Code

class WidgetContentCommandEvent : public WidgetGUIEvent {
 public:
  virtual WidgetContentCommandEvent* AsContentCommandEvent() override {
    return this;
  }

  WidgetContentCommandEvent(bool aIsTrusted, EventMessage aMessage,
                            nsIWidget* aWidget, bool aOnlyEnabledCheck = false)
      : WidgetGUIEvent(aIsTrusted, aMessage, aWidget,
                       eContentCommandEventClass),
        mOnlyEnabledCheck(aOnlyEnabledCheck),
        mSucceeded(false),
        mIsEnabled(false) {}

  virtual WidgetEvent* Duplicate() const override {
    // This event isn't an internal event of any DOM event.
    NS_ASSERTION(!IsAllowedToDispatchDOMEvent(),
                 "WidgetQueryContentEvent needs to support Duplicate()");
    MOZ_CRASH("WidgetQueryContentEvent doesn't support Duplicate()");
    return nullptr;
  }

  // eContentCommandPasteTransferable
  nsCOMPtr mTransferable;  // [in]

  // eContentCommandScroll
  // for mScroll.mUnit
  enum { eCmdScrollUnit_Line, eCmdScrollUnit_Page, eCmdScrollUnit_Whole };

  struct ScrollInfo {
    ScrollInfo()
        : mAmount(0), mUnit(eCmdScrollUnit_Line), mIsHorizontal(false) {}

    int32_t mAmount;     // [in]
    uint8_t mUnit;       // [in]
    bool mIsHorizontal;  // [in]
  } mScroll;

  bool mOnlyEnabledCheck;  // [in]

  bool mSucceeded;  // [out]
  bool mIsEnabled;  // [out]

  void AssignContentCommandEventData(const WidgetContentCommandEvent& aEvent,
                                     bool aCopyTargets) {
    AssignGUIEventData(aEvent, aCopyTargets);

    mScroll = aEvent.mScroll;
    mOnlyEnabledCheck = aEvent.mOnlyEnabledCheck;
    mSucceeded = aEvent.mSucceeded;
    mIsEnabled = aEvent.mIsEnabled;
  }
};

Minimal test - lines (17, 140)

path: .spaces[0].metrics.cognitive.average
old: 0.3333333333333333
new: 0.0

path: .spaces[0].metrics.cognitive.sum
old: 1.0
new: 0.0

path: .spaces[0].metrics.mi.mi_sei
old: 28.089888889386813
new: 32.884059082393364

path: .spaces[0].metrics.mi.mi_visual_studio
old: 41.82386112242261
new: 28.7443141547342

path: .spaces[0].metrics.mi.mi_original
old: 71.51880251934267
new: 49.15277720459548

path: .spaces[0].metrics.nexits.average
old: 0.6666666666666666
new: 0.3636363636363637

path: .spaces[0].metrics.nexits.sum
old: 2.0
new: 4.0

path: .spaces[0].metrics.cyclomatic.sum
old: 6.0
new: 18.0

path: .spaces[0].metrics.cyclomatic.average
old: 1.5
new: 1.0

path: .spaces[0].metrics.nargs.average
old: 3.3333333333333335
new: 1.3636363636363635

path: .spaces[0].metrics.nargs.sum
old: 10.0
new: 15.0

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.146772773058718
new: 1.3255311288965208

path: .spaces[0].metrics.halstead.N1
old: 133.0
new: 181.0

path: .spaces[0].metrics.halstead.difficulty
old: 22.88571428571429
new: 21.45

path: .spaces[0].metrics.halstead.n2
old: 35.0
new: 60.0

path: .spaces[0].metrics.halstead.effort
old: 29101.43631632392
new: 43682.288340648855

path: .spaces[0].metrics.halstead.level
old: 0.04369538077403246
new: 0.046620046620046623

path: .spaces[0].metrics.halstead.volume
old: 1271.59834091303
new: 2036.4703189113688

path: .spaces[0].metrics.halstead.estimated_program_length
old: 254.58355561903545
new: 429.4720857624727

path: .spaces[0].metrics.halstead.bugs
old: 0.31537095617136507
new: 0.4134430217238909

path: .spaces[0].metrics.halstead.vocabulary
old: 53.0
new: 78.0

path: .spaces[0].metrics.halstead.N2
old: 89.0
new: 143.0

path: .spaces[0].metrics.halstead.length
old: 222.0
new: 324.0

path: .spaces[0].metrics.halstead.time
old: 1616.746462017995
new: 2426.793796702714

path: .spaces[0].metrics.loc.lloc
old: 8.0
new: 16.0

path: .spaces[0].metrics.loc.blank
old: 1.0
new: 15.0

path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 33.0

path: .spaces[0].metrics.loc.sloc
old: 43.0
new: 124.0

path: .spaces[0].metrics.loc.ploc
old: 42.0
new: 76.0

path: .spaces[0].metrics.nom.total
old: 3.0
new: 11.0

path: .spaces[0].metrics.nom.functions
old: 3.0
new: 11.0

Code

namespace mozilla {

namespace dom {
class PBrowserParent;
class PBrowserChild;
}  // namespace dom

/******************************************************************************
 * mozilla::WidgetContentCommandEvent
 ******************************************************************************/

class WidgetContentCommandEvent : public WidgetGUIEvent {
 public:
  virtual WidgetContentCommandEvent* AsContentCommandEvent() override {
    return this;
  }

  WidgetContentCommandEvent(bool aIsTrusted, EventMessage aMessage,
                            nsIWidget* aWidget, bool aOnlyEnabledCheck = false)
      : WidgetGUIEvent(aIsTrusted, aMessage, aWidget,
                       eContentCommandEventClass),
        mOnlyEnabledCheck(aOnlyEnabledCheck),
        mSucceeded(false),
        mIsEnabled(false) {}

  virtual WidgetEvent* Duplicate() const override {
    // This event isn't an internal event of any DOM event.
    NS_ASSERTION(!IsAllowedToDispatchDOMEvent(),
                 "WidgetQueryContentEvent needs to support Duplicate()");
    MOZ_CRASH("WidgetQueryContentEvent doesn't support Duplicate()");
    return nullptr;
  }

  // eContentCommandPasteTransferable
  nsCOMPtr mTransferable;  // [in]

  // eContentCommandScroll
  // for mScroll.mUnit
  enum { eCmdScrollUnit_Line, eCmdScrollUnit_Page, eCmdScrollUnit_Whole };

  struct ScrollInfo {
    ScrollInfo()
        : mAmount(0), mUnit(eCmdScrollUnit_Line), mIsHorizontal(false) {}

    int32_t mAmount;     // [in]
    uint8_t mUnit;       // [in]
    bool mIsHorizontal;  // [in]
  } mScroll;

  bool mOnlyEnabledCheck;  // [in]

  bool mSucceeded;  // [out]
  bool mIsEnabled;  // [out]

  void AssignContentCommandEventData(const WidgetContentCommandEvent& aEvent,
                                     bool aCopyTargets) {
    AssignGUIEventData(aEvent, aCopyTargets);

    mScroll = aEvent.mScroll;
    mOnlyEnabledCheck = aEvent.mOnlyEnabledCheck;
    mSucceeded = aEvent.mSucceeded;
    mIsEnabled = aEvent.mIsEnabled;
  }
};

/******************************************************************************
 * mozilla::WidgetCommandEvent
 *
 * This sends a command to chrome.  If you want to request what is performed
 * in focused content, you should use WidgetContentCommandEvent instead.
 *
 * XXX Should be |WidgetChromeCommandEvent|?
 ******************************************************************************/

class WidgetCommandEvent : public WidgetGUIEvent {
 public:
  virtual WidgetCommandEvent* AsCommandEvent() override { return this; }

 protected:
  WidgetCommandEvent(bool aIsTrusted, nsAtom* aEventType, nsAtom* aCommand,
                     nsIWidget* aWidget)
      : WidgetGUIEvent(aIsTrusted, eUnidentifiedEvent, aWidget,
                       eCommandEventClass),
        mCommand(aCommand) {
    mSpecifiedEventType = aEventType;
  }

 public:
  /**
   * Constructor to initialize an app command.  This is the only case to
   * initialize this class as a command in C++ stack.
   */
  WidgetCommandEvent(bool aIsTrusted, nsAtom* aCommand, nsIWidget* aWidget)
      : WidgetCommandEvent(aIsTrusted, nsGkAtoms::onAppCommand, aCommand,
                           aWidget) {}

  /**
   * Constructor to initialize as internal event of dom::CommandEvent.
   */
  WidgetCommandEvent() : WidgetCommandEvent(false, nullptr, nullptr, nullptr) {}

  virtual WidgetEvent* Duplicate() const override {
    MOZ_ASSERT(mClass == eCommandEventClass,
               "Duplicate() must be overridden by sub class");
    // Not copying widget, it is a weak reference.
    WidgetCommandEvent* result =
        new WidgetCommandEvent(false, mSpecifiedEventType, mCommand, nullptr);
    result->AssignCommandEventData(*this, true);
    result->mFlags = mFlags;
    return result;
  }

  RefPtr mCommand;

  // XXX Not tested by test_assign_event_data.html
  void AssignCommandEventData(const WidgetCommandEvent& aEvent,
                              bool aCopyTargets) {
    AssignGUIEventData(aEvent, aCopyTargets);

    // mCommand must have been initialized with the constructor.
  }
};

}  // namespace mozilla

Minimal test - lines (91, 138)

path: .spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 53.45885236677018
new: 41.907183970679576

path: .spaces[0].spaces[2].metrics.mi.mi_original
old: 91.414637547177
new: 71.66128458986208

path: .spaces[0].spaces[2].metrics.mi.mi_sei
old: 56.48805184017493
new: 60.87911387934833

path: .spaces[0].spaces[2].metrics.nom.functions
old: 1.0
new: 6.0

path: .spaces[0].spaces[2].metrics.nom.total
old: 1.0
new: 6.0

path: .spaces[0].spaces[2].metrics.cognitive.sum
old: 1.0
new: 0.0

path: .spaces[0].spaces[2].metrics.cognitive.average
old: 1.0
new: 0.0

path: .spaces[0].spaces[2].metrics.nargs.sum
old: 5.0
new: 9.0

path: .spaces[0].spaces[2].metrics.nargs.average
old: 5.0
new: 1.5

path: .spaces[0].spaces[2].metrics.nexits.average
old: 0.0
new: 0.3333333333333333

path: .spaces[0].spaces[2].metrics.nexits.sum
old: 0.0
new: 2.0

path: .spaces[0].spaces[2].metrics.loc.cloc
old: 0.0
new: 10.0

path: .spaces[0].spaces[2].metrics.loc.lloc
old: 6.0
new: 7.0

path: .spaces[0].spaces[2].metrics.loc.ploc
old: 18.0
new: 31.0

path: .spaces[0].spaces[2].metrics.loc.blank
old: 0.0
new: 7.0

path: .spaces[0].spaces[2].metrics.loc.sloc
old: 18.0
new: 48.0

path: .spaces[0].spaces[2].metrics.cyclomatic.average
old: 3.0
new: 1.0

path: .spaces[0].spaces[2].metrics.cyclomatic.sum
old: 3.0
new: 7.0

path: .spaces[0].spaces[2].metrics.halstead.time
old: 344.5168426381369
new: 875.6665074975315

path: .spaces[0].spaces[2].metrics.halstead.vocabulary
old: 35.0
new: 45.0

path: .spaces[0].spaces[2].metrics.halstead.estimated_program_length
old: 145.54163478716043
new: 204.88144885869957

path: .spaces[0].spaces[2].metrics.halstead.length
old: 93.0
new: 153.0

path: .spaces[0].spaces[2].metrics.halstead.volume
old: 477.0233205758819
new: 840.2535237384402

path: .spaces[0].spaces[2].metrics.halstead.N2
old: 39.0
new: 68.0

path: .spaces[0].spaces[2].metrics.halstead.difficulty
old: 13.0
new: 18.75862068965517

path: .spaces[0].spaces[2].metrics.halstead.bugs
old: 0.11251248607650503
new: 0.2095493130383483

path: .spaces[0].spaces[2].metrics.halstead.n1
old: 14.0
new: 16.0

path: .spaces[0].spaces[2].metrics.halstead.N1
old: 54.0
new: 85.0

path: .spaces[0].spaces[2].metrics.halstead.n2
old: 21.0
new: 29.0

path: .spaces[0].spaces[2].metrics.halstead.level
old: 0.07692307692307693
new: 0.05330882352941177

path: .spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 1.5649638149157037
new: 1.3390944369849644

path: .spaces[0].spaces[2].metrics.halstead.effort
old: 6201.303167486464
new: 15761.997134955567

Code

class WidgetCommandEvent : public WidgetGUIEvent {
 public:
  virtual WidgetCommandEvent* AsCommandEvent() override { return this; }

 protected:
  WidgetCommandEvent(bool aIsTrusted, nsAtom* aEventType, nsAtom* aCommand,
                     nsIWidget* aWidget)
      : WidgetGUIEvent(aIsTrusted, eUnidentifiedEvent, aWidget,
                       eCommandEventClass),
        mCommand(aCommand) {
    mSpecifiedEventType = aEventType;
  }

 public:
  /**
   * Constructor to initialize an app command.  This is the only case to
   * initialize this class as a command in C++ stack.
   */
  WidgetCommandEvent(bool aIsTrusted, nsAtom* aCommand, nsIWidget* aWidget)
      : WidgetCommandEvent(aIsTrusted, nsGkAtoms::onAppCommand, aCommand,
                           aWidget) {}

  /**
   * Constructor to initialize as internal event of dom::CommandEvent.
   */
  WidgetCommandEvent() : WidgetCommandEvent(false, nullptr, nullptr, nullptr) {}

  virtual WidgetEvent* Duplicate() const override {
    MOZ_ASSERT(mClass == eCommandEventClass,
               "Duplicate() must be overridden by sub class");
    // Not copying widget, it is a weak reference.
    WidgetCommandEvent* result =
        new WidgetCommandEvent(false, mSpecifiedEventType, mCommand, nullptr);
    result->AssignCommandEventData(*this, true);
    result->mFlags = mFlags;
    return result;
  }

  RefPtr mCommand;

  // XXX Not tested by test_assign_event_data.html
  void AssignCommandEventData(const WidgetCommandEvent& aEvent,
                              bool aCopyTargets) {
    AssignGUIEventData(aEvent, aCopyTargets);

    // mCommand must have been initialized with the constructor.
  }
};

Minimal test - lines (19, 22)

path: .spaces[0].spaces[0].metrics.nargs.average
old: 5.0
new: null

path: .spaces[0].spaces[0].metrics.nargs.sum
old: 5.0
new: 0.0

path: .spaces[0].spaces[0].metrics.nexits.sum
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].metrics.nexits.average
old: 1.0
new: null

path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 3.0

path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 64.73870079798759
new: 78.45287306850658

path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 84.11189430458703
new: 118.14851385841868

path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 110.70317836455877
new: 134.15441294714626

path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.09090909090909093
new: 1.0

path: .spaces[0].spaces[0].metrics.halstead.length
old: 56.0
new: 6.0

path: .spaces[0].spaces[0].metrics.halstead.volume
old: 242.0279733136923
new: 13.931568569324174

path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 20.0
new: 5.0

path: .spaces[0].spaces[0].metrics.halstead.N2
old: 22.0
new: 3.0

path: .spaces[0].spaces[0].metrics.halstead.effort
old: 2662.3077064506156
new: 13.931568569324174

path: .spaces[0].spaces[0].metrics.halstead.N1
old: 34.0
new: 3.0

path: .spaces[0].spaces[0].metrics.halstead.n1
old: 10.0
new: 2.0

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.06403010954184515
new: 0.0019299471801733172

path: .spaces[0].spaces[0].metrics.halstead.time
old: 147.90598369170087
new: 0.7739760316291208

path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.1864028910312008
new: 1.1258145836939113

path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 66.43856189774725
new: 6.754887502163468

path: .spaces[0].spaces[0].metrics.halstead.n2
old: 10.0
new: 3.0

path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 11.0
new: 1.0

path: .spaces[0].spaces[0].metrics.loc.ploc
old: 7.0
new: 4.0

path: .spaces[0].spaces[0].metrics.loc.sloc
old: 7.0
new: 4.0

path: .spaces[0].spaces[0].metrics.loc.lloc
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].metrics.nom.total
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].metrics.nom.functions
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].metrics.cognitive.average
old: 0.0
new: null

Code

namespace dom {
class PBrowserParent;
class PBrowserChild;
}  // namespace dom