# Global Metrics

path: .metrics.nexits.sum
old: 14.0
new: 0.0
path: .metrics.nexits.average
old: 0.875
new: null
path: .metrics.halstead.estimated_program_length
old: 1335.0204913157795
new: 548.7737975996429
path: .metrics.halstead.n2
old: 164.0
new: 80.0
path: .metrics.halstead.n1
old: 27.0
new: 12.0
path: .metrics.halstead.purity_ratio
old: 1.463838258021688
new: 2.169066393674478
path: .metrics.halstead.time
old: 12009.300615750317
new: 708.3229208870404
path: .metrics.halstead.N2
old: 380.0
new: 103.0
path: .metrics.halstead.length
old: 912.0
new: 253.0
path: .metrics.halstead.effort
old: 216167.4110835057
new: 12749.812575966727
path: .metrics.halstead.volume
old: 6910.615091168603
new: 1650.4611748824243
path: .metrics.halstead.N1
old: 532.0
new: 150.0
path: .metrics.halstead.difficulty
old: 31.28048780487805
new: 7.725
path: .metrics.halstead.level
old: 0.031968810916179334
new: 0.12944983818770228
path: .metrics.halstead.vocabulary
old: 191.0
new: 92.0
path: .metrics.halstead.bugs
old: 1.2006199609836596
new: 0.1819203483830575
path: .metrics.cyclomatic.sum
old: 35.0
new: 6.0
path: .metrics.cyclomatic.average
old: 2.0588235294117645
new: 1.0
path: .metrics.nom.closures
old: 2.0
new: 0.0
path: .metrics.nom.functions
old: 14.0
new: 0.0
path: .metrics.nom.total
old: 16.0
new: 0.0
path: .metrics.loc.lloc
old: 77.0
new: 0.0
path: .metrics.loc.blank
old: 47.0
new: 15.0
path: .metrics.loc.sloc
old: 274.0
new: 84.0
path: .metrics.loc.ploc
old: 193.0
new: 60.0
path: .metrics.loc.cloc
old: 34.0
new: 9.0
path: .metrics.mi.mi_original
old: 26.04509225381983
new: 59.31495571433152
path: .metrics.mi.mi_visual_studio
old: 15.231048101649025
new: 34.687108604872236
path: .metrics.mi.mi_sei
old: -8.610352985518723
new: 34.76534605276484
path: .metrics.cognitive.sum
old: 19.0
new: 0.0
path: .metrics.cognitive.average
old: 1.1875
new: null
path: .metrics.nargs.average
old: 1.125
new: null
path: .metrics.nargs.sum
old: 18.0
new: 0.0

# Spaces Data

## Minimal test - lines (16, 18)

path: .spaces[0].spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.difficulty
old: 5.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.level
old: 0.2
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n2
old: 9.0
new: 2.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N2
old: 10.0
new: 2.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N1
old: 18.0
new: 2.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.length
old: 28.0
new: 4.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 57.05865002596162
new: 4.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.time
old: 32.43275001121798
new: 0.4444444444444444
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.effort
old: 583.7895002019237
new: 8.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 2.0378089294986292
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.bugs
old: 0.02328357151433102
new: 0.0013333333333333333
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.volume
old: 116.75790004038474
new: 8.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n1
old: 9.0
new: 2.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.vocabulary
old: 18.0
new: 4.0
path: .spaces[0].spaces[0].spaces[0].metrics.nargs.sum
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.nargs.average
old: 2.0
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_original
old: 114.26372227039948
new: 141.92938490684145
path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 66.82089021660789
new: 82.99964029639851
path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_sei
old: 89.35049319981533
new: 129.26360748831726
path: .spaces[0].spaces[0].spaces[0].metrics.nexits.average
old: 2.0
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.nexits.sum
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.cognitive.average
old: 1.0
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.cognitive.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.lloc
old: 3.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.sloc
old: 7.0
new: 3.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.blank
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.ploc
old: 6.0
new: 3.0
path: .spaces[0].spaces[0].spaces[0].metrics.nom.total
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.nom.functions
old: 1.0
new: 0.0

### Code

    namespace remote_backbuffer {
    class Client;
    }

## Minimal test - lines (14, 81)

