# Global Metrics

path: .metrics.cognitive.sum
old: 91.0
new: 0.0
path: .metrics.cognitive.average
old: 3.64
new: 0.0
path: .metrics.halstead.estimated_program_length
old: 1276.1917173531906
new: 1082.4649600934374
path: .metrics.halstead.purity_ratio
old: 0.7641866570977189
new: 2.1059629573802283
path: .metrics.halstead.effort
old: 1201300.7078134082
new: 48239.42882611587
path: .metrics.halstead.volume
old: 12616.163382301656
new: 3754.143304563031
path: .metrics.halstead.N2
old: 662.0
new: 245.0
path: .metrics.halstead.n2
old: 146.0
new: 143.0
path: .metrics.halstead.N1
old: 1008.0
new: 269.0
path: .metrics.halstead.difficulty
old: 95.21917808219176
new: 12.84965034965035
path: .metrics.halstead.length
old: 1670.0
new: 514.0
path: .metrics.halstead.time
old: 66738.92821185601
new: 2679.9682681175486
path: .metrics.halstead.n1
old: 42.0
new: 15.0
path: .metrics.halstead.vocabulary
old: 188.0
new: 158.0
path: .metrics.halstead.bugs
old: 3.766863653078023
new: 0.441719782763855
path: .metrics.halstead.level
old: 0.010502086030786938
new: 0.07782312925170068
path: .metrics.nexits.average
old: 1.52
new: 1.0
path: .metrics.nexits.sum
old: 38.0
new: 1.0
path: .metrics.loc.blank
old: 34.0
new: 33.0
path: .metrics.loc.lloc
old: 153.0
new: 1.0
path: .metrics.loc.sloc
old: 473.0
new: 210.0
path: .metrics.loc.ploc
old: 343.0
new: 122.0
path: .metrics.loc.cloc
old: 96.0
new: 55.0
path: .metrics.cyclomatic.sum
old: 96.0
new: 10.0
path: .metrics.cyclomatic.average
old: 3.310344827586207
new: 1.1111111111111112
path: .metrics.nargs.average
old: 1.28
new: 0.0
path: .metrics.nargs.sum
old: 32.0
new: 0.0
path: .metrics.mi.mi_original
old: 0.04043749582102407
new: 39.27765797308096
path: .metrics.mi.mi_sei
old: -33.73622612105692
new: 17.599967738535597
path: .metrics.mi.mi_visual_studio
old: 0.02364765837486788
new: 22.96939062753273
path: .metrics.nom.total
old: 25.0
new: 1.0
path: .metrics.nom.functions
old: 25.0
new: 1.0

# Spaces Data

## Minimal test - lines (29, 208)

path: .spaces[4].metrics.cyclomatic.sum
old: 8.0
new: 3.0
path: .spaces[4].metrics.cyclomatic.average
old: 8.0
new: 1.5
path: .spaces[4].metrics.mi.mi_sei
old: 69.77643225229079
new: 22.492196207925915
path: .spaces[4].metrics.mi.mi_original
old: 76.88673571733578
new: 43.61018324412131
path: .spaces[4].metrics.mi.mi_visual_studio
old: 44.963003343471215
new: 25.50303113691305
path: .spaces[4].metrics.nargs.average
old: 1.0
new: 0.0
path: .spaces[4].metrics.nargs.sum
old: 1.0
new: 0.0
path: .spaces[4].metrics.cognitive.sum
old: 9.0
new: 0.0
path: .spaces[4].metrics.cognitive.average
old: 9.0
new: 0.0
path: .spaces[4].metrics.loc.lloc
old: 18.0
new: 1.0
path: .spaces[4].metrics.loc.sloc
old: 35.0
new: 180.0
path: .spaces[4].metrics.loc.cloc
old: 8.0
new: 45.0
path: .spaces[4].metrics.loc.ploc
old: 29.0
new: 107.0
path: .spaces[4].metrics.loc.blank
old: 0.0
new: 28.0
path: .spaces[4].metrics.nexits.sum
old: 5.0
new: 1.0
path: .spaces[4].metrics.nexits.average
old: 5.0
new: 1.0
path: .spaces[4].metrics.halstead.volume
old: 787.2783437256991
new: 3594.9720466680183
path: .spaces[4].metrics.halstead.difficulty
old: 18.36
new: 12.81021897810219
path: .spaces[4].metrics.halstead.vocabulary
old: 42.0
new: 152.0
path: .spaces[4].metrics.halstead.N1
old: 92.0
new: 262.0
path: .spaces[4].metrics.halstead.purity_ratio
old: 1.2711183085316704
new: 2.0786970852816933
path: .spaces[4].metrics.halstead.bugs
old: 0.19779382691691064
new: 0.42826586432241176
path: .spaces[4].metrics.halstead.length
old: 146.0
new: 496.0
path: .spaces[4].metrics.halstead.n2
old: 25.0
new: 137.0
path: .spaces[4].metrics.halstead.estimated_program_length
old: 185.58327304562388
new: 1031.03375429972
path: .spaces[4].metrics.halstead.N2
old: 54.0
new: 234.0
path: .spaces[4].metrics.halstead.effort
old: 14454.430390803836
new: 46052.37913797352
path: .spaces[4].metrics.halstead.n1
old: 17.0
new: 15.0
path: .spaces[4].metrics.halstead.time
old: 803.0239106002131
new: 2558.4655076651957
path: .spaces[4].metrics.halstead.level
old: 0.054466230936819175
new: 0.07806267806267805

