# Global Metrics

path: .metrics.cognitive.average
old: 8.0
new: 0.07692307692307693
path: .metrics.cognitive.sum
old: 8.0
new: 1.0
path: .metrics.cyclomatic.sum
old: 10.0
new: 23.0
path: .metrics.cyclomatic.average
old: 5.0
new: 1.0454545454545454
path: .metrics.mi.mi_sei
old: 37.3714740450308
new: 19.11091451509901
path: .metrics.mi.mi_original
old: 49.31600045735124
new: 45.67929461794715
path: .metrics.mi.mi_visual_studio
old: 28.839766349328208
new: 26.713037788273187
path: .metrics.nexits.sum
old: 1.0
new: 13.0
path: .metrics.halstead.estimated_program_length
old: 314.3686449376554
new: 674.7347109918256
path: .metrics.halstead.difficulty
old: 12.95744680851064
new: 13.24468085106383
path: .metrics.halstead.n2
old: 47.0
new: 94.0
path: .metrics.halstead.effort
old: 10835.457115727397
new: 36394.83117707439
path: .metrics.halstead.time
old: 601.969839762633
new: 2021.9350653930217
path: .metrics.halstead.vocabulary
old: 61.0
new: 109.0
path: .metrics.halstead.bugs
old: 0.1632213267472203
new: 0.366076528792872
path: .metrics.halstead.level
old: 0.07717569786535304
new: 0.07550200803212852
path: .metrics.halstead.purity_ratio
old: 2.2295648577138683
new: 1.66190815515228
path: .metrics.halstead.N2
old: 87.0
new: 166.0
path: .metrics.halstead.volume
old: 836.2339645963671
new: 2747.882835859432
path: .metrics.halstead.length
old: 141.0
new: 406.0
path: .metrics.halstead.n1
old: 14.0
new: 15.0
path: .metrics.halstead.N1
old: 54.0
new: 240.0
path: .metrics.loc.cloc
old: 70.0
new: 17.0
path: .metrics.loc.lloc
old: 1.0
new: 16.0
path: .metrics.loc.ploc
old: 91.0
new: 94.0
path: .metrics.loc.sloc
old: 183.0
new: 130.0
path: .metrics.loc.blank
old: 22.0
new: 19.0
path: .metrics.nom.functions
old: 1.0
new: 13.0
path: .metrics.nom.total
old: 1.0
new: 13.0

# Spaces Data

## Minimal test - lines (20, 106)

path: .spaces[0].metrics.mi.mi_sei
old: 99.26699426690874
new: 27.4579914836913
path: .spaces[0].metrics.mi.mi_original
old: 121.20789317454616
new: 55.70138923653984
path: .spaces[0].metrics.mi.mi_visual_studio
old: 70.88180887400361
new: 32.57391183423382
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 15.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 12.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 12.0
path: .spaces[0].metrics.halstead.N1
old: 11.0
new: 191.0
path: .spaces[0].metrics.halstead.n1
old: 7.0
new: 13.0
path: .spaces[0].metrics.halstead.effort
old: 181.6201599784581
new: 20635.093747927513
path: .spaces[0].metrics.halstead.bugs
old: 0.010690256224877058
new: 0.250774309228039
path: .spaces[0].metrics.halstead.difficulty
old: 3.5
new: 10.364864864864863
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.8434322969602153
new: 1.64273548670672
path: .spaces[0].metrics.halstead.volume
old: 51.89147427955946
new: 1990.8695402172568
path: .spaces[0].metrics.halstead.estimated_program_length
old: 27.651484454403228
new: 507.6052653923765
path: .spaces[0].metrics.halstead.length
old: 15.0
new: 309.0
path: .spaces[0].metrics.halstead.N2
old: 4.0
new: 118.0
path: .spaces[0].metrics.halstead.level
old: 0.2857142857142857
new: 0.09647979139504564
path: .spaces[0].metrics.halstead.n2
old: 4.0
new: 74.0
path: .spaces[0].metrics.halstead.vocabulary
old: 11.0
new: 87.0
path: .spaces[0].metrics.halstead.time
old: 10.090008887692116
new: 1146.394097107084
path: .spaces[0].metrics.nexits.sum
old: 1.0
new: 12.0
path: .spaces[0].metrics.loc.sloc
old: 6.0
new: 87.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 7.0
path: .spaces[0].metrics.loc.lloc
old: 1.0
new: 12.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 12.0
path: .spaces[0].metrics.loc.ploc
old: 6.0
new: 68.0

