Global Metrics

path: .metrics.mi.mi_sei
old: -57.83465099020761
new: -470.3787599515142

path: .metrics.mi.mi_original
old: -11.973642670692811
new: -402.371408949428

path: .metrics.cognitive.average
old: 3.8333333333333335
new: 4.819354838709677

path: .metrics.cognitive.sum
old: 92.0
new: 1494.0

path: .metrics.halstead.n2
old: 364.0
new: 2737.0

path: .metrics.halstead.N2
old: 925.0
new: 12855.0

path: .metrics.halstead.estimated_program_length
old: 3244.043966900581
new: 31527.226074263537

path: .metrics.halstead.bugs
old: 2.7023355561674283
new: 39.4712291435634

path: .metrics.halstead.difficulty
old: 38.11813186813187
new: 115.0703324808184

path: .metrics.halstead.effort
old: 729946.1047741757
new: 40747677.29273548

path: .metrics.halstead.vocabulary
old: 394.0
new: 2786.0

path: .metrics.halstead.n1
old: 30.0
new: 49.0

path: .metrics.halstead.level
old: 0.026234234234234235
new: 0.008690337278435295

path: .metrics.halstead.N1
old: 1296.0
new: 18088.0

path: .metrics.halstead.time
old: 40552.561376343096
new: 2263759.8495964156

path: .metrics.halstead.volume
old: 19149.57709101261
new: 354111.05898671056

path: .metrics.halstead.purity_ratio
old: 1.4606231278255657
new: 1.0188807185555224

path: .metrics.halstead.length
old: 2221.0
new: 30943.0

path: .metrics.loc.lloc
old: 207.0
new: 3210.0

path: .metrics.loc.cloc
old: 57.0
new: 1105.0

path: .metrics.loc.sloc
old: 609.0
new: 8592.0

path: .metrics.loc.blank
old: 92.0
new: 1226.0

path: .metrics.loc.ploc
old: 460.0
new: 6261.0

path: .metrics.cyclomatic.average
old: 4.653846153846154
new: 5.051612903225807

path: .metrics.cyclomatic.sum
old: 121.0
new: 1566.0

path: .metrics.nexits.average
old: 2.2916666666666665
new: 1.5741935483870968

path: .metrics.nexits.sum
old: 55.0
new: 488.0

path: .metrics.nom.total
old: 24.0
new: 310.0

path: .metrics.nom.closures
old: 0.0
new: 8.0

path: .metrics.nom.functions
old: 24.0
new: 302.0

path: .metrics.nargs.sum
old: 75.0
new: 387.0

path: .metrics.nargs.average
old: 3.125
new: 1.2483870967741937

Spaces Data

Minimal test - lines (660, 672)

path: .spaces[21].metrics.nargs.average
old: 7.0
new: 0.0

path: .spaces[21].metrics.nargs.sum
old: 7.0
new: 0.0

path: .spaces[21].metrics.cognitive.average
old: 6.0
new: 1.0

path: .spaces[21].metrics.cognitive.sum
old: 6.0
new: 1.0

path: .spaces[21].metrics.cyclomatic.sum
old: 9.0
new: 2.0

path: .spaces[21].metrics.cyclomatic.average
old: 9.0
new: 2.0

path: .spaces[21].metrics.loc.lloc
old: 18.0
new: 5.0

path: .spaces[21].metrics.loc.ploc
old: 35.0
new: 9.0

path: .spaces[21].metrics.loc.sloc
old: 44.0
new: 13.0

path: .spaces[21].metrics.loc.cloc
old: 9.0
new: 4.0

path: .spaces[21].metrics.halstead.effort
old: 15592.093366950974
new: 1162.2329676781649

path: .spaces[21].metrics.halstead.N2
old: 56.0
new: 16.0

path: .spaces[21].metrics.halstead.purity_ratio
old: 1.5786843227432623
new: 1.624963314785643

path: .spaces[21].metrics.halstead.vocabulary
old: 50.0
new: 19.0

path: .spaces[21].metrics.halstead.difficulty
old: 18.666666666666668
new: 7.2

path: .spaces[21].metrics.halstead.level
old: 0.05357142857142857
new: 0.1388888888888889

path: .spaces[21].metrics.halstead.n2
old: 30.0
new: 10.0

path: .spaces[21].metrics.halstead.time
old: 866.2274092750541
new: 64.56849820434249

path: .spaces[21].metrics.halstead.n1
old: 20.0
new: 9.0

path: .spaces[21].metrics.halstead.bugs
old: 0.2080407271623444
new: 0.03684745854061194

path: .spaces[21].metrics.halstead.estimated_program_length
old: 233.64527976600283
new: 61.74860596185444

path: .spaces[21].metrics.halstead.N1
old: 92.0
new: 22.0

path: .spaces[21].metrics.halstead.volume
old: 835.2907160866592
new: 161.42124551085624

path: .spaces[21].metrics.halstead.length
old: 148.0
new: 38.0

path: .spaces[21].metrics.nexits.sum
old: 6.0
new: 1.0

path: .spaces[21].metrics.nexits.average
old: 6.0
new: 1.0

path: .spaces[21].metrics.mi.mi_sei
old: 62.251006501587995
new: 110.32302515388012

path: .spaces[21].metrics.mi.mi_visual_studio
old: 42.480510426260935
new: 59.97130411345403

path: .spaces[21].metrics.mi.mi_original
old: 72.6416728289062
new: 102.5509300340064

Code

static GtkWidget* EnsureInvisibleContainer() {
  if (!gInvisibleContainer) {
    // GtkWidgets need to be anchored to a GtkWindow to be realized (to
    // have a window).  Using GTK_WINDOW_POPUP rather than
    // GTK_WINDOW_TOPLEVEL in the hope that POPUP results in less
    // initialization and window manager interaction.
    GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP);
    gInvisibleContainer = moz_container_new();
    gtk_container_add(GTK_CONTAINER(window), gInvisibleContainer);
    gtk_widget_realize(gInvisibleContainer);
  }
  return gInvisibleContainer;
}

Minimal test - lines (585, 594)

path: .spaces[13].metrics.halstead.estimated_program_length
old: 27.651484454403228
new: 57.05865002596162

path: .spaces[13].metrics.halstead.difficulty
old: 4.375
new: 5.0

path: .spaces[13].metrics.halstead.bugs
old: 0.01069025622487706
new: 0.02216119334839852

path: .spaces[13].metrics.halstead.effort
old: 181.62015997845813
new: 542.0902501875005

path: .spaces[13].metrics.halstead.length
old: 12.0
new: 26.0

path: .spaces[13].metrics.halstead.n1
old: 7.0
new: 9.0

path: .spaces[13].metrics.halstead.vocabulary
old: 11.0
new: 18.0

path: .spaces[13].metrics.halstead.purity_ratio
old: 2.304290371200269
new: 2.194563462536985

path: .spaces[13].metrics.halstead.time
old: 10.090008887692118
new: 30.116125010416695

path: .spaces[13].metrics.halstead.N2
old: 5.0
new: 10.0

path: .spaces[13].metrics.halstead.level
old: 0.22857142857142856
new: 0.2

path: .spaces[13].metrics.halstead.n2
old: 4.0
new: 9.0

path: .spaces[13].metrics.halstead.volume
old: 41.51317942364757
new: 108.41805003750012

path: .spaces[13].metrics.halstead.N1
old: 7.0
new: 16.0

path: .spaces[13].metrics.cognitive.sum
old: 0.0
new: 2.0

path: .spaces[13].metrics.cognitive.average
old: 0.0
new: 2.0

path: .spaces[13].metrics.loc.cloc
old: 0.0
new: 1.0

path: .spaces[13].metrics.loc.blank
old: 0.0
new: 1.0

path: .spaces[13].metrics.loc.lloc
old: 1.0
new: 4.0

path: .spaces[13].metrics.loc.sloc
old: 3.0
new: 10.0

path: .spaces[13].metrics.loc.ploc
old: 3.0
new: 8.0

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

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

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

path: .spaces[13].metrics.nexits.average
old: 1.0
new: 0.0

path: .spaces[13].metrics.mi.mi_visual_studio
old: 78.12703155932819
new: 63.532719084088534

path: .spaces[13].metrics.mi.mi_original
old: 133.5972239664512
new: 108.64094963379138

path: .spaces[13].metrics.mi.mi_sei
old: 117.141020360323
new: 104.8671589792841