path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.2
new: 1.0
path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 33.0
new: 4.0
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 29.20834286184619
new: 63.40872658791115
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: -5.184682516516887
new: 29.31437181427476
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 17.080902258389585
new: 37.08112665959717
path: .spaces[0].spaces[0].metrics.nargs.average
old: 1.125
new: null
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 18.0
new: 0.0
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.304919098208067
new: 2.0739063081131905
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 6542.492196609591
new: 1584.964099978787
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 33.60839160839161
new: 7.76
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 143.0
new: 75.0
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 1152.2435637177232
new: 510.1809517958449
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 527.0
new: 149.0
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 356.0
new: 97.0
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 170.0
new: 87.0
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 1.2143374071890518
new: 0.17760949493392278
path: .spaces[0].spaces[0].metrics.halstead.time
old: 12215.702213250075
new: 683.295634213077
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 219882.63983850137
new: 12299.321415835388
path: .spaces[0].spaces[0].metrics.halstead.length
old: 883.0
new: 246.0
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.029754473574698296
new: 0.1288659793814433
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 27.0
new: 12.0
path: .spaces[0].spaces[0].metrics.nom.closures
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nom.functions
old: 14.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nom.total
old: 16.0
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 166.0
new: 52.0
path: .spaces[0].spaces[0].metrics.loc.cloc
old: 27.0
new: 2.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 236.0
new: 68.0
path: .spaces[0].spaces[0].metrics.loc.lloc
old: 77.0
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.blank
old: 43.0
new: 14.0
path: .spaces[0].spaces[0].metrics.nexits.sum
old: 14.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nexits.average
old: 0.875
new: null
path: .spaces[0].spaces[0].metrics.cognitive.average
old: 1.1875
new: null
path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 19.0
new: 0.0

### Code

    namespace widget {

    namespace remote_backbuffer {
    class Client;
    }

    class CompositorWidgetParent final : public PCompositorWidgetParent,
                                         public WinCompositorWidget {
     public:
      explicit CompositorWidgetParent(const CompositorWidgetInitData& aInitData,
                                      const layers::CompositorOptions& aOptions);
      ~CompositorWidgetParent() override;

      bool Initialize(const RemoteBackbufferHandles& aRemoteHandles);

      bool PreRender(WidgetRenderingContext*) override;
      void PostRender(WidgetRenderingContext*) override;
      already_AddRefed StartRemoteDrawingInRegion(
          const LayoutDeviceIntRegion& aInvalidRegion,
          layers::BufferMode* aBufferMode) override;
      void EndRemoteDrawingInRegion(
          gfx::DrawTarget* aDrawTarget,
          const LayoutDeviceIntRegion& aInvalidRegion) override;
      bool NeedsToDeferEndRemoteDrawing() override;
      LayoutDeviceIntSize GetClientSize() override;
      already_AddRefed GetBackBufferDrawTarget(
          gfx::DrawTarget* aScreenTarget, const gfx::IntRect& aRect,
          bool* aOutIsCleared) override;
      already_AddRefed EndBackBufferDrawing() override;
      bool InitCompositor(layers::Compositor* aCompositor) override;
      bool IsHidden() const override;

      bool HasGlass() const override;

      mozilla::ipc::IPCResult RecvInitialize(
          const RemoteBackbufferHandles& aRemoteHandles) override;
      mozilla::ipc::IPCResult RecvEnterPresentLock() override;
      mozilla::ipc::IPCResult RecvLeavePresentLock() override;
      mozilla::ipc::IPCResult RecvUpdateTransparency(
          const nsTransparencyMode& aMode) override;
      mozilla::ipc::IPCResult RecvClearTransparentWindow() override;
      void ActorDestroy(ActorDestroyReason aWhy) override;

      nsIWidget* RealWidget() override;
      void ObserveVsync(VsyncObserver* aObserver) override;
      RefPtr GetVsyncObserver() const override;

      // PlatformCompositorWidgetDelegate Overrides
      void UpdateCompositorWnd(const HWND aCompositorWnd,
                               const HWND aParentWnd) override;
      void SetRootLayerTreeID(const layers::LayersId& aRootLayerTreeId) override;

     private:
      RefPtr mVsyncObserver;
      Maybe mRootLayerTreeID;

      HWND mWnd;

      gfx::CriticalSection mPresentLock;

      // Transparency handling.
      mozilla::Atomic
          mTransparencyMode;

      std::unique_ptr mRemoteBackbufferClient;
    };

    }  // namespace widget

## Minimal test - lines (20, 79)