### Code

    namespace mozilla {
    namespace widget {

    // Our general connection to Wayland display server,
    // holds our display connection and runs event loop.
    // We have a global nsWaylandDisplay object for each thread.
    class nsWaylandDisplay {
     public:
      NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsWaylandDisplay)

      // Create nsWaylandDisplay object on top of native Wayland wl_display
      // connection. When aLighWrapper is set we don't get wayland registry
      // objects and only event loop is provided.
      explicit nsWaylandDisplay(wl_display* aDisplay, bool aLighWrapper = false);

      bool DispatchEventQueue();

      void SyncBegin();
      void QueueSyncBegin();
      void SyncEnd();
      void WaitForSyncEnd();

      bool Matches(wl_display* aDisplay);

      wl_display* GetDisplay() { return mDisplay; };
      wl_event_queue* GetEventQueue() { return mEventQueue; };
      wl_compositor* GetCompositor(void) { return mCompositor; };
      wl_subcompositor* GetSubcompositor(void) { return mSubcompositor; };
      wl_data_device_manager* GetDataDeviceManager(void) {
        return mDataDeviceManager;
      };
      wl_seat* GetSeat(void) { return mSeat; };
      wl_shm* GetShm(void) { return mShm; };
      gtk_primary_selection_device_manager* GetPrimarySelectionDeviceManagerGtk(
          void) {
        return mPrimarySelectionDeviceManagerGtk;
      };
      zwp_primary_selection_device_manager_v1*
      GetPrimarySelectionDeviceManagerZwpV1(void) {
        return mPrimarySelectionDeviceManagerZwpV1;
      };
      zwp_idle_inhibit_manager_v1* GetIdleInhibitManager(void) {
        return mIdleInhibitManager;
      }

      bool IsMainThreadDisplay() { return mEventQueue == nullptr; }

      void SetShm(wl_shm* aShm);
      void SetCompositor(wl_compositor* aCompositor);
      void SetSubcompositor(wl_subcompositor* aSubcompositor);
      void SetDataDeviceManager(wl_data_device_manager* aDataDeviceManager);
      void SetSeat(wl_seat* aSeat);
      void SetPrimarySelectionDeviceManager(
          gtk_primary_selection_device_manager* aPrimarySelectionDeviceManager);
      void SetPrimarySelectionDeviceManager(
          zwp_primary_selection_device_manager_v1* aPrimarySelectionDeviceManager);
      void SetIdleInhibitManager(zwp_idle_inhibit_manager_v1* aIdleInhibitManager);

      bool IsExplicitSyncEnabled() { return mExplicitSync; }

     private:
      ~nsWaylandDisplay();

      PRThread* mThreadId;
      wl_display* mDisplay;
      wl_event_queue* mEventQueue;
      wl_data_device_manager* mDataDeviceManager;
      wl_compositor* mCompositor;
      wl_subcompositor* mSubcompositor;
      wl_seat* mSeat;
      wl_shm* mShm;
      wl_callback* mSyncCallback;
      gtk_primary_selection_device_manager* mPrimarySelectionDeviceManagerGtk;
      zwp_primary_selection_device_manager_v1* mPrimarySelectionDeviceManagerZwpV1;
      zwp_idle_inhibit_manager_v1* mIdleInhibitManager;
      wl_registry* mRegistry;
      bool mExplicitSync;
    };

    void WaylandDispatchDisplays();
    void WaylandDisplayRelease();

    RefPtr WaylandDisplayGet(GdkDisplay* aGdkDisplay = nullptr);
    wl_display* WaylandDisplayGetWLDisplay(GdkDisplay* aGdkDisplay = nullptr);

    }  // namespace widget
    }  // namespace mozilla