# Global Metrics

path: .metrics.cognitive.average
old: 1.75
new: 1.4333333333333331
path: .metrics.cognitive.sum
old: 7.0
new: 43.0
path: .metrics.nargs.average
old: 0.75
new: 1.2666666666666666
path: .metrics.nargs.sum
old: 3.0
new: 38.0
path: .metrics.loc.blank
old: 52.0
new: 93.0
path: .metrics.loc.lloc
old: 126.0
new: 179.0
path: .metrics.loc.cloc
old: 24.0
new: 76.0
path: .metrics.loc.ploc
old: 223.0
new: 416.0
path: .metrics.loc.sloc
old: 299.0
new: 585.0
path: .metrics.nexits.average
old: 2.25
new: 0.8333333333333334
path: .metrics.nexits.sum
old: 9.0
new: 25.0
path: .metrics.halstead.estimated_program_length
old: 747.3129132339992
new: 1861.8121103538963
path: .metrics.halstead.vocabulary
old: 118.0
new: 249.0
path: .metrics.halstead.N2
old: 883.0
new: 986.0
path: .metrics.halstead.bugs
old: 2.986086662185879
new: 3.4256249829710796
path: .metrics.halstead.volume
old: 13187.144082577288
new: 18124.92439931902
path: .metrics.halstead.length
old: 1916.0
new: 2277.0
path: .metrics.halstead.effort
old: 847882.1522996902
new: 1041817.4033653416
path: .metrics.halstead.level
old: 0.015553038882597209
new: 0.0173974098923389
path: .metrics.halstead.purity_ratio
old: 0.3900380549237992
new: 0.8176601275159844
path: .metrics.halstead.n2
old: 103.0
new: 223.0
path: .metrics.halstead.time
old: 47104.564016649456
new: 57878.74463140787
path: .metrics.halstead.n1
old: 15.0
new: 26.0
path: .metrics.halstead.N1
old: 1033.0
new: 1291.0
path: .metrics.halstead.difficulty
old: 64.29611650485437
new: 57.47982062780269
path: .metrics.mi.mi_visual_studio
old: 15.397909980481382
new: 0.0
path: .metrics.mi.mi_original
old: 26.33042606662316
new: -3.9063371300951246
path: .metrics.mi.mi_sei
old: -15.14275920682294
new: -45.6818180265391
path: .metrics.nom.functions
old: 4.0
new: 30.0
path: .metrics.nom.total
old: 4.0
new: 30.0
path: .metrics.cyclomatic.average
old: 2.6
new: 2.0454545454545454
path: .metrics.cyclomatic.sum
old: 13.0
new: 90.0

# Spaces Data

## Minimal test - lines (96, 99)

path: .spaces[0].metrics.mi.mi_sei
old: 84.12352812103481
new: 102.52060683450112
path: .spaces[0].metrics.mi.mi_original
old: 110.49951386621508
new: 123.46312555240723
path: .spaces[0].metrics.mi.mi_visual_studio
old: 64.61959875217256
new: 72.200658217782
path: .spaces[0].metrics.halstead.effort
old: 2204.183328392555
new: 695.8105267020592
path: .spaces[0].metrics.halstead.N2
old: 20.0
new: 13.0
path: .spaces[0].metrics.halstead.level
old: 0.1
new: 0.17094017094017094
path: .spaces[0].metrics.halstead.N1
old: 31.0
new: 15.0
path: .spaces[0].metrics.halstead.difficulty
old: 10.0
new: 5.85
path: .spaces[0].metrics.halstead.time
old: 122.45462935514192
new: 38.65614037233662
path: .spaces[0].metrics.halstead.estimated_program_length
old: 66.43856189774725
new: 61.74860596185444
path: .spaces[0].metrics.halstead.volume
old: 220.4183328392555
new: 118.9419703764204
path: .spaces[0].metrics.halstead.bugs
old: 0.05645605845513819
new: 0.02617415933157984
path: .spaces[0].metrics.halstead.n1
old: 10.0
new: 9.0
path: .spaces[0].metrics.halstead.vocabulary
old: 20.0
new: 19.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.3027168999558283
new: 2.2053073557805156
path: .spaces[0].metrics.halstead.length
old: 51.0
new: 28.0
path: .spaces[0].metrics.loc.sloc
old: 7.0
new: 4.0
path: .spaces[0].metrics.loc.ploc
old: 7.0
new: 4.0
path: .spaces[0].metrics.loc.lloc
old: 3.0
new: 1.0
path: .spaces[0].metrics.cyclomatic.average
old: 4.0
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 4.0
new: 1.0
path: .spaces[0].metrics.cognitive.sum
old: 2.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 2.0
new: 0.0