### Code

    class nsDragService final : public nsBaseDragService, public nsIObserver {
     public:
      nsDragService();

      NS_DECL_ISUPPORTS_INHERITED

      NS_DECL_NSIOBSERVER

      // nsBaseDragService
      MOZ_CAN_RUN_SCRIPT virtual nsresult InvokeDragSessionImpl(
          nsIArray* anArrayTransferables,
          const mozilla::Maybe& aRegion,
          uint32_t aActionType) override;
      // nsIDragService
      MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSession(
          nsINode* aDOMNode, nsIPrincipal* aPrincipal,
          nsIContentSecurityPolicy* aCsp, nsICookieJarSettings* aCookieJarSettings,
          nsIArray* anArrayTransferables, uint32_t aActionType,
          nsContentPolicyType aContentPolicyType) override;
      NS_IMETHOD StartDragSession() override;
      MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndDragSession(bool aDoneDrag,
                                                   uint32_t aKeyModifiers) override;

      // nsIDragSession
      NS_IMETHOD SetCanDrop(bool aCanDrop) override;
      NS_IMETHOD GetCanDrop(bool* aCanDrop) override;
      NS_IMETHOD GetNumDropItems(uint32_t* aNumItems) override;
      NS_IMETHOD GetData(nsITransferable* aTransferable,
                         uint32_t aItemIndex) override;
      NS_IMETHOD IsDataFlavorSupported(const char* aDataFlavor,
                                       bool* _retval) override;

      NS_IMETHOD UpdateDragEffect() override;

      // Methods called from nsWindow to handle responding to GTK drag
      // destination signals

      static already_AddRefed GetInstance();

      void TargetDataReceived(GtkWidget* aWidget, GdkDragContext* aContext, gint aX,
                              gint aY, GtkSelectionData* aSelection_data,
                              guint aInfo, guint32 aTime);

      gboolean ScheduleMotionEvent(nsWindow* aWindow, GdkDragContext* aDragContext,
                                   nsWaylandDragContext* aPendingWaylandDragContext,
                                   mozilla::LayoutDeviceIntPoint aWindowPoint,
                                   guint aTime);
      void ScheduleLeaveEvent();
      gboolean ScheduleDropEvent(nsWindow* aWindow, GdkDragContext* aDragContext,
                                 nsWaylandDragContext* aPendingWaylandDragContext,
                                 mozilla::LayoutDeviceIntPoint aWindowPoint,
                                 guint aTime);

      nsWindow* GetMostRecentDestWindow() {
        return mScheduledTask == eDragTaskNone ? mTargetWindow : mPendingWindow;
      }

      //  END PUBLIC API

      // These methods are public only so that they can be called from functions
      // with C calling conventions.  They are called for drags started with the
      // invisible widget.
      void SourceEndDragSession(GdkDragContext* aContext, gint aResult);
      void SourceDataGet(GtkWidget* widget, GdkDragContext* context,
                         GtkSelectionData* selection_data, guint32 aTime);

      void SourceBeginDrag(GdkDragContext* aContext);

      // set the drag icon during drag-begin
      void SetDragIcon(GdkDragContext* aContext);

     protected:
      virtual ~nsDragService();

     private:
      // mScheduledTask indicates what signal has been received from GTK and
      // so what needs to be dispatched when the scheduled task is run.  It is
      // eDragTaskNone when there is no task scheduled (but the
      // previous task may still not have finished running).
      enum DragTask {
        eDragTaskNone,
        eDragTaskMotion,
        eDragTaskLeave,
        eDragTaskDrop,
        eDragTaskSourceEnd
      };
      DragTask mScheduledTask;
      // mTaskSource is the GSource id for the task that is either scheduled
      // or currently running.  It is 0 if no task is scheduled or running.
      guint mTaskSource;

      // target/destination side vars
      // These variables keep track of the state of the current drag.

      // mPendingWindow, mPendingWindowPoint, mPendingDragContext, and
      // mPendingTime, carry information from the GTK signal that will be used
      // when the scheduled task is run.  mPendingWindow and mPendingDragContext
      // will be nullptr if the scheduled task is eDragTaskLeave.
      RefPtr mPendingWindow;
      mozilla::LayoutDeviceIntPoint mPendingWindowPoint;
      RefPtr mPendingDragContext;

      // We cache all data for the current drag context,
      // because waiting for the data in GetTargetDragData can be very slow.
      nsTHashMap> mCachedData;

    #ifdef MOZ_WAYLAND
      RefPtr mPendingWaylandDragContext;
    #endif
      guint mPendingTime;

      // mTargetWindow and mTargetWindowPoint record the position of the last
      // eDragTaskMotion or eDragTaskDrop task that was run or is still running.
      // mTargetWindow is cleared once the drag has completed or left.
      RefPtr mTargetWindow;
      mozilla::LayoutDeviceIntPoint mTargetWindowPoint;
      // mTargetWidget and mTargetDragContext are set only while dispatching
      // motion or drop events.  mTime records the corresponding timestamp.
      RefPtr mTargetWidget;
      RefPtr mTargetDragContext;
    #ifdef MOZ_WAYLAND
      RefPtr mTargetWaylandDragContext;
    #endif
      // mTargetDragContextForRemote is set while waiting for a reply from
      // a child process.
      RefPtr mTargetDragContextForRemote;
    #ifdef MOZ_WAYLAND
      RefPtr mTargetWaylandDragContextForRemote;
    #endif
      guint mTargetTime;

      // is it OK to drop on us?
      bool mCanDrop;

      // have we received our drag data?
      bool mTargetDragDataReceived;
      // last data received and its length
      void* mTargetDragData;
      uint32_t mTargetDragDataLen;
      // is the current target drag context contain a list?
      bool IsTargetContextList(void);
      // this will get the native data from the last target given a
      // specific flavor
      void GetTargetDragData(GdkAtom aFlavor);
      // this will reset all of the target vars
      void TargetResetData(void);

      // source side vars

      // the source of our drags
      GtkWidget* mHiddenWidget;
      // our source data items
      nsCOMPtr mSourceDataItems;

      // get a list of the sources in gtk's format
      GtkTargetList* GetSourceList(void);

      // attempts to create a semi-transparent drag image. Returns TRUE if
      // successful, FALSE if not
      bool SetAlphaPixmap(SourceSurface* aPixbuf, GdkDragContext* aContext,
                          int32_t aXOffset, int32_t aYOffset,
                          const mozilla::LayoutDeviceIntRect& dragRect);

      gboolean Schedule(DragTask aTask, nsWindow* aWindow,
                        GdkDragContext* aDragContext,
                        nsWaylandDragContext* aPendingWaylandDragContext,
                        mozilla::LayoutDeviceIntPoint aWindowPoint, guint aTime);

      // Callback for g_idle_add_full() to run mScheduledTask.
      MOZ_CAN_RUN_SCRIPT static gboolean TaskDispatchCallback(gpointer data);
      MOZ_CAN_RUN_SCRIPT gboolean RunScheduledTask();
      void UpdateDragAction();
      MOZ_CAN_RUN_SCRIPT void DispatchMotionEvents();
      void ReplyToDragMotion(GdkDragContext* aDragContext);
    #ifdef MOZ_WAYLAND
      void ReplyToDragMotion(nsWaylandDragContext* aDragContext);
    #endif
      gboolean DispatchDropEvent();
      static uint32_t GetCurrentModifiers();
    };