Code

void nsWindow::DispatchActivateEvent(void) {
  NS_ASSERTION(mContainer || mIsDestroyed,
               "DispatchActivateEvent only intended for container windows");

#ifdef ACCESSIBILITY
  DispatchActivateEventAccessible();
#endif  // ACCESSIBILITY

  if (mWidgetListener) mWidgetListener->WindowActivated();
}

Minimal test - lines (638, 654)

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

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

path: .spaces[19].metrics.loc.sloc
old: 9.0
new: 17.0

path: .spaces[19].metrics.loc.lloc
old: 1.0
new: 7.0

path: .spaces[19].metrics.loc.blank
old: 0.0
new: 5.0

path: .spaces[19].metrics.loc.cloc
old: 0.0
new: 3.0

path: .spaces[19].metrics.nargs.sum
old: 6.0
new: 1.0

path: .spaces[19].metrics.nargs.average
old: 6.0
new: 1.0

path: .spaces[19].metrics.mi.mi_original
old: 107.64881717102084
new: 98.25392225161691

path: .spaces[19].metrics.mi.mi_sei
old: 79.70538255758616
new: 96.54404489467149

path: .spaces[19].metrics.mi.mi_visual_studio
old: 62.952524661415694
new: 57.45843406527306

path: .spaces[19].metrics.halstead.N1
old: 23.0
new: 25.0

path: .spaces[19].metrics.halstead.difficulty
old: 5.6
new: 6.0

path: .spaces[19].metrics.halstead.vocabulary
old: 23.0
new: 20.0

path: .spaces[19].metrics.halstead.volume
old: 199.03672606650855
new: 159.91133951083242

path: .spaces[19].metrics.halstead.length
old: 44.0
new: 37.0

path: .spaces[19].metrics.halstead.estimated_program_length
old: 82.60335893412778
new: 66.43856189774725

path: .spaces[19].metrics.halstead.level
old: 0.17857142857142858
new: 0.16666666666666666

path: .spaces[19].metrics.halstead.n2
old: 15.0
new: 10.0

path: .spaces[19].metrics.halstead.time
old: 61.922536998469326
new: 53.30377983694414

path: .spaces[19].metrics.halstead.N2
old: 21.0
new: 12.0

path: .spaces[19].metrics.halstead.purity_ratio
old: 1.8773490666847223
new: 1.795636808047223

path: .spaces[19].metrics.halstead.effort
old: 1114.605665972448
new: 959.4680370649944

path: .spaces[19].metrics.halstead.bugs
old: 0.03583380364137614
new: 0.03242642618041891

path: .spaces[19].metrics.halstead.n1
old: 8.0
new: 10.0

path: .spaces[19].metrics.cyclomatic.sum
old: 1.0
new: 2.0

path: .spaces[19].metrics.cyclomatic.average
old: 1.0
new: 2.0

Code

void nsWindow::OnDestroy(void) {
  if (mOnDestroyCalled) return;

  mOnDestroyCalled = true;

  // Prevent deletion.
  nsCOMPtr kungFuDeathGrip = this;

  // release references to children, device context, toolkit + app shell
  nsBaseWidget::OnDestroy();

  // Remove association between this object and its parent and siblings.
  nsBaseWidget::Destroy();
  mParent = nullptr;

  NotifyWindowDestroyed();
}

Minimal test - lines (318, 322)

path: .spaces[2].metrics.loc.ploc
old: 12.0
new: 5.0

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

path: .spaces[2].metrics.loc.sloc
old: 15.0
new: 5.0

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

path: .spaces[2].metrics.nargs.average
old: 1.6666666666666667
new: 1.0

path: .spaces[2].metrics.halstead.time
old: 211.93212866785743
new: 32.14285714285714

path: .spaces[2].metrics.halstead.n1
old: 13.0
new: 9.0

path: .spaces[2].metrics.halstead.volume
old: 304.31280013846197
new: 100.0

path: .spaces[2].metrics.halstead.N1
old: 37.0
new: 16.0

path: .spaces[2].metrics.halstead.n2
old: 14.0
new: 7.0

path: .spaces[2].metrics.halstead.purity_ratio
old: 1.5845107069475102
new: 1.9272323786953616

path: .spaces[2].metrics.halstead.effort
old: 3814.778316021434
new: 578.5714285714286

path: .spaces[2].metrics.halstead.length
old: 64.0
new: 25.0

path: .spaces[2].metrics.halstead.estimated_program_length
old: 101.40868524464064
new: 48.18080946738404

path: .spaces[2].metrics.halstead.vocabulary
old: 27.0
new: 16.0

path: .spaces[2].metrics.halstead.level
old: 0.07977207977207977
new: 0.1728395061728395

path: .spaces[2].metrics.halstead.N2
old: 27.0
new: 9.0

path: .spaces[2].metrics.halstead.bugs
old: 0.0813813610460007
new: 0.02314462067689908

path: .spaces[2].metrics.halstead.difficulty
old: 12.535714285714286
new: 5.785714285714286

path: .spaces[2].metrics.cyclomatic.sum
old: 4.0
new: 1.0

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

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

path: .spaces[2].metrics.mi.mi_original
old: 96.47569491696824
new: 120.7502208514295

path: .spaces[2].metrics.mi.mi_sei
old: 63.89143406863177
new: 98.6067126759962

path: .spaces[2].metrics.mi.mi_visual_studio
old: 56.41853503916273
new: 70.61416424060205

Code

void nsWindow::WithSettingsChangesIgnored(const std::function& aFn) {
  AutoRestore ar(sIgnoreChangedSettings);
  sIgnoreChangedSettings = true;
  aFn();
}

Minimal test - lines (324, 374)

path: .spaces[3].metrics.cognitive.average
old: 1.0
new: 0.4

path: .spaces[3].metrics.cognitive.sum
old: 1.0
new: 2.0

path: .spaces[3].metrics.halstead.n1
old: 13.0
new: 15.0

path: .spaces[3].metrics.halstead.vocabulary
old: 30.0
new: 61.0

path: .spaces[3].metrics.halstead.difficulty
old: 9.558823529411764
new: 12.391304347826088

path: .spaces[3].metrics.halstead.purity_ratio
old: 1.9277472891326224
new: 1.828580169080412

path: .spaces[3].metrics.halstead.bugs
old: 0.06717987342814923
new: 0.18017448735890312

path: .spaces[3].metrics.halstead.effort
old: 2861.150178174673
new: 12566.716702005537

path: .spaces[3].metrics.halstead.length
old: 61.0
new: 171.0

path: .spaces[3].metrics.halstead.n2
old: 17.0
new: 46.0

path: .spaces[3].metrics.halstead.estimated_program_length
old: 117.59258463708996
new: 312.6872089127504

path: .spaces[3].metrics.halstead.N1
old: 36.0
new: 95.0

path: .spaces[3].metrics.halstead.N2
old: 25.0
new: 76.0

path: .spaces[3].metrics.halstead.level
old: 0.10461538461538462
new: 0.08070175438596491

path: .spaces[3].metrics.halstead.time
old: 158.95278767637072
new: 698.1509278891964

path: .spaces[3].metrics.halstead.volume
old: 299.32032633211963
new: 1014.1560847232536

path: .spaces[3].metrics.mi.mi_sei
old: 71.72436627502958
new: 43.45697456945915

path: .spaces[3].metrics.mi.mi_original
old: 102.0462220882925
new: 69.24100181940082

path: .spaces[3].metrics.mi.mi_visual_studio
old: 59.676153268007305
new: 40.49181392947417

path: .spaces[3].metrics.nexits.sum
old: 2.0
new: 5.0

path: .spaces[3].metrics.nexits.average
old: 2.0
new: 1.0

path: .spaces[3].metrics.loc.ploc
old: 10.0
new: 38.0

path: .spaces[3].metrics.loc.lloc
old: 4.0
new: 12.0

path: .spaces[3].metrics.loc.cloc
old: 0.0
new: 3.0

path: .spaces[3].metrics.loc.blank
old: 1.0
new: 10.0

path: .spaces[3].metrics.loc.sloc
old: 11.0
new: 51.0

path: .spaces[3].metrics.cyclomatic.sum
old: 2.0
new: 9.0

path: .spaces[3].metrics.cyclomatic.average
old: 2.0
new: 1.2857142857142858

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

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