path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_sei
old: 44.91570882373827
new: 34.0112177801126
path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 48.80928465575001
new: 38.774054695294026
path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_original
old: 83.46387676133253
new: 66.30363352895279
path: .spaces[0].spaces[0].spaces[1].metrics.nargs.average
old: 2.0
new: null
path: .spaces[0].spaces[0].spaces[1].metrics.nargs.sum
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.blank
old: 6.0
new: 11.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.lloc
old: 9.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.ploc
old: 20.0
new: 47.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.cloc
old: 0.0
new: 2.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.sloc
old: 26.0
new: 60.0
path: .spaces[0].spaces[0].spaces[1].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[0].spaces[0].spaces[1].metrics.cyclomatic.sum
old: 2.0
new: 1.0
path: .spaces[0].spaces[0].spaces[1].metrics.cognitive.average
old: 2.0
new: null
path: .spaces[0].spaces[0].spaces[1].metrics.cognitive.sum
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.n2
old: 28.0
new: 73.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.N1
old: 75.0
new: 145.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.bugs
old: 0.17792468658758753
new: 0.17311153861439554
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 198.6059378176129
new: 494.8767428068951
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.n1
old: 16.0
new: 12.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.difficulty
old: 16.857142857142858
new: 7.726027397260274
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.vocabulary
old: 44.0
new: 85.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.N2
old: 59.0
new: 94.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 1.482133864310544
new: 2.070613986639729
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.time
old: 685.1153393166107
new: 657.504003521779
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.volume
old: 731.5638368973979
new: 1531.8444337369108
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.length
old: 134.0
new: 239.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.level
old: 0.059322033898305086
new: 0.12943262411347517
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.effort
old: 12332.076107698991
new: 11835.072063392025
path: .spaces[0].spaces[0].spaces[1].metrics.nexits.average
old: 1.0
new: null
path: .spaces[0].spaces[0].spaces[1].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.nom.total
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.nom.functions
old: 1.0
new: 0.0

### Code

    class CompositorWidgetParent final : public PCompositorWidgetParent,
                                         public WinCompositorWidget {
     public:
      explicit CompositorWidgetParent(const CompositorWidgetInitData& aInitData,
                                      const layers::CompositorOptions& aOptions);
      ~CompositorWidgetParent() override;

      bool Initialize(const RemoteBackbufferHandles& aRemoteHandles);

      bool PreRender(WidgetRenderingContext*) override;
      void PostRender(WidgetRenderingContext*) override;
      already_AddRefed StartRemoteDrawingInRegion(
          const LayoutDeviceIntRegion& aInvalidRegion,
          layers::BufferMode* aBufferMode) override;
      void EndRemoteDrawingInRegion(
          gfx::DrawTarget* aDrawTarget,
          const LayoutDeviceIntRegion& aInvalidRegion) override;
      bool NeedsToDeferEndRemoteDrawing() override;
      LayoutDeviceIntSize GetClientSize() override;
      already_AddRefed GetBackBufferDrawTarget(
          gfx::DrawTarget* aScreenTarget, const gfx::IntRect& aRect,
          bool* aOutIsCleared) override;
      already_AddRefed EndBackBufferDrawing() override;
      bool InitCompositor(layers::Compositor* aCompositor) override;
      bool IsHidden() const override;

      bool HasGlass() const override;

      mozilla::ipc::IPCResult RecvInitialize(
          const RemoteBackbufferHandles& aRemoteHandles) override;
      mozilla::ipc::IPCResult RecvEnterPresentLock() override;
      mozilla::ipc::IPCResult RecvLeavePresentLock() override;
      mozilla::ipc::IPCResult RecvUpdateTransparency(
          const nsTransparencyMode& aMode) override;
      mozilla::ipc::IPCResult RecvClearTransparentWindow() override;
      void ActorDestroy(ActorDestroyReason aWhy) override;

      nsIWidget* RealWidget() override;
      void ObserveVsync(VsyncObserver* aObserver) override;
      RefPtr GetVsyncObserver() const override;

      // PlatformCompositorWidgetDelegate Overrides
      void UpdateCompositorWnd(const HWND aCompositorWnd,
                               const HWND aParentWnd) override;
      void SetRootLayerTreeID(const layers::LayersId& aRootLayerTreeId) override;

     private:
      RefPtr mVsyncObserver;
      Maybe mRootLayerTreeID;

      HWND mWnd;

      gfx::CriticalSection mPresentLock;

      // Transparency handling.
      mozilla::Atomic
          mTransparencyMode;

      std::unique_ptr mRemoteBackbufferClient;
    };

## Minimal test - lines (13, 82)