## Minimal test - lines (17, 17)

path: .spaces[2].metrics.loc.blank
old: 2.0
new: 0.0
path: .spaces[2].metrics.loc.lloc
old: 3.0
new: 0.0
path: .spaces[2].metrics.loc.ploc
old: 11.0
new: 1.0
path: .spaces[2].metrics.loc.sloc
old: 13.0
new: 1.0
path: .spaces[2].metrics.cognitive.average
old: 0.0
new: null
path: .spaces[2].metrics.nexits.average
old: 1.0
new: null
path: .spaces[2].metrics.nexits.sum
old: 3.0
new: 0.0
path: .spaces[2].metrics.cyclomatic.sum
old: 4.0
new: 1.0
path: .spaces[2].metrics.mi.mi_original
old: 97.90030724792854
new: null
path: .spaces[2].metrics.mi.mi_visual_studio
old: 57.25164166545529
new: null
path: .spaces[2].metrics.mi.mi_sei
old: 65.94671521369742
new: null
path: .spaces[2].metrics.nom.functions
old: 3.0
new: 0.0
path: .spaces[2].metrics.nom.total
old: 3.0
new: 0.0
path: .spaces[2].metrics.nargs.sum
old: 5.0
new: 0.0
path: .spaces[2].metrics.nargs.average
old: 1.6666666666666667
new: null
path: .spaces[2].metrics.halstead.purity_ratio
old: 1.342812471118556
new: null
path: .spaces[2].metrics.halstead.length
old: 76.0
new: 1.0
path: .spaces[2].metrics.halstead.estimated_program_length
old: 102.05374780501026
new: null
path: .spaces[2].metrics.halstead.n2
old: 16.0
new: 1.0
path: .spaces[2].metrics.halstead.volume
old: 361.3714501644236
new: 0.0
path: .spaces[2].metrics.halstead.N1
old: 48.0
new: 0.0
path: .spaces[2].metrics.halstead.N2
old: 28.0
new: 1.0
path: .spaces[2].metrics.halstead.vocabulary
old: 27.0
new: 1.0
path: .spaces[2].metrics.halstead.difficulty
old: 9.625
new: 0.0
path: .spaces[2].metrics.halstead.effort
old: 3478.2002078325772
new: 0.0
path: .spaces[2].metrics.halstead.time
old: 193.23334487958763
new: 0.0
path: .spaces[2].metrics.halstead.n1
old: 11.0
new: 0.0
path: .spaces[2].metrics.halstead.bugs
old: 0.07652120430502991
new: 0.0
path: .spaces[2].metrics.halstead.level
old: 0.1038961038961039
new: null