path: .spaces[3].metrics.nargs.average
old: 3.0
new: 0.8

path: .spaces[3].metrics.nargs.sum
old: 3.0
new: 4.0

Code

namespace mozilla {

class CurrentX11TimeGetter {
 public:
  explicit CurrentX11TimeGetter(GdkWindow* aWindow)
      : mWindow(aWindow), mAsyncUpdateStart() {}

  guint32 GetCurrentTime() const { return gdk_x11_get_server_time(mWindow); }

  void GetTimeAsyncForPossibleBackwardsSkew(const TimeStamp& aNow) {
    // Check for in-flight request
    if (!mAsyncUpdateStart.IsNull()) {
      return;
    }
    mAsyncUpdateStart = aNow;

    Display* xDisplay = GDK_WINDOW_XDISPLAY(mWindow);
    Window xWindow = GDK_WINDOW_XID(mWindow);
    unsigned char c = 'a';
    Atom timeStampPropAtom = TimeStampPropAtom();
    XChangeProperty(xDisplay, xWindow, timeStampPropAtom, timeStampPropAtom, 8,
                    PropModeReplace, &c, 1);
    XFlush(xDisplay);
  }

  gboolean PropertyNotifyHandler(GtkWidget* aWidget, GdkEventProperty* aEvent) {
    if (aEvent->atom != gdk_x11_xatom_to_atom(TimeStampPropAtom())) {
      return FALSE;
    }

    guint32 eventTime = aEvent->time;
    TimeStamp lowerBound = mAsyncUpdateStart;

    TimeConverter().CompensateForBackwardsSkew(eventTime, lowerBound);
    mAsyncUpdateStart = TimeStamp();
    return TRUE;
  }

 private:
  static Atom TimeStampPropAtom() {
    return gdk_x11_get_xatom_by_name_for_display(gdk_display_get_default(),
                                                 "GDK_TIMESTAMP_PROP");
  }

  // This is safe because this class is stored as a member of mWindow and
  // won't outlive it.
  GdkWindow* mWindow;
  TimeStamp mAsyncUpdateStart;
};

}  // namespace mozilla

Minimal test - lines (604, 612)

path: .spaces[15].metrics.cyclomatic.average
old: 25.0
new: 3.0

path: .spaces[15].metrics.cyclomatic.sum
old: 25.0
new: 3.0

path: .spaces[15].metrics.halstead.estimated_program_length
old: 736.1983250585423
new: 61.74860596185444

path: .spaces[15].metrics.halstead.level
old: 0.030466518565534752
new: 0.10588235294117648

path: .spaces[15].metrics.halstead.effort
old: 153889.4596362986
new: 1725.1305624040338

path: .spaces[15].metrics.halstead.volume
old: 4688.476079049402
new: 182.66088307807416

path: .spaces[15].metrics.halstead.time
old: 8549.41442423881
new: 95.8405868002241

path: .spaces[15].metrics.halstead.n2
old: 96.0
new: 9.0

path: .spaces[15].metrics.halstead.bugs
old: 0.9572337336209558
new: 0.04794684754952981

path: .spaces[15].metrics.halstead.vocabulary
old: 119.0
new: 19.0

path: .spaces[15].metrics.halstead.difficulty
old: 32.822916666666664
new: 9.444444444444445

path: .spaces[15].metrics.halstead.length
old: 680.0
new: 43.0

path: .spaces[15].metrics.halstead.N1
old: 406.0
new: 26.0

path: .spaces[15].metrics.halstead.N2
old: 274.0
new: 17.0

path: .spaces[15].metrics.halstead.purity_ratio
old: 1.082644595674327
new: 1.4360140921361495

path: .spaces[15].metrics.halstead.n1
old: 23.0
new: 10.0

path: .spaces[15].metrics.cognitive.sum
old: 51.0
new: 2.0

path: .spaces[15].metrics.cognitive.average
old: 51.0
new: 2.0

path: .spaces[15].metrics.nexits.average
old: 3.0
new: 0.0

path: .spaces[15].metrics.nexits.sum
old: 3.0
new: 0.0

path: .spaces[15].metrics.mi.mi_visual_studio
old: 23.092073516258974
new: 62.944607544448665

path: .spaces[15].metrics.mi.mi_original
old: 39.48744571280285
new: 107.63527890100724

path: .spaces[15].metrics.mi.mi_sei
old: 13.369342461096274
new: 79.88949068138426

path: .spaces[15].metrics.nargs.average
old: 7.0
new: 0.0

path: .spaces[15].metrics.nargs.sum
old: 7.0
new: 0.0

path: .spaces[15].metrics.loc.ploc
old: 117.0
new: 9.0

path: .spaces[15].metrics.loc.sloc
old: 156.0
new: 9.0

path: .spaces[15].metrics.loc.blank
old: 13.0
new: 0.0

path: .spaces[15].metrics.loc.lloc
old: 49.0
new: 5.0

path: .spaces[15].metrics.loc.cloc
old: 26.0
new: 0.0

Code

void nsWindow::DispatchResized() {
  mNeedsDispatchResized = false;
  if (mWidgetListener) {
    mWidgetListener->WindowResized(this, mBounds.width, mBounds.height);
  }
  if (mAttachedWidgetListener) {
    mAttachedWidgetListener->WindowResized(this, mBounds.width, mBounds.height);
  }
}

Minimal test - lines (416, 420)

path: .spaces[6].metrics.mi.mi_sei
old: 75.00400858264237
new: 142.76702956629293

path: .spaces[6].metrics.mi.mi_visual_studio
old: 53.485742832177515
new: 71.68474575855885

path: .spaces[6].metrics.mi.mi_original
old: 91.46062024302356
new: 122.58091524713564

path: .spaces[6].metrics.cyclomatic.sum
old: 4.0
new: 1.0

path: .spaces[6].metrics.cyclomatic.average
old: 4.0
new: 1.0

path: .spaces[6].metrics.halstead.level
old: 0.09380863039399624
new: 0.14814814814814814

path: .spaces[6].metrics.halstead.estimated_program_length
old: 164.20212108020232
new: 44.039100017307746

path: .spaces[6].metrics.halstead.effort
old: 5762.119451210789
new: 474.68720736643496

path: .spaces[6].metrics.halstead.n2
old: 25.0
new: 6.0

path: .spaces[6].metrics.halstead.volume
old: 540.5365338846893
new: 70.32403072095333

path: .spaces[6].metrics.halstead.bugs
old: 0.10713554504052876
new: 0.020283851878826063

path: .spaces[6].metrics.halstead.N2
old: 41.0
new: 9.0

path: .spaces[6].metrics.halstead.n1
old: 13.0
new: 9.0

path: .spaces[6].metrics.halstead.vocabulary
old: 38.0
new: 15.0

path: .spaces[6].metrics.halstead.purity_ratio
old: 1.5941953502932265
new: 2.446616667628208

path: .spaces[6].metrics.halstead.difficulty
old: 10.66
new: 6.75

path: .spaces[6].metrics.halstead.N1
old: 62.0
new: 9.0

path: .spaces[6].metrics.halstead.time
old: 320.11774728948825
new: 26.371511520357497

path: .spaces[6].metrics.halstead.length
old: 103.0
new: 18.0

path: .spaces[6].metrics.loc.blank
old: 1.0
new: 0.0

path: .spaces[6].metrics.loc.sloc
old: 17.0
new: 5.0

path: .spaces[6].metrics.loc.lloc
old: 8.0
new: 1.0

path: .spaces[6].metrics.loc.cloc
old: 1.0
new: 2.0

path: .spaces[6].metrics.loc.ploc
old: 15.0
new: 3.0

path: .spaces[6].metrics.cognitive.sum
old: 4.0
new: 0.0

path: .spaces[6].metrics.cognitive.average
old: 4.0
new: 0.0

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

path: .spaces[6].metrics.nexits.average
old: 2.0
new: 1.0

Code

static inline bool TimestampIsNewerThan(guint32 a, guint32 b) {
  // Timestamps are just the least significant bits of a monotonically
  // increasing function, and so the use of unsigned overflow arithmetic.
  return a - b <= G_MAXUINT32 / 2;
}

Minimal test - lines (570, 577)

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

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

path: .spaces[11].metrics.halstead.effort
old: 188.2105312878607
new: 750.1229943568355

path: .spaces[11].metrics.halstead.estimated_program_length
old: 31.019550008653873
new: 44.82892142331043