path: .spaces[0].metrics.halstead.effort
old: 219715.6324514649
new: 12393.949425739016
path: .spaces[0].metrics.halstead.N2
old: 357.0
new: 98.0
path: .spaces[0].metrics.halstead.level
old: 0.029878618113912233
new: 0.1292517006802721
path: .spaces[0].metrics.halstead.bugs
old: 1.213722445805722
new: 0.17851932047396638
path: .spaces[0].metrics.halstead.N1
old: 528.0
new: 150.0
path: .spaces[0].metrics.halstead.n2
old: 144.0
new: 76.0
path: .spaces[0].metrics.halstead.vocabulary
old: 171.0
new: 88.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.3116962291142449
new: 2.088153391251477
path: .spaces[0].metrics.halstead.time
old: 12206.424025081382
new: 688.5527458743898
path: .spaces[0].metrics.halstead.estimated_program_length
old: 1160.8511627661064
new: 517.8620410303663
path: .spaces[0].metrics.halstead.difficulty
old: 33.46875
new: 7.736842105263157
path: .spaces[0].metrics.halstead.n1
old: 27.0
new: 12.0
path: .spaces[0].metrics.halstead.volume
old: 6564.79947567402
new: 1601.9390414220495
path: .spaces[0].metrics.halstead.length
old: 885.0
new: 248.0
path: .spaces[0].metrics.cognitive.average
old: 1.1875
new: null
path: .spaces[0].metrics.cognitive.sum
old: 19.0
new: 0.0
path: .spaces[0].metrics.nargs.average
old: 1.125
new: null
path: .spaces[0].metrics.nargs.sum
old: 18.0
new: 0.0
path: .spaces[0].metrics.mi.mi_sei
old: -5.319131416056951
new: 30.960664283097152
path: .spaces[0].metrics.mi.mi_original
old: 28.823933429065292
new: 62.65373268694117
path: .spaces[0].metrics.mi.mi_visual_studio
old: 16.85610142050602
new: 36.639609758445125
path: .spaces[0].metrics.loc.cloc
old: 28.0
new: 3.0
path: .spaces[0].metrics.loc.sloc
old: 238.0
new: 70.0
path: .spaces[0].metrics.loc.lloc
old: 77.0
new: 0.0
path: .spaces[0].metrics.loc.blank
old: 42.0
new: 13.0
path: .spaces[0].metrics.loc.ploc
old: 168.0
new: 54.0
path: .spaces[0].metrics.nom.functions
old: 14.0
new: 0.0
path: .spaces[0].metrics.nom.total
old: 16.0
new: 0.0
path: .spaces[0].metrics.nom.closures
old: 2.0
new: 0.0
path: .spaces[0].metrics.cyclomatic.average
old: 2.125
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 34.0
new: 5.0
path: .spaces[0].metrics.nexits.sum
old: 14.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 0.875
new: null

### Code

    namespace mozilla {
    namespace widget {

    namespace remote_backbuffer {
    class Client;
    }

    class CompositorWidgetParent final : public PCompositorWidgetParent,
                                         public WinCompositorWidget {
     public:
      explicit CompositorWidgetParent(const CompositorWidgetInitData& aInitData,
                                      const layers::CompositorOptions& aOptions);
      ~CompositorWidgetParent() override;

      bool Initialize(const RemoteBackbufferHandles& aRemoteHandles);

      bool PreRender(WidgetRenderingContext*) override;
      void PostRender(WidgetRenderingContext*) override;
      already_AddRefed StartRemoteDrawingInRegion(
          const LayoutDeviceIntRegion& aInvalidRegion,
          layers::BufferMode* aBufferMode) override;
      void EndRemoteDrawingInRegion(
          gfx::DrawTarget* aDrawTarget,
          const LayoutDeviceIntRegion& aInvalidRegion) override;
      bool NeedsToDeferEndRemoteDrawing() override;
      LayoutDeviceIntSize GetClientSize() override;
      already_AddRefed GetBackBufferDrawTarget(
          gfx::DrawTarget* aScreenTarget, const gfx::IntRect& aRect,
          bool* aOutIsCleared) override;
      already_AddRefed EndBackBufferDrawing() override;
      bool InitCompositor(layers::Compositor* aCompositor) override;
      bool IsHidden() const override;

      bool HasGlass() const override;

      mozilla::ipc::IPCResult RecvInitialize(
          const RemoteBackbufferHandles& aRemoteHandles) override;
      mozilla::ipc::IPCResult RecvEnterPresentLock() override;
      mozilla::ipc::IPCResult RecvLeavePresentLock() override;
      mozilla::ipc::IPCResult RecvUpdateTransparency(
          const nsTransparencyMode& aMode) override;
      mozilla::ipc::IPCResult RecvClearTransparentWindow() override;
      void ActorDestroy(ActorDestroyReason aWhy) override;

      nsIWidget* RealWidget() override;
      void ObserveVsync(VsyncObserver* aObserver) override;
      RefPtr GetVsyncObserver() const override;

      // PlatformCompositorWidgetDelegate Overrides
      void UpdateCompositorWnd(const HWND aCompositorWnd,
                               const HWND aParentWnd) override;
      void SetRootLayerTreeID(const layers::LayersId& aRootLayerTreeId) override;

     private:
      RefPtr mVsyncObserver;
      Maybe mRootLayerTreeID;

      HWND mWnd;

      gfx::CriticalSection mPresentLock;

      // Transparency handling.
      mozilla::Atomic
          mTransparencyMode;

      std::unique_ptr mRemoteBackbufferClient;
    };

    }  // namespace widget
    }  // namespace mozilla