### Code

    class nsWaylandDragContext;

## Minimal test - lines (16, 16)

path: .spaces[1].metrics.halstead.bugs
old: 0.007400380157174523
new: 0.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.842242046044582
new: null
path: .spaces[1].metrics.halstead.n2
old: 3.0
new: 1.0
path: .spaces[1].metrics.halstead.estimated_program_length
old: 20.264662506490403
new: null
path: .spaces[1].metrics.halstead.N1
old: 8.0
new: 0.0
path: .spaces[1].metrics.halstead.difficulty
old: 3.0
new: 0.0
path: .spaces[1].metrics.halstead.length
old: 11.0
new: 1.0
path: .spaces[1].metrics.halstead.n1
old: 6.0
new: 0.0
path: .spaces[1].metrics.halstead.vocabulary
old: 9.0
new: 1.0
path: .spaces[1].metrics.halstead.level
old: 0.3333333333333333
new: null
path: .spaces[1].metrics.halstead.time
old: 5.811529169310906
new: 0.0
path: .spaces[1].metrics.halstead.effort
old: 104.60752504759633
new: 0.0
path: .spaces[1].metrics.halstead.volume
old: 34.86917501586544
new: 0.0
path: .spaces[1].metrics.halstead.N2
old: 3.0
new: 1.0
path: .spaces[1].metrics.nargs.average
old: 0.0
new: null
path: .spaces[1].metrics.loc.ploc
old: 5.0
new: 1.0
path: .spaces[1].metrics.loc.lloc
old: 2.0
new: 0.0
path: .spaces[1].metrics.loc.sloc
old: 5.0
new: 1.0
path: .spaces[1].metrics.nexits.average
old: 0.0
new: null
path: .spaces[1].metrics.cognitive.average
old: 0.0
new: null
path: .spaces[1].metrics.nom.functions
old: 1.0
new: 0.0
path: .spaces[1].metrics.nom.total
old: 1.0
new: 0.0
path: .spaces[1].metrics.mi.mi_original
old: 126.22876917047284
new: null
path: .spaces[1].metrics.mi.mi_visual_studio
old: 73.81799366694318
new: null
path: .spaces[1].metrics.mi.mi_sei
old: 106.5105871671506
new: null

### Code

    class nsWindow;

## Minimal test - lines (15, 15)