path: .spaces[11].metrics.halstead.time
old: 10.456140627103371
new: 41.673499686490864

path: .spaces[11].metrics.halstead.N1
old: 8.0
new: 16.0

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

path: .spaces[11].metrics.halstead.n1
old: 6.0
new: 10.0

path: .spaces[11].metrics.halstead.bugs
old: 0.010947325359591292
new: 0.027519068609818505

path: .spaces[11].metrics.halstead.volume
old: 53.77443751081734
new: 93.76537429460444

path: .spaces[11].metrics.halstead.vocabulary
old: 12.0
new: 15.0

path: .spaces[11].metrics.halstead.n2
old: 6.0
new: 5.0

path: .spaces[11].metrics.halstead.level
old: 0.2857142857142857
new: 0.125

path: .spaces[11].metrics.halstead.length
old: 15.0
new: 24.0

path: .spaces[11].metrics.halstead.purity_ratio
old: 2.067970000576925
new: 1.867871725971268

path: .spaces[11].metrics.halstead.difficulty
old: 3.5
new: 8.0

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

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

path: .spaces[11].metrics.nargs.average
old: 1.0
new: 0.0

path: .spaces[11].metrics.nargs.sum
old: 1.0
new: 0.0

path: .spaces[11].metrics.nexits.average
old: 1.0
new: 0.0

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

path: .spaces[11].metrics.mi.mi_visual_studio
old: 77.34007614346245
new: 66.08825127286867

path: .spaces[11].metrics.mi.mi_original
old: 132.2515302053208
new: 113.01090967660544

path: .spaces[11].metrics.mi.mi_sei
old: 115.19959464458498
new: 87.64488654298987

path: .spaces[11].metrics.loc.sloc
old: 3.0
new: 8.0

path: .spaces[11].metrics.loc.ploc
old: 3.0
new: 8.0

path: .spaces[11].metrics.loc.lloc
old: 1.0
new: 3.0

Code

void nsWindow::ReleaseGlobals() {
  for (auto& cursor : gCursorCache) {
    if (cursor) {
      g_object_unref(cursor);
      cursor = nullptr;
    }
  }
}

Minimal test - lines (422, 433)

path: .spaces[7].metrics.loc.lloc
old: 10.0
new: 5.0

path: .spaces[7].metrics.loc.ploc
old: 24.0
new: 10.0

path: .spaces[7].metrics.loc.blank
old: 3.0
new: 2.0

path: .spaces[7].metrics.loc.sloc
old: 29.0
new: 12.0

path: .spaces[7].metrics.loc.cloc
old: 2.0
new: 0.0

path: .spaces[7].metrics.mi.mi_visual_studio
old: 46.87336838723804
new: 59.32412542462863

path: .spaces[7].metrics.mi.mi_sei
old: 60.43426108813325
new: 70.95773044556974

path: .spaces[7].metrics.mi.mi_original
old: 80.15345994217705
new: 101.44425447611496

path: .spaces[7].metrics.nargs.sum
old: 3.0
new: 1.0

path: .spaces[7].metrics.nargs.average
old: 3.0
new: 1.0

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

path: .spaces[7].metrics.cyclomatic.average
old: 7.0
new: 3.0

path: .spaces[7].metrics.halstead.volume
old: 788.7516169382245
new: 245.1751010249378

path: .spaces[7].metrics.halstead.level
old: 0.06352459016393443
new: 0.12698412698412698

path: .spaces[7].metrics.halstead.effort
old: 12416.477066640438
new: 1930.7539205713852

path: .spaces[7].metrics.halstead.time
old: 689.8042814800243
new: 107.26410669841027

path: .spaces[7].metrics.halstead.N1
old: 81.0
new: 30.0

path: .spaces[7].metrics.halstead.difficulty
old: 15.741935483870968
new: 7.875

path: .spaces[7].metrics.halstead.N2
old: 61.0
new: 21.0

path: .spaces[7].metrics.halstead.length
old: 142.0
new: 51.0

path: .spaces[7].metrics.halstead.n2
old: 31.0
new: 16.0

path: .spaces[7].metrics.halstead.bugs
old: 0.17873557663179565
new: 0.05168486213938857

path: .spaces[7].metrics.halstead.n1
old: 16.0
new: 12.0

path: .spaces[7].metrics.halstead.vocabulary
old: 47.0
new: 28.0

path: .spaces[7].metrics.halstead.estimated_program_length
old: 217.5800856219931
new: 107.01955000865388

path: .spaces[7].metrics.halstead.purity_ratio
old: 1.5322541240985432
new: 2.0984225491892916

path: .spaces[7].metrics.cognitive.average
old: 9.0
new: 2.0

path: .spaces[7].metrics.cognitive.sum
old: 9.0
new: 2.0

Code

static void UpdateLastInputEventTime(void* aGdkEvent) {
  nsCOMPtr idleService =
      do_GetService("@mozilla.org/widget/useridleservice;1");
  if (idleService) {
    idleService->ResetIdleTimeOut(0);
  }

  guint timestamp = gdk_event_get_time(static_cast(aGdkEvent));
  if (timestamp == GDK_CURRENT_TIME) return;

  sLastUserInputTime = timestamp;
}

Minimal test - lines (408, 414)

path: .spaces[5].metrics.mi.mi_original
old: 90.61801522998208
new: 115.85542823210044

path: .spaces[5].metrics.mi.mi_visual_studio
old: 52.99299136256262
new: 67.75171241643302

path: .spaces[5].metrics.mi.mi_sei
old: 83.67271230285255
new: 91.54501963791024

path: .spaces[5].metrics.cyclomatic.sum
old: 4.0
new: 1.0

path: .spaces[5].metrics.cyclomatic.average
old: 4.0
new: 1.0

path: .spaces[5].metrics.halstead.difficulty
old: 12.952380952380953
new: 5.142857142857143

path: .spaces[5].metrics.halstead.effort
old: 4962.040414615992
new: 462.1293447376934

path: .spaces[5].metrics.halstead.n1
old: 17.0
new: 8.0

path: .spaces[5].metrics.halstead.level
old: 0.07720588235294118
new: 0.1944444444444444

path: .spaces[5].metrics.halstead.n2
old: 21.0
new: 7.0

path: .spaces[5].metrics.halstead.vocabulary
old: 38.0
new: 15.0

path: .spaces[5].metrics.halstead.length
old: 73.0
new: 23.0

path: .spaces[5].metrics.halstead.volume
old: 383.0987084813817
new: 89.85848369899593

path: .spaces[5].metrics.halstead.N1
old: 41.0
new: 14.0

path: .spaces[5].metrics.halstead.N2
old: 32.0
new: 9.0

path: .spaces[5].metrics.halstead.bugs
old: 0.09697332273821672
new: 0.01992451581305973

path: .spaces[5].metrics.halstead.estimated_program_length
old: 161.72553417960972
new: 43.65148445440323

path: .spaces[5].metrics.halstead.purity_ratio
old: 2.21541827643301
new: 1.8978906284523145

path: .spaces[5].metrics.halstead.time
old: 275.66891192311067
new: 25.67385248542741

path: .spaces[5].metrics.cognitive.average
old: 2.0
new: 0.0

path: .spaces[5].metrics.cognitive.sum
old: 2.0
new: 0.0

path: .spaces[5].metrics.nargs.average
old: 3.0
new: 1.0

path: .spaces[5].metrics.nargs.sum
old: 3.0
new: 1.0

path: .spaces[5].metrics.nexits.sum
old: 3.0
new: 2.0

path: .spaces[5].metrics.nexits.average
old: 3.0
new: 2.0

path: .spaces[5].metrics.loc.ploc
old: 14.0
new: 7.0

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

path: .spaces[5].metrics.loc.sloc
old: 20.0
new: 7.0

path: .spaces[5].metrics.loc.cloc
old: 3.0
new: 0.0

path: .spaces[5].metrics.loc.lloc
old: 5.0
new: 2.0

Code

static inline int32_t GetBitmapStride(int32_t width) {
#if defined(MOZ_X11)
  return (width + 7) / 8;
#else
  return cairo_format_stride_for_width(CAIRO_FORMAT_A1, width);
#endif
}

Minimal test - lines (596, 602)

path: .spaces[14].metrics.nexits.sum
old: 4.0
new: 0.0

path: .spaces[14].metrics.nexits.average
old: 4.0
new: 0.0