### Code

    static nsWindow* moz_container_get_nsWindow(MozContainer* container) {
      gpointer user_data = g_object_get_data(G_OBJECT(container), "nsWindow");
      return static_cast(user_data);
    }

## Minimal test - lines (106, 118)

path: .spaces[1].metrics.cognitive.average
old: 2.0
new: 1.0
path: .spaces[1].metrics.cognitive.sum
old: 2.0
new: 1.0
path: .spaces[1].metrics.mi.mi_visual_studio
old: 32.634849144046804
new: 57.91628727686124
path: .spaces[1].metrics.mi.mi_original
old: 55.80559203632003
new: 99.03685124343272
path: .spaces[1].metrics.mi.mi_sei
old: 27.87072735289907
new: 67.38276188095458
path: .spaces[1].metrics.loc.blank
old: 15.0
new: 2.0
path: .spaces[1].metrics.loc.sloc
old: 86.0
new: 13.0
path: .spaces[1].metrics.loc.lloc
old: 37.0
new: 5.0
path: .spaces[1].metrics.loc.ploc
old: 63.0
new: 11.0
path: .spaces[1].metrics.loc.cloc
old: 8.0
new: 0.0
path: .spaces[1].metrics.cyclomatic.sum
old: 3.0
new: 2.0
path: .spaces[1].metrics.cyclomatic.average
old: 3.0
new: 2.0
path: .spaces[1].metrics.nexits.sum
old: 3.0
new: 1.0
path: .spaces[1].metrics.nexits.average
old: 3.0
new: 1.0
path: .spaces[1].metrics.halstead.level
old: 0.032200357781753126
new: 0.11447811447811448
path: .spaces[1].metrics.halstead.time
old: 5934.151750565316
new: 153.97675029766853
path: .spaces[1].metrics.halstead.bugs
old: 0.7504115572216943
new: 0.06577040483082142
path: .spaces[1].metrics.halstead.N1
old: 309.0
new: 39.0
path: .spaces[1].metrics.halstead.n2
old: 54.0
new: 17.0
path: .spaces[1].metrics.halstead.effort
old: 106814.7315101757
new: 2771.5815053580336
path: .spaces[1].metrics.halstead.N2
old: 258.0
new: 27.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 0.6329270572357345
new: 1.6294032743373643
path: .spaces[1].metrics.halstead.length
old: 567.0
new: 66.0
path: .spaces[1].metrics.halstead.estimated_program_length
old: 358.8696414526615
new: 107.54061610626604
path: .spaces[1].metrics.halstead.volume
old: 3439.472570989557
new: 317.28542485580186
path: .spaces[1].metrics.halstead.vocabulary
old: 67.0
new: 28.0
path: .spaces[1].metrics.halstead.n1
old: 13.0
new: 11.0
path: .spaces[1].metrics.halstead.difficulty
old: 31.055555555555557
new: 8.735294117647058

### Code

    static void moz_container_wayland_invalidate(MozContainer* container) {
      LOGWAYLAND(("moz_container_wayland_invalidate [%p]\n", (void*)container));

      GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container));
      if (!window) {
        LOGWAYLAND(("    Failed - missing GdkWindow!\n"));
        return;
      }

      GdkRectangle rect = (GdkRectangle){0, 0, gdk_window_get_width(window),
                                         gdk_window_get_height(window)};
      gdk_window_invalidate_rect(window, &rect, true);
    }

## Minimal test - lines (120, 136)

path: .spaces[2].metrics.halstead.difficulty
old: 36.57627118644068
new: 16.5
path: .spaces[2].metrics.halstead.N1
old: 396.0
new: 45.0
path: .spaces[2].metrics.halstead.level
old: 0.027340129749768304
new: 0.06060606060606061
path: .spaces[2].metrics.halstead.n2
old: 59.0
new: 13.0
path: .spaces[2].metrics.halstead.bugs
old: 0.9998907267169502
new: 0.1106683499646584
path: .spaces[2].metrics.halstead.effort
old: 164289.8348384052
new: 6049.465917247585
path: .spaces[2].metrics.halstead.purity_ratio
old: 0.5428319453958556
new: 1.2334799060470307
path: .spaces[2].metrics.halstead.volume
old: 4491.705401050003
new: 366.63429801500513
path: .spaces[2].metrics.halstead.estimated_program_length
old: 395.1816562481828
new: 96.2114326716684
path: .spaces[2].metrics.halstead.length
old: 728.0
new: 78.0
path: .spaces[2].metrics.halstead.vocabulary
old: 72.0
new: 26.0
path: .spaces[2].metrics.halstead.time
old: 9127.213046578066
new: 336.08143984708806
path: .spaces[2].metrics.halstead.N2
old: 332.0
new: 33.0
path: .spaces[2].metrics.nexits.average
old: 3.0
new: 1.0
path: .spaces[2].metrics.nexits.sum
old: 3.0
new: 1.0
path: .spaces[2].metrics.loc.ploc
old: 80.0
new: 14.0
path: .spaces[2].metrics.loc.blank
old: 16.0
new: 3.0
path: .spaces[2].metrics.loc.cloc
old: 8.0
new: 0.0
path: .spaces[2].metrics.loc.sloc
old: 104.0
new: 17.0
path: .spaces[2].metrics.loc.lloc
old: 46.0
new: 6.0
path: .spaces[2].metrics.mi.mi_visual_studio
old: 30.022766803720373
new: 54.80072889372491
path: .spaces[2].metrics.mi.mi_sei
old: 19.49952124397602
new: 59.79847266485311
path: .spaces[2].metrics.mi.mi_original
old: 51.33893123436184
new: 93.7092464082696
path: .spaces[2].metrics.nargs.average
old: 1.0
new: 3.0
path: .spaces[2].metrics.nargs.sum
old: 1.0
new: 3.0