path: .spaces[0].metrics.nexits.average
old: 0.0
new: null
path: .spaces[0].metrics.loc.lloc
old: 1.0
new: 0.0
path: .spaces[0].metrics.loc.ploc
old: 5.0
new: 1.0
path: .spaces[0].metrics.loc.sloc
old: 5.0
new: 1.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 0.0
path: .spaces[0].metrics.nom.total
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
path: .spaces[0].metrics.halstead.length
old: 35.0
new: 1.0
path: .spaces[0].metrics.halstead.bugs
old: 0.03488166209605841
new: 0.0
path: .spaces[0].metrics.halstead.vocabulary
old: 19.0
new: 1.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 61.74860596185444
new: null
path: .spaces[0].metrics.halstead.time
old: 59.47098518821019
new: 0.0
path: .spaces[0].metrics.halstead.volume
old: 148.67746297052548
new: 0.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.7642458846244125
new: null
path: .spaces[0].metrics.halstead.n1
old: 9.0
new: 0.0
path: .spaces[0].metrics.halstead.n2
old: 10.0
new: 1.0
path: .spaces[0].metrics.halstead.N2
old: 16.0
new: 1.0
path: .spaces[0].metrics.halstead.effort
old: 1070.4777333877837
new: 0.0
path: .spaces[0].metrics.halstead.difficulty
old: 7.2
new: 0.0
path: .spaces[0].metrics.halstead.N1
old: 19.0
new: 0.0
path: .spaces[0].metrics.halstead.level
old: 0.1388888888888889
new: null
path: .spaces[0].metrics.mi.mi_visual_studio
old: 69.40810149373284
new: null
path: .spaces[0].metrics.mi.mi_original
old: 118.68785355428317
new: null
path: .spaces[0].metrics.mi.mi_sei
old: 95.63134560391156
new: null
path: .spaces[0].metrics.cognitive.average
old: 0.0
new: null

### Code

    class nsICookieJarSettings;

## Minimal test - lines (19, 23)

path: .spaces[3].metrics.cyclomatic.sum
old: 5.0
new: 3.0
path: .spaces[3].metrics.cyclomatic.average
old: 5.0
new: 1.0
path: .spaces[3].metrics.nargs.average
old: 0.0
new: null
path: .spaces[3].metrics.mi.mi_sei
old: 96.08109350431778
new: 112.93327872124344
path: .spaces[3].metrics.mi.mi_visual_studio
old: 56.480289606364686
new: 76.33888152974038
path: .spaces[3].metrics.mi.mi_original
old: 96.5812952268836
new: 130.53948741585606
path: .spaces[3].metrics.nexits.sum
old: 2.0
new: 0.0
path: .spaces[3].metrics.nexits.average
old: 2.0
new: null
path: .spaces[3].metrics.loc.sloc
old: 15.0
new: 5.0
path: .spaces[3].metrics.loc.cloc
old: 3.0
new: 0.0
path: .spaces[3].metrics.loc.lloc
old: 6.0
new: 0.0
path: .spaces[3].metrics.loc.ploc
old: 12.0
new: 5.0
path: .spaces[3].metrics.cognitive.sum
old: 4.0
new: 0.0
path: .spaces[3].metrics.cognitive.average
old: 4.0
new: null
path: .spaces[3].metrics.halstead.volume
old: 285.2932501298081
new: 13.931568569324174
path: .spaces[3].metrics.halstead.N1
old: 38.0
new: 3.0
path: .spaces[3].metrics.halstead.estimated_program_length
old: 101.40868524464064
new: 6.754887502163468
path: .spaces[3].metrics.halstead.purity_ratio
old: 1.6901447540773442
new: 1.1258145836939113
path: .spaces[3].metrics.halstead.vocabulary
old: 27.0
new: 5.0
path: .spaces[3].metrics.halstead.N2
old: 22.0
new: 3.0
path: .spaces[3].metrics.halstead.effort
old: 3379.6277323069576
new: 13.931568569324174
path: .spaces[3].metrics.halstead.difficulty
old: 11.846153846153848
new: 1.0
path: .spaces[3].metrics.halstead.n1
old: 14.0
new: 2.0
path: .spaces[3].metrics.halstead.time
old: 187.75709623927543
new: 0.7739760316291208
path: .spaces[3].metrics.halstead.bugs
old: 0.07506854333889365
new: 0.0019299471801733172
path: .spaces[3].metrics.halstead.length
old: 60.0
new: 6.0
path: .spaces[3].metrics.halstead.n2
old: 13.0
new: 3.0
path: .spaces[3].metrics.halstead.level
old: 0.08441558441558442
new: 1.0
path: .spaces[3].metrics.nom.functions
old: 1.0
new: 0.0
path: .spaces[3].metrics.nom.total
old: 1.0
new: 0.0

### Code

    namespace mozilla {
    namespace gfx {
    class SourceSurface;
    }
    }  // namespace mozilla