Global Metrics
path: .metrics.cyclomatic.average
old: 2.5
new: 1.0
path: .metrics.cyclomatic.sum
old: 40.0
new: 10.0
path: .metrics.mi.mi_sei
old: -9.046643426065891
new: 36.88772273626049
path: .metrics.mi.mi_original
old: 25.10117609680455
new: 51.73167040002879
path: .metrics.mi.mi_visual_studio
old: 14.67905034900851
new: 30.252438830426193
path: .metrics.cognitive.sum
old: 26.0
new: 0.0
path: .metrics.cognitive.average
old: 2.0
new: 0.0
path: .metrics.nargs.average
old: 2.5384615384615383
new: 0.25
path: .metrics.nargs.sum
old: 33.0
new: 1.0
path: .metrics.loc.lloc
old: 82.0
new: 2.0
path: .metrics.loc.ploc
old: 200.0
new: 65.0
path: .metrics.loc.cloc
old: 36.0
new: 38.0
path: .metrics.loc.blank
old: 44.0
new: 29.0
path: .metrics.loc.sloc
old: 280.0
new: 132.0
path: .metrics.halstead.N1
old: 534.0
new: 135.0
path: .metrics.halstead.length
old: 880.0
new: 230.0
path: .metrics.halstead.time
old: 13812.965509011075
new: 677.1280827122005
path: .metrics.halstead.level
old: 0.02497109826589595
new: 0.11929824561403508
path: .metrics.halstead.vocabulary
old: 133.0
new: 80.0
path: .metrics.halstead.N2
old: 346.0
new: 95.0
path: .metrics.halstead.volume
old: 6208.648543241047
new: 1454.0434618240934
path: .metrics.halstead.bugs
old: 1.3180089729766362
new: 0.176539123436611
path: .metrics.halstead.purity_ratio
old: 0.9609366533841168
new: 1.9868131444072912
path: .metrics.halstead.n2
old: 108.0
new: 68.0
path: .metrics.halstead.n1
old: 25.0
new: 12.0
path: .metrics.halstead.estimated_program_length
old: 845.6242549780227
new: 456.96702321367695
path: .metrics.halstead.effort
old: 248633.37916219936
new: 12188.305488819607
path: .metrics.halstead.difficulty
old: 40.0462962962963
new: 8.382352941176471
path: .metrics.nom.functions
old: 13.0
new: 4.0
path: .metrics.nom.total
old: 13.0
new: 4.0
path: .metrics.nexits.average
old: 2.6923076923076925
new: 0.0
path: .metrics.nexits.sum
old: 35.0
new: 0.0
Spaces Data
Minimal test - lines (23, 130)
path: .spaces[0].metrics.nom.total
old: 13.0
new: 4.0
path: .spaces[0].metrics.nom.functions
old: 13.0
new: 4.0
path: .spaces[0].metrics.cyclomatic.average
old: 2.6
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 39.0
new: 9.0
path: .spaces[0].metrics.halstead.vocabulary
old: 127.0
new: 77.0
path: .spaces[0].metrics.halstead.n2
old: 102.0
new: 65.0
path: .spaces[0].metrics.halstead.N2
old: 340.0
new: 91.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 796.6837896254606
new: 434.4734578555034
path: .spaces[0].metrics.halstead.level
old: 0.024
new: 0.11904761904761904
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.9115375167339366
new: 1.9224489285641744
path: .spaces[0].metrics.halstead.bugs
old: 1.338677108366992
new: 0.1737136037981484
path: .spaces[0].metrics.halstead.difficulty
old: 41.666666666666664
new: 8.4
path: .spaces[0].metrics.halstead.volume
old: 6108.110416238873
new: 1416.2937581970475
path: .spaces[0].metrics.halstead.time
old: 14139.144482034426
new: 660.9370871586223
path: .spaces[0].metrics.halstead.N1
old: 534.0
new: 135.0
path: .spaces[0].metrics.halstead.effort
old: 254504.60067661968
new: 11896.8675688552
path: .spaces[0].metrics.halstead.length
old: 874.0
new: 226.0
path: .spaces[0].metrics.halstead.n1
old: 25.0
new: 12.0
path: .spaces[0].metrics.mi.mi_sei
old: -9.12751195412855
new: 41.50527946590815
path: .spaces[0].metrics.mi.mi_original
old: 26.7417164581221
new: 55.34932083331226
path: .spaces[0].metrics.mi.mi_visual_studio
old: 15.638430677264386
new: 32.36802387912998
path: .spaces[0].metrics.loc.sloc
old: 258.0
new: 108.0
path: .spaces[0].metrics.loc.lloc
old: 82.0
new: 2.0
path: .spaces[0].metrics.loc.blank
old: 40.0
new: 26.0
path: .spaces[0].metrics.loc.cloc
old: 27.0
new: 30.0
path: .spaces[0].metrics.loc.ploc
old: 191.0
new: 52.0
path: .spaces[0].metrics.cognitive.average
old: 2.0
new: 0.0
path: .spaces[0].metrics.cognitive.sum
old: 26.0
new: 0.0
path: .spaces[0].metrics.nargs.sum
old: 33.0
new: 1.0
path: .spaces[0].metrics.nargs.average
old: 2.5384615384615383
new: 0.25
path: .spaces[0].metrics.nexits.sum
old: 35.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 2.6923076923076925
new: 0.0
Code
namespace mozilla {
namespace widget {
class TaskbarPreviewCallback;
class TaskbarPreview : public nsITaskbarPreview {
public:
TaskbarPreview(ITaskbarList4* aTaskbar,
nsITaskbarPreviewController* aController, HWND aHWND,
nsIDocShell* aShell);
virtual nsresult Init();
friend class TaskbarPreviewCallback;
NS_DECL_NSITASKBARPREVIEW
protected:
virtual ~TaskbarPreview();
// Called to update ITaskbarList4 dependent properties
virtual nsresult UpdateTaskbarProperties();
// Invoked when the preview is made visible
virtual nsresult Enable();
// Invoked when the preview is made invisible
virtual nsresult Disable();
// Detaches this preview from the nsWindow instance it's tied to
virtual void DetachFromNSWindow();
// Determines if the window is available and a destroy has not yet started
bool IsWindowAvailable() const;
// Marks this preview as being active
virtual nsresult ShowActive(bool active) = 0;
// Gets a reference to the window used to handle the preview messages
virtual HWND& PreviewWindow() = 0;
// Window procedure for the PreviewWindow (hooked for window previews)
virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
// Returns whether or not the taskbar icon has been created for mWnd The
// ITaskbarList4 API requires that we wait until the icon has been created
// before we can call its methods.
bool CanMakeTaskbarCalls();
// Gets the WindowHook for the nsWindow
WindowHook* GetWindowHook();
// Enables/disables custom drawing for the given window
static void EnableCustomDrawing(HWND aHWND, bool aEnable);
// MSCOM Taskbar interface
RefPtr mTaskbar;
// Controller for this preview
nsCOMPtr mController;
// The HWND to the nsWindow that this object previews
HWND mWnd;
// Whether or not this preview is visible
bool mVisible;
private:
// Called when the tooltip should be updated
nsresult UpdateTooltip();
// Requests the controller to draw into a canvas of the given width and
// height. The resulting bitmap is sent to the DWM to display.
void DrawBitmap(uint32_t width, uint32_t height, bool isPreview);
// WindowHook procedure for hooking mWnd
static bool MainWindowHook(void* aContext, HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT* aResult);
// Docshell corresponding to the the nsWindow contains
nsWeakPtr mDocShell;
nsString mTooltip;
// The preview currently marked as active in the taskbar. nullptr if no
// preview is active (some other window is).
static TaskbarPreview* sActivePreview;
};
/*
* Callback object TaskbarPreview hands to preview controllers when we
* request async thumbnail or live preview images. Controllers invoke
* this interface once they have aquired the requested image.
*/
class TaskbarPreviewCallback : public nsITaskbarPreviewCallback {
public:
TaskbarPreviewCallback() : mIsThumbnail(true) {}
NS_DECL_ISUPPORTS
NS_DECL_NSITASKBARPREVIEWCALLBACK
void SetPreview(TaskbarPreview* aPreview) { mPreview = aPreview; }
void SetIsPreview() { mIsThumbnail = false; }
protected:
virtual ~TaskbarPreviewCallback() {}
private:
RefPtr mPreview;
bool mIsThumbnail;
};
} // namespace widget
} // namespace mozilla
Minimal test - lines (28, 103)
path: .spaces[0].spaces[0].spaces[1].metrics.nexits.average
old: 6.0
new: null
path: .spaces[0].spaces[0].spaces[1].metrics.nexits.sum
old: 6.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 47.31044026883953
new: 37.77786429030268
path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_original
old: 80.9008528597156
new: 64.60014793641759
path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_sei
old: 68.03563854255047
new: 55.8341474680881
path: .spaces[0].spaces[0].spaces[1].metrics.cyclomatic.average
old: 6.0
new: 1.0
path: .spaces[0].spaces[0].spaces[1].metrics.cyclomatic.sum
old: 6.0
new: 1.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
path: .spaces[0].spaces[0].spaces[1].metrics.cognitive.average
old: 5.0
new: null
path: .spaces[0].spaces[0].spaces[1].metrics.cognitive.sum
old: 5.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.nargs.sum
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.nargs.average
old: 2.0
new: null
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.vocabulary
old: 40.0
new: 65.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.N2
old: 42.0
new: 68.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.n1
old: 18.0
new: 12.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.volume
old: 580.0901623427226
new: 1017.7801604018088
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.n2
old: 22.0
new: 53.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.difficulty
old: 17.181818181818183
new: 7.69811320754717
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.N1
old: 67.0
new: 101.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.effort
old: 9967.003698434051
new: 7834.986895168641
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 173.16614563598216
new: 346.5993341005034
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.length
old: 109.0
new: 169.0
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.time
old: 553.7224276907807
new: 435.2770497315912
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.bugs
old: 0.15437909531018154
new: 0.1314934928185026
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.level
old: 0.0582010582010582
new: 0.12990196078431374
path: .spaces[0].spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 1.588680235192497
new: 2.0508836337307894
path: .spaces[0].spaces[0].spaces[1].metrics.loc.blank
old: 4.0
new: 18.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.ploc
old: 23.0
new: 34.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.lloc
old: 13.0
new: 0.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.sloc
old: 31.0
new: 76.0
path: .spaces[0].spaces[0].spaces[1].metrics.loc.cloc
old: 4.0
new: 24.0
Code
class TaskbarPreview : public nsITaskbarPreview {
public:
TaskbarPreview(ITaskbarList4* aTaskbar,
nsITaskbarPreviewController* aController, HWND aHWND,
nsIDocShell* aShell);
virtual nsresult Init();
friend class TaskbarPreviewCallback;
NS_DECL_NSITASKBARPREVIEW
protected:
virtual ~TaskbarPreview();
// Called to update ITaskbarList4 dependent properties
virtual nsresult UpdateTaskbarProperties();
// Invoked when the preview is made visible
virtual nsresult Enable();
// Invoked when the preview is made invisible
virtual nsresult Disable();
// Detaches this preview from the nsWindow instance it's tied to
virtual void DetachFromNSWindow();
// Determines if the window is available and a destroy has not yet started
bool IsWindowAvailable() const;
// Marks this preview as being active
virtual nsresult ShowActive(bool active) = 0;
// Gets a reference to the window used to handle the preview messages
virtual HWND& PreviewWindow() = 0;
// Window procedure for the PreviewWindow (hooked for window previews)
virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
// Returns whether or not the taskbar icon has been created for mWnd The
// ITaskbarList4 API requires that we wait until the icon has been created
// before we can call its methods.
bool CanMakeTaskbarCalls();
// Gets the WindowHook for the nsWindow
WindowHook* GetWindowHook();
// Enables/disables custom drawing for the given window
static void EnableCustomDrawing(HWND aHWND, bool aEnable);
// MSCOM Taskbar interface
RefPtr mTaskbar;
// Controller for this preview
nsCOMPtr mController;
// The HWND to the nsWindow that this object previews
HWND mWnd;
// Whether or not this preview is visible
bool mVisible;
private:
// Called when the tooltip should be updated
nsresult UpdateTooltip();
// Requests the controller to draw into a canvas of the given width and
// height. The resulting bitmap is sent to the DWM to display.
void DrawBitmap(uint32_t width, uint32_t height, bool isPreview);
// WindowHook procedure for hooking mWnd
static bool MainWindowHook(void* aContext, HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT* aResult);
// Docshell corresponding to the the nsWindow contains
nsWeakPtr mDocShell;
nsString mTooltip;
// The preview currently marked as active in the taskbar. nullptr if no
// preview is active (some other window is).
static TaskbarPreview* sActivePreview;
};
Minimal test - lines (110, 127)
path: .spaces[0].spaces[0].spaces[2].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[0].spaces[0].spaces[2].metrics.cyclomatic.sum
old: 2.0
new: 5.0
path: .spaces[0].spaces[0].spaces[2].metrics.loc.ploc
old: 6.0
new: 13.0
path: .spaces[0].spaces[0].spaces[2].metrics.loc.lloc
old: 3.0
new: 2.0
path: .spaces[0].spaces[0].spaces[2].metrics.loc.blank
old: 0.0
new: 5.0
path: .spaces[0].spaces[0].spaces[2].metrics.loc.sloc
old: 6.0
new: 18.0
path: .spaces[0].spaces[0].spaces[2].metrics.nargs.average
old: 0.0
new: 0.25
path: .spaces[0].spaces[0].spaces[2].metrics.nargs.sum
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].spaces[2].metrics.cognitive.average
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[2].metrics.cognitive.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[2].metrics.nom.functions
old: 1.0
new: 4.0
path: .spaces[0].spaces[0].spaces[2].metrics.nom.total
old: 1.0
new: 4.0
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.length
old: 17.0
new: 49.0
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.N2
old: 4.0
new: 20.0
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.effort
old: 313.65513342311493
new: 1705.034891129182
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 1.691463970715498
new: 1.6596938221368942
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.vocabulary
old: 11.0
new: 23.0
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.n2
old: 3.0
new: 13.0
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.N1
old: 13.0
new: 29.0
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.time
old: 17.425285190173053
new: 94.72416061828788
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.level
old: 0.1875
new: 0.13
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.bugs
old: 0.015387935070942911
new: 0.04757377260424428
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.volume
old: 58.81033751683405
new: 221.65453584679364
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.estimated_program_length
old: 28.75488750216347
new: 81.32499728470782
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.n1
old: 8.0
new: 10.0
path: .spaces[0].spaces[0].spaces[2].metrics.halstead.difficulty
old: 5.333333333333333
new: 7.6923076923076925
path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_original
old: 120.32704483118532
new: 94.9401533921494
path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 70.36669288373412
new: 55.52055753926866
path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_sei
old: 98.09801858957128
new: 61.77793578510099
path: .spaces[0].spaces[0].spaces[2].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[2].metrics.nexits.average
old: 1.0
new: 0.0
Code
class TaskbarPreviewCallback : public nsITaskbarPreviewCallback {
public:
TaskbarPreviewCallback() : mIsThumbnail(true) {}
NS_DECL_ISUPPORTS
NS_DECL_NSITASKBARPREVIEWCALLBACK
void SetPreview(TaskbarPreview* aPreview) { mPreview = aPreview; }
void SetIsPreview() { mIsThumbnail = false; }
protected:
virtual ~TaskbarPreviewCallback() {}
private:
RefPtr mPreview;
bool mIsThumbnail;
};
Minimal test - lines (24, 129)
path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 26.0
new: 0.0
path: .spaces[0].spaces[0].metrics.cognitive.average
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 27.118192840847
new: 55.94402818901379
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: -9.013590733517804
new: 42.04895454259854
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 15.858592304588887
new: 32.71580595848759
path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.7142857142857144
new: 1.0
path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 38.0
new: 8.0
path: .spaces[0].spaces[0].metrics.loc.lloc
old: 82.0
new: 2.0
path: .spaces[0].spaces[0].metrics.loc.cloc
old: 26.0
new: 29.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 189.0
new: 50.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 256.0
new: 106.0
path: .spaces[0].spaces[0].metrics.loc.blank
old: 41.0
new: 27.0
path: .spaces[0].spaces[0].metrics.nexits.average
old: 2.6923076923076925
new: 0.0
path: .spaces[0].spaces[0].metrics.nexits.sum
old: 35.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 33.0
new: 1.0
path: .spaces[0].spaces[0].metrics.nargs.average
old: 2.5384615384615383
new: 0.25
path: .spaces[0].spaces[0].metrics.nom.functions
old: 13.0
new: 4.0
path: .spaces[0].spaces[0].metrics.nom.total
old: 13.0
new: 4.0
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 126.0
new: 76.0
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 339.0
new: 90.0
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 101.0
new: 64.0
path: .spaces[0].spaces[0].metrics.halstead.length
old: 872.0
new: 224.0
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 255264.8222309361
new: 11808.583000408376
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 25.0
new: 12.0
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 533.0
new: 134.0
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 788.5757645022993
new: 427.0195500086539
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 6084.1880932919275
new: 1399.535763011363
path: .spaces[0].spaces[0].metrics.halstead.time
old: 14181.379012829782
new: 656.0323889115765
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.02383480825958702
new: 0.11851851851851852
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 1.3413415925173224
new: 0.17285313857064916
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 0.9043300051631872
new: 1.9063372768243476
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 41.95544554455446
new: 8.4375
Code
namespace widget {
class TaskbarPreviewCallback;
class TaskbarPreview : public nsITaskbarPreview {
public:
TaskbarPreview(ITaskbarList4* aTaskbar,
nsITaskbarPreviewController* aController, HWND aHWND,
nsIDocShell* aShell);
virtual nsresult Init();
friend class TaskbarPreviewCallback;
NS_DECL_NSITASKBARPREVIEW
protected:
virtual ~TaskbarPreview();
// Called to update ITaskbarList4 dependent properties
virtual nsresult UpdateTaskbarProperties();
// Invoked when the preview is made visible
virtual nsresult Enable();
// Invoked when the preview is made invisible
virtual nsresult Disable();
// Detaches this preview from the nsWindow instance it's tied to
virtual void DetachFromNSWindow();
// Determines if the window is available and a destroy has not yet started
bool IsWindowAvailable() const;
// Marks this preview as being active
virtual nsresult ShowActive(bool active) = 0;
// Gets a reference to the window used to handle the preview messages
virtual HWND& PreviewWindow() = 0;
// Window procedure for the PreviewWindow (hooked for window previews)
virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
// Returns whether or not the taskbar icon has been created for mWnd The
// ITaskbarList4 API requires that we wait until the icon has been created
// before we can call its methods.
bool CanMakeTaskbarCalls();
// Gets the WindowHook for the nsWindow
WindowHook* GetWindowHook();
// Enables/disables custom drawing for the given window
static void EnableCustomDrawing(HWND aHWND, bool aEnable);
// MSCOM Taskbar interface
RefPtr mTaskbar;
// Controller for this preview
nsCOMPtr mController;
// The HWND to the nsWindow that this object previews
HWND mWnd;
// Whether or not this preview is visible
bool mVisible;
private:
// Called when the tooltip should be updated
nsresult UpdateTooltip();
// Requests the controller to draw into a canvas of the given width and
// height. The resulting bitmap is sent to the DWM to display.
void DrawBitmap(uint32_t width, uint32_t height, bool isPreview);
// WindowHook procedure for hooking mWnd
static bool MainWindowHook(void* aContext, HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT* aResult);
// Docshell corresponding to the the nsWindow contains
nsWeakPtr mDocShell;
nsString mTooltip;
// The preview currently marked as active in the taskbar. nullptr if no
// preview is active (some other window is).
static TaskbarPreview* sActivePreview;
};
/*
* Callback object TaskbarPreview hands to preview controllers when we
* request async thumbnail or live preview images. Controllers invoke
* this interface once they have aquired the requested image.
*/
class TaskbarPreviewCallback : public nsITaskbarPreviewCallback {
public:
TaskbarPreviewCallback() : mIsThumbnail(true) {}
NS_DECL_ISUPPORTS
NS_DECL_NSITASKBARPREVIEWCALLBACK
void SetPreview(TaskbarPreview* aPreview) { mPreview = aPreview; }
void SetIsPreview() { mIsThumbnail = false; }
protected:
virtual ~TaskbarPreviewCallback() {}
private:
RefPtr mPreview;
bool mIsThumbnail;
};
} // namespace widget
Minimal test - lines (26, 26)
path: .spaces[0].spaces[0].spaces[0].metrics.loc.blank
old: 5.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.lloc
old: 11.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.ploc
old: 19.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.sloc
old: 25.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.loc.cloc
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.cyclomatic.average
old: 4.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.cyclomatic.sum
old: 4.0
new: 1.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
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N2
old: 37.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 168.0419249893113
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.bugs
old: 0.12283691948548056
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n1
old: 16.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.vocabulary
old: 39.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n2
old: 23.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.difficulty
old: 12.869565217391305
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.volume
old: 549.6818307616738
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N1
old: 67.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.time
old: 393.0092316556895
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.6157877402818397
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.level
old: 0.0777027027027027
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.length
old: 104.0
new: 1.0
path: .spaces[0].spaces[0].spaces[0].metrics.halstead.effort
old: 7074.166169802411
new: 0.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.nexits.average
old: 3.0
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.nexits.sum
old: 3.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.cognitive.average
old: 3.0
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.cognitive.sum
old: 3.0
new: 0.0
path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_original
old: 85.1256456063093
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_sei
old: 62.76202372957982
new: null
path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 49.781079301935264
new: null
Code
class TaskbarPreviewCallback;