path: .spaces[14].metrics.loc.lloc
old: 28.0
new: 3.0

path: .spaces[14].metrics.loc.cloc
old: 0.0
new: 1.0

path: .spaces[14].metrics.loc.sloc
old: 31.0
new: 7.0

path: .spaces[14].metrics.loc.ploc
old: 31.0
new: 6.0

path: .spaces[14].metrics.mi.mi_visual_studio
old: 44.96226888965814
new: 68.62411273199972

path: .spaces[14].metrics.mi.mi_original
old: 76.88547980131543
new: 117.34723277171952

path: .spaces[14].metrics.mi.mi_sei
old: 37.56330520001619
new: 121.43153564869104

path: .spaces[14].metrics.cyclomatic.average
old: 23.0
new: 2.0

path: .spaces[14].metrics.cyclomatic.sum
old: 23.0
new: 2.0

path: .spaces[14].metrics.halstead.length
old: 112.0
new: 18.0

path: .spaces[14].metrics.halstead.bugs
old: 0.0654703642928532
new: 0.013959922923599755

path: .spaces[14].metrics.halstead.n2
old: 30.0
new: 5.0

path: .spaces[14].metrics.halstead.difficulty
old: 4.65
new: 4.2

path: .spaces[14].metrics.halstead.time
old: 152.9243041990811
new: 15.056842503028854

path: .spaces[14].metrics.halstead.effort
old: 2752.6374755834595
new: 271.0231650545194

path: .spaces[14].metrics.halstead.N1
old: 81.0
new: 12.0

path: .spaces[14].metrics.halstead.purity_ratio
old: 1.5690718114396105
new: 1.7367291627133357

path: .spaces[14].metrics.halstead.volume
old: 591.9650485125719
new: 64.5293250129808

path: .spaces[14].metrics.halstead.estimated_program_length
old: 175.7360428812364
new: 31.26112492884004

path: .spaces[14].metrics.halstead.n1
old: 9.0
new: 7.0

path: .spaces[14].metrics.halstead.N2
old: 31.0
new: 6.0

path: .spaces[14].metrics.halstead.vocabulary
old: 39.0
new: 12.0

path: .spaces[14].metrics.halstead.level
old: 0.2150537634408602
new: 0.23809523809523808

Code

void nsWindow::DispatchDeactivateEvent(void) {
  if (mWidgetListener) mWidgetListener->WindowDeactivated();

#ifdef ACCESSIBILITY
  DispatchDeactivateEventAccessible();
#endif  // ACCESSIBILITY
}

Minimal test - lines (395, 395)

path: .spaces[4].metrics.halstead.N1
old: 18.0
new: 0.0

path: .spaces[4].metrics.halstead.volume
old: 167.17882283189007
new: 0.0

path: .spaces[4].metrics.halstead.N2
old: 18.0
new: 1.0

path: .spaces[4].metrics.halstead.effort
old: 1182.193104311223
new: 0.0

path: .spaces[4].metrics.halstead.n1
old: 11.0
new: 0.0

path: .spaces[4].metrics.halstead.bugs
old: 0.03726813784364824
new: 0.0

path: .spaces[4].metrics.halstead.difficulty
old: 7.071428571428571
new: 0.0

path: .spaces[4].metrics.halstead.length
old: 36.0
new: 1.0

path: .spaces[4].metrics.halstead.level
old: 0.1414141414141414
new: null

path: .spaces[4].metrics.halstead.vocabulary
old: 25.0
new: 1.0

path: .spaces[4].metrics.halstead.n2
old: 14.0
new: 1.0

path: .spaces[4].metrics.halstead.purity_ratio
old: 2.537686575383798
new: null

path: .spaces[4].metrics.halstead.estimated_program_length
old: 91.35671671381672
new: null

path: .spaces[4].metrics.halstead.time
old: 65.67739468395682
new: 0.0

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

path: .spaces[4].metrics.mi.mi_visual_studio
old: 67.32418924964702
new: null

path: .spaces[4].metrics.mi.mi_original
old: 115.1243636168964
new: null

path: .spaces[4].metrics.mi.mi_sei
old: 90.49031634298598
new: null

path: .spaces[4].metrics.loc.sloc
old: 6.0
new: 1.0

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

path: .spaces[4].metrics.loc.ploc
old: 6.0
new: 1.0

path: .spaces[4].metrics.nargs.average
old: 4.0
new: null

path: .spaces[4].metrics.nargs.sum
old: 4.0
new: 0.0

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

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

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

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

Code

typedef struct _GdkDisplay GdkDisplay;

Minimal test - lines (656, 658)

path: .spaces[20].metrics.halstead.N2
old: 69.0
new: 7.0

path: .spaces[20].metrics.halstead.level
old: 0.05475040257648953
new: 0.15873015873015872

path: .spaces[20].metrics.halstead.time
old: 1035.3842788053034
new: 23.986336008962905

path: .spaces[20].metrics.halstead.vocabulary
old: 52.0
new: 14.0

path: .spaces[20].metrics.halstead.volume
old: 1020.3787095472554
new: 68.53238859703687

path: .spaces[20].metrics.halstead.N1
old: 110.0
new: 11.0

path: .spaces[20].metrics.halstead.estimated_program_length
old: 248.03238662847315
new: 40.13896548741762

path: .spaces[20].metrics.halstead.length
old: 179.0
new: 18.0

path: .spaces[20].metrics.halstead.bugs
old: 0.23431214131631337
new: 0.019041581859475663

path: .spaces[20].metrics.halstead.n2
old: 34.0
new: 5.0

path: .spaces[20].metrics.halstead.difficulty
old: 18.264705882352946
new: 6.3

path: .spaces[20].metrics.halstead.n1
old: 18.0
new: 9.0

path: .spaces[20].metrics.halstead.purity_ratio
old: 1.3856557912205203
new: 2.229942527078757

path: .spaces[20].metrics.halstead.effort
old: 18636.91701849546
new: 431.75404816133226

path: .spaces[20].metrics.nargs.sum
old: 7.0
new: 0.0

path: .spaces[20].metrics.nargs.average
old: 7.0
new: 0.0

path: .spaces[20].metrics.cyclomatic.average
old: 5.0
new: 2.0

path: .spaces[20].metrics.cyclomatic.sum
old: 5.0
new: 2.0

path: .spaces[20].metrics.mi.mi_sei
old: 37.61859704015277
new: 113.15029434612242

path: .spaces[20].metrics.mi.mi_original
old: 78.19417585689587
new: 130.7604873328496

path: .spaces[20].metrics.mi.mi_visual_studio
old: 45.72758822040694
new: 76.46812124728048

path: .spaces[20].metrics.nexits.average
old: 2.0
new: 1.0

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

path: .spaces[20].metrics.loc.blank
old: 1.0
new: 0.0

path: .spaces[20].metrics.loc.sloc
old: 31.0
new: 3.0

path: .spaces[20].metrics.loc.ploc
old: 30.0
new: 3.0

path: .spaces[20].metrics.loc.lloc
old: 11.0
new: 1.0

path: .spaces[20].metrics.cognitive.sum
old: 11.0
new: 1.0

path: .spaces[20].metrics.cognitive.average
old: 11.0
new: 1.0

Code

bool nsWindow::AreBoundsSane() {
  return mBounds.width > 0 && mBounds.height > 0;
}

Minimal test - lines (620, 622)

path: .spaces[17].metrics.nexits.average
old: 2.0
new: 1.0

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

path: .spaces[17].metrics.halstead.length
old: 54.0
new: 13.0

path: .spaces[17].metrics.halstead.time
old: 130.25461543185804
new: 12.94569791927084

path: .spaces[17].metrics.halstead.n1
old: 13.0
new: 8.0

path: .spaces[17].metrics.halstead.n2
old: 16.0
new: 4.0

path: .spaces[17].metrics.halstead.estimated_program_length
old: 112.1057163358342
new: 32.0

path: .spaces[17].metrics.halstead.N1
old: 32.0
new: 8.0

path: .spaces[17].metrics.halstead.difficulty
old: 8.9375
new: 5.0

path: .spaces[17].metrics.halstead.N2
old: 22.0
new: 5.0

path: .spaces[17].metrics.halstead.effort
old: 2344.5830777734445
new: 233.02256254687512

path: .spaces[17].metrics.halstead.purity_ratio
old: 2.0760317839969296
new: 2.4615384615384617