### Code

    static void moz_container_wayland_move_locked(MozContainer* container, int dx,
                                                  int dy) {
      LOGWAYLAND(
          ("moz_container_wayland_move [%p] %d,%d\n", (void*)container, dx, dy));

      MozContainerWayland* wl_container = &container->wl_container;

      if (wl_container->subsurface_dx == dx && wl_container->subsurface_dy == dy) {
        return;
      }

      wl_container->subsurface_dx = dx;
      wl_container->subsurface_dy = dy;
      wl_subsurface_set_position(wl_container->subsurface,
                                 wl_container->subsurface_dx,
                                 wl_container->subsurface_dy);
    }

## Minimal test - lines (142, 149)

path: .spaces[3].metrics.halstead.volume
old: 3312.0846979899434
new: 226.17809780285063
path: .spaces[3].metrics.halstead.length
old: 546.0
new: 50.0
path: .spaces[3].metrics.halstead.N2
old: 258.0
new: 22.0
path: .spaces[3].metrics.halstead.effort
old: 93220.1293179715
new: 1913.8146737164288
path: .spaces[3].metrics.halstead.n2
old: 55.0
new: 13.0
path: .spaces[3].metrics.halstead.difficulty
old: 28.145454545454545
new: 8.461538461538462
path: .spaces[3].metrics.halstead.estimated_program_length
old: 360.99433425251016
new: 81.32499728470782
path: .spaces[3].metrics.halstead.level
old: 0.0355297157622739
new: 0.11818181818181818
path: .spaces[3].metrics.halstead.n1
old: 12.0
new: 10.0
path: .spaces[3].metrics.halstead.vocabulary
old: 67.0
new: 23.0
path: .spaces[3].metrics.halstead.N1
old: 288.0
new: 28.0
path: .spaces[3].metrics.halstead.time
old: 5178.896073220639
new: 106.32303742869048
path: .spaces[3].metrics.halstead.bugs
old: 0.6853070706284227
new: 0.0513821175884944
path: .spaces[3].metrics.halstead.purity_ratio
old: 0.6611617843452567
new: 1.6264999456941565
path: .spaces[3].metrics.nargs.average
old: 1.0
new: 3.0
path: .spaces[3].metrics.nargs.sum
old: 1.0
new: 3.0
path: .spaces[3].metrics.loc.ploc
old: 61.0
new: 8.0
path: .spaces[3].metrics.loc.sloc
old: 77.0
new: 8.0
path: .spaces[3].metrics.loc.cloc
old: 2.0
new: 0.0
path: .spaces[3].metrics.loc.blank
old: 14.0
new: 0.0
path: .spaces[3].metrics.loc.lloc
old: 37.0
new: 2.0
path: .spaces[3].metrics.mi.mi_original
old: 58.02262010710794
new: 108.66216881680285
path: .spaces[3].metrics.mi.mi_sei
old: 20.566192000122577
new: 81.26915981103699
path: .spaces[3].metrics.mi.mi_visual_studio
old: 33.93135678778242
new: 63.54512796304259
path: .spaces[3].metrics.nexits.sum
old: 2.0
new: 0.0
path: .spaces[3].metrics.nexits.average
old: 2.0
new: 0.0

### Code

    void moz_container_wayland_egl_window_set_size(MozContainer* container,
                                                   int width, int height) {
      MozContainerWayland* wl_container = &container->wl_container;
      MutexAutoLock lock(*wl_container->container_lock);
      if (wl_container->eglwindow) {
        wl_egl_window_resize(wl_container->eglwindow, width, height, 0, 0);
      }
    }