Global Metrics
path: .metrics.nargs.average
old: 0.75
new: null
path: .metrics.nargs.sum
old: 18.0
new: 0.0
path: .metrics.loc.blank
old: 33.0
new: 22.0
path: .metrics.loc.ploc
old: 142.0
new: 83.0
path: .metrics.loc.cloc
old: 6.0
new: 9.0
path: .metrics.loc.sloc
old: 181.0
new: 114.0
path: .metrics.loc.lloc
old: 36.0
new: 0.0
path: .metrics.cognitive.average
old: 0.25
new: null
path: .metrics.cognitive.sum
old: 6.0
new: 0.0
path: .metrics.mi.mi_original
old: 32.34042214261508
new: 52.81258021489295
path: .metrics.mi.mi_sei
old: -10.544835668439973
new: 21.77871141601463
path: .metrics.mi.mi_visual_studio
old: 18.91252756878075
new: 30.884549833270732
path: .metrics.nom.functions
old: 24.0
new: 0.0
path: .metrics.nom.total
old: 24.0
new: 0.0
path: .metrics.halstead.n1
old: 26.0
new: 15.0
path: .metrics.halstead.vocabulary
old: 121.0
new: 111.0
path: .metrics.halstead.length
old: 696.0
new: 391.0
path: .metrics.halstead.time
old: 10543.473611934409
new: 2190.7862617671417
path: .metrics.halstead.level
old: 0.025373931623931624
new: 0.06736842105263158
path: .metrics.halstead.N1
old: 408.0
new: 201.0
path: .metrics.halstead.purity_ratio
old: 1.0723386716423973
new: 1.7666490000085904
path: .metrics.halstead.estimated_program_length
old: 746.3477154631084
new: 690.7597590033588
path: .metrics.halstead.effort
old: 189782.52501481932
new: 39434.15271180855
path: .metrics.halstead.n2
old: 95.0
new: 96.0
path: .metrics.halstead.bugs
old: 1.1008197827469344
new: 0.3861835358512665
path: .metrics.halstead.volume
old: 4815.528813143118
new: 2656.6166037428916
path: .metrics.halstead.N2
old: 288.0
new: 190.0
path: .metrics.halstead.difficulty
old: 39.410526315789475
new: 14.84375
path: .metrics.cyclomatic.average
old: 1.2857142857142858
new: 1.0
path: .metrics.cyclomatic.sum
old: 45.0
new: 2.0
path: .metrics.nexits.sum
old: 15.0
new: 0.0
path: .metrics.nexits.average
old: 0.625
new: null
Spaces Data
Minimal test - lines (19, 112)
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.601032907975373
new: 1.645756801507113
path: .spaces[0].metrics.halstead.N1
old: 16.0
new: 200.0
path: .spaces[0].metrics.halstead.effort
old: 1312.7152401244623
new: 39298.957061512665
path: .spaces[0].metrics.halstead.level
old: 0.08333333333333333
new: 0.06482504604051566
path: .spaces[0].metrics.halstead.difficulty
old: 12.0
new: 15.426136363636363
path: .spaces[0].metrics.halstead.n1
old: 10.0
new: 15.0
path: .spaces[0].metrics.halstead.length
old: 28.0
new: 381.0
path: .spaces[0].metrics.halstead.bugs
old: 0.03996309328541862
new: 0.38530037224618713
path: .spaces[0].metrics.halstead.time
old: 72.92862445135901
new: 2183.275392306259
path: .spaces[0].metrics.halstead.vocabulary
old: 15.0
new: 103.0
path: .spaces[0].metrics.halstead.volume
old: 109.39293667703852
new: 2547.5567008568064
path: .spaces[0].metrics.halstead.N2
old: 12.0
new: 181.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 44.82892142331043
new: 627.03334137421
path: .spaces[0].metrics.halstead.n2
old: 5.0
new: 88.0
path: .spaces[0].metrics.loc.sloc
old: 8.0
new: 94.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 5.0
path: .spaces[0].metrics.loc.ploc
old: 7.0
new: 72.0
path: .spaces[0].metrics.loc.blank
old: 1.0
new: 17.0
path: .spaces[0].metrics.loc.lloc
old: 1.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 1.0
new: null
path: .spaces[0].metrics.cognitive.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 65.6194889716396
new: 32.97403298904339
path: .spaces[0].metrics.mi.mi_original
old: 112.20932614150372
new: 56.38559641126419
path: .spaces[0].metrics.mi.mi_sei
old: 86.48844595204034
new: 23.235246175464617
path: .spaces[0].metrics.nexits.average
old: 1.0
new: null
path: .spaces[0].metrics.nexits.sum
old: 1.0
new: 0.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.cyclomatic.average
old: 1.5
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 3.0
new: 1.0
Code
class nsNativeThemeGTK final : private nsNativeTheme,
public nsITheme,
public nsIObserver {
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIOBSERVER
// The nsITheme interface.
NS_IMETHOD DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
StyleAppearance aAppearance,
const nsRect& aRect,
const nsRect& aDirtyRect) override;
bool CreateWebRenderCommandsForWidget(
mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,
const mozilla::layers::StackingContextHelper& aSc,
mozilla::layers::RenderRootStateManager* aManager, nsIFrame* aFrame,
StyleAppearance aAppearance, const nsRect& aRect) override;
[[nodiscard]] LayoutDeviceIntMargin GetWidgetBorder(
nsDeviceContext* aContext, nsIFrame* aFrame,
StyleAppearance aAppearance) override;
bool GetWidgetPadding(nsDeviceContext* aContext, nsIFrame* aFrame,
StyleAppearance aAppearance,
LayoutDeviceIntMargin* aResult) override;
bool GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFrame,
StyleAppearance aAppearance,
nsRect* aOverflowRect) override;
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
StyleAppearance aAppearance,
mozilla::LayoutDeviceIntSize* aResult,
bool* aIsOverridable) override;
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, StyleAppearance aAppearance,
nsAtom* aAttribute, bool* aShouldRepaint,
const nsAttrValue* aOldValue) override;
NS_IMETHOD ThemeChanged() override;
NS_IMETHOD_(bool)
ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
StyleAppearance aAppearance) override;
NS_IMETHOD_(bool) WidgetIsContainer(StyleAppearance aAppearance) override;
NS_IMETHOD_(bool)
ThemeDrawsFocusForWidget(StyleAppearance aAppearance) override;
bool ThemeNeedsComboboxDropmarker() override;
Transparency GetWidgetTransparency(nsIFrame*, StyleAppearance) override;
bool WidgetAppearanceDependsOnWindowFocus(StyleAppearance) override;
ScrollbarSizes GetScrollbarSizes(nsPresContext*, StyleScrollbarWidth,
Overlay) override;
nsNativeThemeGTK();
protected:
virtual ~nsNativeThemeGTK();
private:
GtkTextDirection GetTextDirection(nsIFrame* aFrame);
gint GetTabMarginPixels(nsIFrame* aFrame);
bool GetGtkWidgetAndState(StyleAppearance aAppearance, nsIFrame* aFrame,
WidgetNodeType& aGtkWidgetType,
GtkWidgetState* aState, gint* aWidgetFlags);
bool GetExtraSizeForWidget(nsIFrame* aFrame, StyleAppearance aAppearance,
nsIntMargin* aExtra);
bool IsWidgetVisible(StyleAppearance aAppearance);
void RefreshWidgetWindow(nsIFrame* aFrame);
WidgetNodeType NativeThemeToGtkTheme(StyleAppearance aAppearance,
nsIFrame* aFrame);
uint8_t mDisabledWidgetTypes
[(static_cast(mozilla::StyleAppearance::Count) + 7) / 8];
uint8_t
mSafeWidgetStates[static_cast(mozilla::StyleAppearance::Count) *
4]; // 32 bits per widget
static const char* sDisabledEngines[];
// Because moz_gtk_get_widget_border can be slow, we cache its results
// by widget type. Each bit in mBorderCacheValid says whether the
// corresponding entry in mBorderCache is valid.
void GetCachedWidgetBorder(nsIFrame* aFrame, StyleAppearance aAppearance,
GtkTextDirection aDirection,
LayoutDeviceIntMargin* aResult);
uint8_t mBorderCacheValid[(MOZ_GTK_WIDGET_NODE_COUNT + 7) / 8];
LayoutDeviceIntMargin mBorderCache[MOZ_GTK_WIDGET_NODE_COUNT];
};