path: .spaces[17].metrics.halstead.vocabulary
old: 29.0
new: 12.0

path: .spaces[17].metrics.halstead.volume
old: 262.3309737368889
new: 46.60451250937503

path: .spaces[17].metrics.halstead.bugs
old: 0.05882868797865697
new: 0.012622461688364473

path: .spaces[17].metrics.halstead.level
old: 0.11188811188811187
new: 0.2

path: .spaces[17].metrics.loc.lloc
old: 3.0
new: 1.0

path: .spaces[17].metrics.loc.ploc
old: 11.0
new: 3.0

path: .spaces[17].metrics.loc.sloc
old: 11.0
new: 3.0

path: .spaces[17].metrics.nargs.average
old: 5.0
new: 0.0

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

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

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

path: .spaces[17].metrics.mi.mi_original
old: 102.73214036235896
new: 132.76565459225228

path: .spaces[17].metrics.mi.mi_sei
old: 72.71393716748041
new: 116.04313920741556

path: .spaces[17].metrics.mi.mi_visual_studio
old: 60.077275065707
new: 77.64073367967968

Code

nsIWidgetListener* nsWindow::GetListener() {
  return mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener;
}

Minimal test - lines (579, 583)

path: .spaces[12].metrics.loc.ploc
old: 10.0
new: 5.0

path: .spaces[12].metrics.loc.lloc
old: 5.0
new: 3.0

path: .spaces[12].metrics.loc.sloc
old: 10.0
new: 5.0

path: .spaces[12].metrics.halstead.length
old: 40.0
new: 23.0

path: .spaces[12].metrics.halstead.N1
old: 23.0
new: 13.0

path: .spaces[12].metrics.halstead.effort
old: 1469.4555522617031
new: 460.0

path: .spaces[12].metrics.halstead.vocabulary
old: 20.0
new: 16.0

path: .spaces[12].metrics.halstead.volume
old: 172.8771237954945
new: 92.0

path: .spaces[12].metrics.halstead.bugs
old: 0.04308403612801343
new: 0.01986326483600192

path: .spaces[12].metrics.halstead.level
old: 0.1176470588235294
new: 0.2

path: .spaces[12].metrics.halstead.difficulty
old: 8.5
new: 5.0

path: .spaces[12].metrics.halstead.n1
old: 10.0
new: 8.0

path: .spaces[12].metrics.halstead.time
old: 81.63641957009462
new: 25.555555555555557

path: .spaces[12].metrics.halstead.estimated_program_length
old: 66.43856189774725
new: 48.0

path: .spaces[12].metrics.halstead.N2
old: 17.0
new: 10.0

path: .spaces[12].metrics.halstead.purity_ratio
old: 1.660964047443681
new: 2.0869565217391304

path: .spaces[12].metrics.halstead.n2
old: 10.0
new: 8.0

path: .spaces[12].metrics.cognitive.sum
old: 3.0
new: 0.0

path: .spaces[12].metrics.cognitive.average
old: 3.0
new: 0.0

path: .spaces[12].metrics.nexits.average
old: 2.0
new: 0.0

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

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

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

path: .spaces[12].metrics.mi.mi_original
old: 106.2146999031816
new: 121.18380521791258

path: .spaces[12].metrics.mi.mi_sei
old: 77.84002840603021
new: 99.23224269132828

path: .spaces[12].metrics.mi.mi_visual_studio
old: 62.11385959250386
new: 70.86772234965647

Code

void nsWindow::CommonCreate(nsIWidget* aParent, bool aListenForResizes) {
  mParent = aParent;
  mListenForResizes = aListenForResizes;
  mCreated = true;
}

Minimal test - lines (166, 181)

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

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

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

path: .spaces[0].metrics.halstead.difficulty
old: 6.045454545454546
new: 2.727272727272727

path: .spaces[0].metrics.halstead.length
old: 39.0
new: 47.0

path: .spaces[0].metrics.halstead.bugs
old: 0.03295793195259844
new: 0.02377873179994953

path: .spaces[0].metrics.halstead.level
old: 0.16541353383458646
new: 0.3666666666666667

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.4796213399849614
new: 2.257606289574905

path: .spaces[0].metrics.halstead.time
old: 54.619699450710286
new: 33.472828295853226

path: .spaces[0].metrics.halstead.volume
old: 162.62707505625016
new: 220.92066675263132

path: .spaces[0].metrics.halstead.effort
old: 983.1545901127852
new: 602.510909325358

path: .spaces[0].metrics.halstead.N1
old: 20.0
new: 17.0

path: .spaces[0].metrics.halstead.N2
old: 19.0
new: 30.0

path: .spaces[0].metrics.halstead.estimated_program_length
old: 57.70523225941349
new: 106.10749561002054

path: .spaces[0].metrics.halstead.n1
old: 7.0
new: 4.0

path: .spaces[0].metrics.halstead.n2
old: 11.0
new: 22.0

path: .spaces[0].metrics.halstead.vocabulary
old: 18.0
new: 26.0

path: .spaces[0].metrics.mi.mi_sei
old: 87.09464725643119
new: 65.47560020246858

path: .spaces[0].metrics.mi.mi_visual_studio
old: 65.94775740551836
new: 57.18449336350258

path: .spaces[0].metrics.mi.mi_original
old: 112.7706651634364
new: 97.78548365158942

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

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

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

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

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

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

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

Code

struct _GdkEventTouchpadPinch {
  GdkEventType type;
  GdkWindow* window;
  gint8 send_event;
  gint8 phase;
  gint8 n_fingers;
  guint32 time;
  gdouble x;
  gdouble y;
  gdouble dx;
  gdouble dy;
  gdouble angle_delta;
  gdouble scale;
  gdouble x_root, y_root;
  guint state;
};

Minimal test - lines (624, 636)

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

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

path: .spaces[18].metrics.nargs.sum
old: 4.0
new: 2.0

path: .spaces[18].metrics.nargs.average
old: 4.0
new: 2.0

path: .spaces[18].metrics.halstead.n2
old: 15.0
new: 19.0

path: .spaces[18].metrics.halstead.bugs
old: 0.04817174498000614
new: 0.05346214908319005

path: .spaces[18].metrics.halstead.vocabulary
old: 26.0
new: 30.0

path: .spaces[18].metrics.halstead.effort
old: 1737.2825198249477
new: 2031.1944491821575

path: .spaces[18].metrics.halstead.level
old: 0.12987012987012986
new: 0.13286713286713286

path: .spaces[18].metrics.halstead.length
old: 48.0
new: 55.0

path: .spaces[18].metrics.halstead.N2
old: 21.0
new: 26.0

path: .spaces[18].metrics.halstead.estimated_program_length
old: 96.65710673913804
new: 118.76437056043838

path: .spaces[18].metrics.halstead.time
old: 96.51569554583044
new: 112.84413606567544

path: .spaces[18].metrics.halstead.purity_ratio
old: 2.0136897237320426
new: 2.1593521920079706

path: .spaces[18].metrics.halstead.N1
old: 27.0
new: 29.0

path: .spaces[18].metrics.halstead.volume
old: 225.6211064707724
new: 269.8789827584685

path: .spaces[18].metrics.halstead.difficulty
old: 7.7
new: 7.526315789473684

path: .spaces[18].metrics.mi.mi_original
old: 106.99690507119838
new: 99.87835744724156

path: .spaces[18].metrics.mi.mi_sei
old: 103.45241444443334
new: 68.59679870806686

path: .spaces[18].metrics.mi.mi_visual_studio
old: 62.57128951532069
new: 58.40839616797753

path: .spaces[18].metrics.cyclomatic.average
old: 1.0
new: 2.0

path: .spaces[18].metrics.cyclomatic.sum
old: 1.0
new: 2.0

path: .spaces[18].metrics.loc.lloc
old: 1.0
new: 5.0

path: .spaces[18].metrics.loc.ploc
old: 8.0
new: 12.0

path: .spaces[18].metrics.loc.sloc
old: 9.0
new: 13.0

path: .spaces[18].metrics.loc.blank
old: 0.0
new: 1.0

path: .spaces[18].metrics.loc.cloc
old: 1.0
new: 0.0

Code

nsresult nsWindow::DispatchEvent(WidgetGUIEvent* aEvent,
                                 nsEventStatus& aStatus) {
#ifdef DEBUG
  debug_DumpEvent(stdout, aEvent->mWidget, aEvent, "something", 0);
#endif
  aStatus = nsEventStatus_eIgnore;
  nsIWidgetListener* listener = GetListener();
  if (listener) {
    aStatus = listener->HandleEvent(aEvent, mUseAttachedEvents);
  }

  return NS_OK;
}

Minimal test - lines (560, 567)

path: .spaces[10].metrics.nargs.average
old: 1.0
new: 0.0

path: .spaces[10].metrics.nargs.sum
old: 1.0
new: 0.0

path: .spaces[10].metrics.nexits.average
old: 19.0
new: 0.0

path: .spaces[10].metrics.nexits.sum
old: 19.0
new: 0.0

path: .spaces[10].metrics.loc.blank
old: 0.0
new: 2.0

path: .spaces[10].metrics.loc.sloc
old: 43.0
new: 8.0

path: .spaces[10].metrics.loc.lloc
old: 40.0
new: 4.0

path: .spaces[10].metrics.loc.ploc
old: 43.0
new: 6.0

path: .spaces[10].metrics.cyclomatic.sum
old: 20.0
new: 1.0

path: .spaces[10].metrics.cyclomatic.average
old: 20.0
new: 1.0

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

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

path: .spaces[10].metrics.halstead.effort
old: 2643.185667414471
new: 655.697164117242

path: .spaces[10].metrics.halstead.estimated_program_length
old: 239.31111664374467
new: 53.5635228093372

path: .spaces[10].metrics.halstead.length
old: 126.0
new: 25.0

path: .spaces[10].metrics.halstead.vocabulary
old: 48.0
new: 17.0

path: .spaces[10].metrics.halstead.n2
old: 41.0
new: 6.0

path: .spaces[10].metrics.halstead.level
old: 0.26623376623376627
new: 0.15584415584415584

path: .spaces[10].metrics.halstead.time
old: 146.84364818969283
new: 36.42762022873566

path: .spaces[10].metrics.halstead.N2
old: 44.0
new: 7.0

path: .spaces[10].metrics.halstead.difficulty
old: 3.7560975609756095
new: 6.416666666666667

path: .spaces[10].metrics.halstead.purity_ratio
old: 1.899294576537656
new: 2.142540912373488

path: .spaces[10].metrics.halstead.bugs
old: 0.06372314361071095
new: 0.025158280147012026

path: .spaces[10].metrics.halstead.n1
old: 7.0
new: 11.0

path: .spaces[10].metrics.halstead.N1
old: 82.0
new: 18.0

path: .spaces[10].metrics.halstead.volume
old: 703.7052750908657
new: 102.18657103125848

path: .spaces[10].metrics.mi.mi_sei
old: 29.308607882768513
new: 87.45967861380859

path: .spaces[10].metrics.mi.mi_visual_studio
old: 41.74005150579129
new: 66.09572258457224

path: .spaces[10].metrics.mi.mi_original
old: 71.3754880749031
new: 113.02368561961852

Code

nsWindow::~nsWindow() {
  LOG(("nsWindow::~nsWindow() [%p]\n", (void*)this));

  delete[] mTransparencyBitmap;
  mTransparencyBitmap = nullptr;

  Destroy();
}

Minimal test - lines (614, 618)

path: .spaces[16].metrics.nargs.average
old: 5.0
new: 0.0

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

path: .spaces[16].metrics.loc.lloc
old: 1.0
new: 2.0

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

path: .spaces[16].metrics.nexits.average
old: 1.0
new: 0.0

path: .spaces[16].metrics.halstead.difficulty
old: 5.846153846153846
new: 4.0

path: .spaces[16].metrics.halstead.estimated_program_length
old: 72.10571633583419
new: 32.0

path: .spaces[16].metrics.halstead.vocabulary
old: 21.0
new: 12.0

path: .spaces[16].metrics.halstead.N1
old: 21.0
new: 11.0

path: .spaces[16].metrics.halstead.N2
old: 19.0
new: 4.0

path: .spaces[16].metrics.halstead.n2
old: 13.0
new: 4.0

path: .spaces[16].metrics.halstead.effort
old: 1027.126535788264
new: 215.09775004326937

path: .spaces[16].metrics.halstead.volume
old: 175.69269691115042
new: 53.77443751081734

path: .spaces[16].metrics.halstead.time
old: 57.06258532157022
new: 11.949875002403854

path: .spaces[16].metrics.halstead.length
old: 40.0
new: 15.0

path: .spaces[16].metrics.halstead.bugs
old: 0.033933452220236034
new: 0.011966560027609794

path: .spaces[16].metrics.halstead.level
old: 0.17105263157894737
new: 0.25

path: .spaces[16].metrics.halstead.purity_ratio
old: 1.8026429083958544
new: 2.1333333333333333

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

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

path: .spaces[16].metrics.mi.mi_visual_studio
old: 68.90039554944944
new: 72.23166964930512

path: .spaces[16].metrics.mi.mi_sei
old: 94.37883071375032
new: 102.80075201909244

path: .spaces[16].metrics.mi.mi_original
old: 117.81967638955854
new: 123.51615510031176

path: .spaces[16].metrics.cognitive.average
old: 0.0
new: 2.0

path: .spaces[16].metrics.cognitive.sum
old: 0.0
new: 2.0

Code

void nsWindow::MaybeDispatchResized() {
  if (mNeedsDispatchResized && !mIsDestroyed) {
    DispatchResized();
  }
}

Minimal test - lines (308, 311)

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

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

path: .spaces[1].metrics.loc.ploc
old: 12.0
new: 4.0

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

path: .spaces[1].metrics.loc.sloc
old: 12.0
new: 4.0

path: .spaces[1].metrics.mi.mi_original
old: 98.68949829214154
new: 127.12557958253764

path: .spaces[1].metrics.mi.mi_visual_studio
old: 57.71315689598921
new: 74.3424442003144

path: .spaces[1].metrics.mi.mi_sei
old: 66.77981764128413
new: 107.804411101254

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

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

path: .spaces[1].metrics.halstead.length
old: 88.0
new: 17.0

path: .spaces[1].metrics.halstead.purity_ratio
old: 1.7393028412041092
new: 1.6265579090825428

path: .spaces[1].metrics.halstead.N2
old: 41.0
new: 7.0

path: .spaces[1].metrics.halstead.vocabulary
old: 36.0
new: 11.0

path: .spaces[1].metrics.halstead.difficulty
old: 10.25
new: 6.125

path: .spaces[1].metrics.halstead.volume
old: 454.9534001269235
new: 58.81033751683405

path: .spaces[1].metrics.halstead.level
old: 0.0975609756097561
new: 0.16326530612244897

path: .spaces[1].metrics.halstead.N1
old: 47.0
new: 10.0

path: .spaces[1].metrics.halstead.n1
old: 12.0
new: 7.0

path: .spaces[1].metrics.halstead.estimated_program_length
old: 153.0586500259616
new: 27.651484454403228

path: .spaces[1].metrics.halstead.time
old: 259.070686183387
new: 20.011850960589367

path: .spaces[1].metrics.halstead.bugs
old: 0.0930406206823999
new: 0.016875316306302828

path: .spaces[1].metrics.halstead.n2
old: 24.0
new: 4.0

path: .spaces[1].metrics.halstead.effort
old: 4663.272351300966
new: 360.2133172906086

Code

static SystemTimeConverter& TimeConverter() {
  static SystemTimeConverter sTimeConverterSingleton;
  return sTimeConverterSingleton;
}

Minimal test - lines (468, 558)

path: .spaces[9].metrics.loc.cloc
old: 0.0
new: 5.0

path: .spaces[9].metrics.loc.blank
old: 0.0
new: 15.0

path: .spaces[9].metrics.loc.sloc
old: 6.0
new: 91.0

path: .spaces[9].metrics.loc.ploc
old: 6.0
new: 71.0

path: .spaces[9].metrics.loc.lloc
old: 3.0
new: 57.0

path: .spaces[9].metrics.cyclomatic.average
old: 2.0
new: 3.0

path: .spaces[9].metrics.cyclomatic.sum
old: 2.0
new: 3.0

path: .spaces[9].metrics.nargs.average
old: 2.0
new: 0.0

path: .spaces[9].metrics.nargs.sum
old: 2.0
new: 0.0

path: .spaces[9].metrics.halstead.N2
old: 14.0
new: 131.0

path: .spaces[9].metrics.halstead.n1
old: 11.0
new: 12.0

path: .spaces[9].metrics.halstead.vocabulary
old: 19.0
new: 95.0

path: .spaces[9].metrics.halstead.n2
old: 8.0
new: 83.0

path: .spaces[9].metrics.halstead.purity_ratio
old: 2.0017338001616216
new: 2.1112465786363415

path: .spaces[9].metrics.halstead.difficulty
old: 9.625
new: 9.46987951807229

path: .spaces[9].metrics.halstead.length
old: 31.0
new: 271.0

path: .spaces[9].metrics.halstead.time
old: 70.41529843465166
new: 936.6925459893856

path: .spaces[9].metrics.halstead.volume
old: 131.68575291675114
new: 1780.430869857687

path: .spaces[9].metrics.halstead.bugs
old: 0.03903957653393936
new: 0.2191753917581566

path: .spaces[9].metrics.halstead.level
old: 0.1038961038961039
new: 0.10559796437659032

path: .spaces[9].metrics.halstead.effort
old: 1267.4753718237298
new: 16860.46582780894

path: .spaces[9].metrics.halstead.estimated_program_length
old: 62.05374780501027
new: 572.1478228104486

path: .spaces[9].metrics.halstead.N1
old: 17.0
new: 140.0

path: .spaces[9].metrics.nexits.average
old: 1.0
new: 0.0

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

path: .spaces[9].metrics.cognitive.average
old: 1.0
new: 3.0

path: .spaces[9].metrics.cognitive.sum
old: 1.0
new: 3.0

path: .spaces[9].metrics.mi.mi_visual_studio
old: 67.91539227522998
new: 34.10181314662344

path: .spaces[9].metrics.mi.mi_original
old: 116.13532079064323
new: 58.31410048072608

path: .spaces[9].metrics.mi.mi_sei
old: 92.05063910350614
new: 26.49446888373812

Code

nsWindow::nsWindow() {
  mIsTopLevel = false;
  mIsDestroyed = false;
  mListenForResizes = false;
  mNeedsDispatchResized = false;
  mIsShown = false;
  mNeedsShow = false;
  mEnabled = true;
  mCreated = false;
  mHandleTouchEvent = false;
  mIsDragPopup = false;
  mIsX11Display = gfxPlatformGtk::GetPlatform()->IsX11Display();

  mContainer = nullptr;
  mGdkWindow = nullptr;
  mShell = nullptr;
  mCompositorWidgetDelegate = nullptr;
  mHasMappedToplevel = false;
  mRetryPointerGrab = false;
  mWindowType = eWindowType_child;
  mSizeState = nsSizeMode_Normal;
  mBoundsAreValid = true;
  mAspectRatio = 0.0f;
  mAspectRatioSaved = 0.0f;
  mLastSizeMode = nsSizeMode_Normal;
  mSizeConstraints.mMaxSize = GetSafeWindowSize(mSizeConstraints.mMaxSize);

#ifdef MOZ_X11
  mOldFocusWindow = 0;

  mXDisplay = nullptr;
  mXWindow = X11None;
  mXVisual = nullptr;
  mXDepth = 0;
#endif /* MOZ_X11 */

#ifdef MOZ_WAYLAND
  mNeedsCompositorResume = false;
  mCompositorInitiallyPaused = false;
#endif
  mWaitingForMoveToRectCB = false;
  mPendingSizeRect = LayoutDeviceIntRect(0, 0, 0, 0);

  if (!gGlobalsInitialized) {
    gGlobalsInitialized = true;

    // It's OK if either of these fail, but it may not be one day.
    initialize_prefs();

#ifdef MOZ_WAYLAND
    // Wayland provides clipboard data to application on focus-in event
    // so we need to init our clipboard hooks before we create window
    // and get focus.
    if (!mIsX11Display) {
      nsCOMPtr clipboard =
          do_GetService("@mozilla.org/widget/clipboard;1");
      NS_ASSERTION(clipboard, "Failed to init clipboard!");
    }
#endif
  }

  mLastMotionPressure = 0;

#ifdef ACCESSIBILITY
  mRootAccessible = nullptr;
#endif

  mIsTransparent = false;
  mTransparencyBitmap = nullptr;
  mTransparencyBitmapForTitlebar = false;

  mTransparencyBitmapWidth = 0;
  mTransparencyBitmapHeight = 0;

  mLastScrollEventTime = GDK_CURRENT_TIME;

  mPendingConfigures = 0;
  mGtkWindowDecoration = GTK_DECORATION_NONE;
  mDrawToContainer = false;
  mDrawInTitlebar = false;
  mTitlebarBackdropState = false;

  mHasAlphaVisual = false;
  mIsPIPWindow = false;
  mAlwaysOnTop = false;

  mWindowScaleFactorChanged = true;
  mWindowScaleFactor = 1;

  mCompositedScreen = gdk_screen_is_composited(gdk_screen_get_default());
}

Minimal test - lines (435, 466)

path: .spaces[8].metrics.halstead.N2
old: 19.0
new: 39.0

path: .spaces[8].metrics.halstead.bugs
old: 0.047672922859903384
new: 0.16627592214025705

path: .spaces[8].metrics.halstead.effort
old: 1710.3679566647215
new: 11141.045031868496

path: .spaces[8].metrics.halstead.n1
old: 12.0
new: 15.0

path: .spaces[8].metrics.halstead.purity_ratio
old: 2.1696491986782873
new: 1.0360104395141938

path: .spaces[8].metrics.halstead.time
old: 95.02044203692896
new: 618.9469462149165

path: .spaces[8].metrics.halstead.estimated_program_length
old: 91.12526634448808
new: 106.70907526996196

path: .spaces[8].metrics.halstead.level
old: 0.11403508771929824
new: 0.044444444444444446

path: .spaces[8].metrics.halstead.vocabulary
old: 25.0
new: 28.0

path: .spaces[8].metrics.halstead.length
old: 42.0
new: 103.0

path: .spaces[8].metrics.halstead.volume
old: 195.0419599705384
new: 495.1575569719331

path: .spaces[8].metrics.halstead.difficulty
old: 8.76923076923077
new: 22.5

path: .spaces[8].metrics.halstead.N1
old: 23.0
new: 64.0

path: .spaces[8].metrics.mi.mi_visual_studio
old: 65.26054916291992
new: 47.62556908110959

path: .spaces[8].metrics.mi.mi_original
old: 111.59553906859308
new: 81.4397231286974

path: .spaces[8].metrics.mi.mi_sei
old: 85.50111852638597
new: 68.33814696978752

path: .spaces[8].metrics.nargs.average
old: 2.0
new: 3.0

path: .spaces[8].metrics.nargs.sum
old: 2.0
new: 3.0

path: .spaces[8].metrics.cognitive.sum
old: 1.0
new: 5.0

path: .spaces[8].metrics.cognitive.average
old: 1.0
new: 5.0

path: .spaces[8].metrics.cyclomatic.average
old: 2.0
new: 5.0

path: .spaces[8].metrics.cyclomatic.sum
old: 2.0
new: 5.0

path: .spaces[8].metrics.loc.sloc
old: 7.0
new: 32.0

path: .spaces[8].metrics.loc.lloc
old: 3.0
new: 13.0

path: .spaces[8].metrics.loc.blank
old: 0.0
new: 4.0

path: .spaces[8].metrics.loc.cloc
old: 0.0
new: 4.0

path: .spaces[8].metrics.loc.ploc
old: 7.0
new: 24.0

Code

void GetWindowOrigin(GdkWindow* aWindow, int* aX, int* aY) {
  if (aWindow) {
    gdk_window_get_origin(aWindow, aX, aY);
  }

  // TODO(bug 1655924): gdk_window_get_origin is can block waiting for the x
  // server for a long time, we would like to use the implementation below
  // instead. However, removing the synchronous x server queries causes a race
  // condition to surface, causing issues such as bug 1652743 and bug 1653711.
#if 0
  *aX = 0;
  *aY = 0;
  if (!aWindow) {
    return;
  }

  GdkWindow* current = aWindow;
  while (GdkWindow* parent = gdk_window_get_parent(current)) {
    if (parent == current) {
      break;
    }

    int x = 0;
    int y = 0;
    gdk_window_get_position(current, &x, &y);
    *aX += x;
    *aY += y;

    current = parent;
  }
#endif
}