Global Metrics
path: .metrics.nexits.average
old: 0.0
new: 0.5
path: .metrics.nexits.sum
old: 0.0
new: 1.0
path: .metrics.cyclomatic.sum
old: 15.0
new: 8.0
path: .metrics.loc.blank
old: 23.0
new: 10.0
path: .metrics.loc.cloc
old: 46.0
new: 24.0
path: .metrics.loc.lloc
old: 0.0
new: 2.0
path: .metrics.loc.sloc
old: 164.0
new: 80.0
path: .metrics.loc.ploc
old: 95.0
new: 46.0
path: .metrics.nargs.sum
old: 3.0
new: 0.0
path: .metrics.nargs.average
old: 1.0
new: 0.0
path: .metrics.mi.mi_visual_studio
old: 25.923729224540494
new: 36.72439517485188
path: .metrics.mi.mi_sei
old: 26.35382040190209
new: 53.228512029428735
path: .metrics.mi.mi_original
old: 44.32957697396425
new: 62.79871574899671
path: .metrics.nom.functions
old: 3.0
new: 2.0
path: .metrics.nom.total
old: 3.0
new: 2.0
path: .metrics.halstead.n1
old: 13.0
new: 14.0
path: .metrics.halstead.N1
old: 215.0
new: 87.0
path: .metrics.halstead.vocabulary
old: 98.0
new: 64.0
path: .metrics.halstead.time
old: 1641.2521825373074
new: 441.0
path: .metrics.halstead.level
old: 0.08329250367466928
new: 0.11337868480725624
path: .metrics.halstead.n2
old: 85.0
new: 50.0
path: .metrics.halstead.bugs
old: 0.3185497679827561
new: 0.13264355155078392
path: .metrics.halstead.purity_ratio
old: 1.5938278115794056
new: 2.2366385226502845
path: .metrics.halstead.N2
old: 157.0
new: 63.0
path: .metrics.halstead.difficulty
old: 12.005882352941176
new: 8.82
path: .metrics.halstead.effort
old: 29542.539285671533
new: 7938.0
path: .metrics.halstead.volume
old: 2460.6720620108576
new: 900.0
path: .metrics.halstead.length
old: 372.0
new: 150.0
path: .metrics.halstead.estimated_program_length
old: 592.9039459075389
new: 335.49577839754267
Spaces Data
Minimal test - lines (23, 25)
path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 2.0
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: null
new: 129.26360748831726
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: null
new: 141.92938490684145
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: null
new: 82.99964029639851
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 0.0
new: 8.0
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: null
new: 4.0
path: .spaces[0].spaces[0].metrics.halstead.length
old: 1.0
new: 4.0
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 0.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.level
old: null
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 1.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 1.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: null
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 0.0
new: 8.0
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 1.0
new: 4.0
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 0.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.0
new: 0.0013333333333333333
path: .spaces[0].spaces[0].metrics.halstead.time
old: 0.0
new: 0.4444444444444444
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 1.0
new: 3.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 1.0
new: 3.0
Code
namespace plugins {
class PluginWidgetChild;
} // namespace plugins
Minimal test - lines (22, 78)
path: .spaces[0].metrics.halstead.difficulty
old: 12.493506493506494
new: 8.826086956521738
path: .spaces[0].metrics.halstead.volume
old: 2356.542673967672
new: 856.4991363632353
path: .spaces[0].metrics.halstead.bugs
old: 0.31782289723474494
new: 0.12839324228534998
path: .spaces[0].metrics.halstead.n1
old: 13.0
new: 14.0
path: .spaces[0].metrics.halstead.time
old: 1635.637844413348
new: 419.9742142070935
path: .spaces[0].metrics.halstead.effort
old: 29441.481199440263
new: 7559.535855727684
path: .spaces[0].metrics.halstead.length
old: 363.0
new: 145.0
path: .spaces[0].metrics.halstead.level
old: 0.08004158004158003
new: 0.11330049261083744
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.4618409916510788
new: 2.119909095775373
path: .spaces[0].metrics.halstead.estimated_program_length
old: 530.6482799693416
new: 307.38681888742906
path: .spaces[0].metrics.halstead.n2
old: 77.0
new: 46.0
path: .spaces[0].metrics.halstead.vocabulary
old: 90.0
new: 60.0
path: .spaces[0].metrics.halstead.N2
old: 148.0
new: 58.0
path: .spaces[0].metrics.halstead.N1
old: 215.0
new: 87.0
path: .spaces[0].metrics.nom.functions
old: 3.0
new: 2.0
path: .spaces[0].metrics.nom.total
old: 3.0
new: 2.0
path: .spaces[0].metrics.cyclomatic.sum
old: 14.0
new: 7.0
path: .spaces[0].metrics.loc.sloc
old: 138.0
new: 57.0
path: .spaces[0].metrics.loc.cloc
old: 35.0
new: 14.0
path: .spaces[0].metrics.loc.lloc
old: 0.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 83.0
new: 38.0
path: .spaces[0].metrics.loc.blank
old: 20.0
new: 5.0
path: .spaces[0].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[0].metrics.nexits.average
old: 0.0
new: 0.5
path: .spaces[0].metrics.mi.mi_original
old: 47.580745853173326
new: 68.77773225203806
path: .spaces[0].metrics.mi.mi_sei
old: 29.539838273101974
new: 58.96387688329972
path: .spaces[0].metrics.mi.mi_visual_studio
old: 27.82499757495516
new: 40.22089605382343
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 0.0
path: .spaces[0].metrics.nargs.sum
old: 3.0
new: 0.0
Code
namespace mozilla {
namespace plugins {
class PluginWidgetChild;
} // namespace plugins
namespace widget {
class PluginWidgetProxy final : public PuppetWidget {
public:
explicit PluginWidgetProxy(dom::BrowserChild* aBrowserChild,
mozilla::plugins::PluginWidgetChild* aChannel);
protected:
virtual ~PluginWidgetProxy();
public:
NS_DECL_ISUPPORTS_INHERITED
// nsIWidget
using PuppetWidget::Create; // for Create signature not overridden here
[[nodiscard]] virtual nsresult Create(
nsIWidget* aParent, nsNativeWidget aNativeParent,
const LayoutDeviceIntRect& aRect,
nsWidgetInitData* aInitData = nullptr) override;
virtual void Destroy() override;
virtual void SetFocus(Raise, mozilla::dom::CallerType aCallerType) override;
virtual void SetParent(nsIWidget* aNewParent) override;
virtual nsIWidget* GetParent(void) override;
virtual void* GetNativeData(uint32_t aDataType) override;
void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
virtual nsTransparencyMode GetTransparencyMode() override {
return eTransparencyOpaque;
}
virtual void GetWindowClipRegion(
nsTArray* aRects) override;
public:
/**
* When tabs are closed PPluginWidget can terminate before plugin code is
* finished tearing us down. When this happens plugin calls over mActor
* fail triggering an abort in the content process. To protect against this
* the connection tells us when it is torn down here so we can avoid making
* calls while content finishes tearing us down.
*/
void ChannelDestroyed() { mActor = nullptr; }
private:
// Our connection with the chrome widget, created on PBrowser.
mozilla::plugins::PluginWidgetChild* mActor;
// PuppetWidget does not implement parent apis, but we need
// them for plugin widgets.
nsCOMPtr mParent;
uintptr_t mCachedPluginPort;
};
} // namespace widget
} // namespace mozilla
Minimal test - lines (26, 77)
path: .spaces[0].spaces[1].metrics.nexits.average
old: null
new: 0.5
path: .spaces[0].spaces[1].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[0].spaces[1].metrics.cyclomatic.sum
old: 1.0
new: 4.0
path: .spaces[0].spaces[1].metrics.loc.cloc
old: 0.0
new: 12.0
path: .spaces[0].spaces[1].metrics.loc.ploc
old: 1.0
new: 33.0
path: .spaces[0].spaces[1].metrics.loc.lloc
old: 0.0
new: 2.0
path: .spaces[0].spaces[1].metrics.loc.blank
old: 0.0
new: 7.0
path: .spaces[0].spaces[1].metrics.loc.sloc
old: 1.0
new: 52.0
path: .spaces[0].spaces[1].metrics.cognitive.average
old: null
new: 0.0
path: .spaces[0].spaces[1].metrics.nargs.average
old: null
new: 0.0
path: .spaces[0].spaces[1].metrics.nom.functions
old: 0.0
new: 2.0
path: .spaces[0].spaces[1].metrics.nom.total
old: 0.0
new: 2.0
path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 1.0
new: 58.0
path: .spaces[0].spaces[1].metrics.halstead.N2
old: 1.0
new: 55.0
path: .spaces[0].spaces[1].metrics.halstead.n1
old: 0.0
new: 14.0
path: .spaces[0].spaces[1].metrics.halstead.N1
old: 0.0
new: 84.0
path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 0.0
new: 8.75
path: .spaces[0].spaces[1].metrics.halstead.volume
old: 0.0
new: 814.2593583227325
path: .spaces[0].spaces[1].metrics.halstead.level
old: null
new: 0.11428571428571428
path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.0
new: 0.12342201137562418
path: .spaces[0].spaces[1].metrics.halstead.effort
old: 0.0
new: 7124.76938532391
path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: null
new: 293.5179601288475
path: .spaces[0].spaces[1].metrics.halstead.length
old: 1.0
new: 139.0
path: .spaces[0].spaces[1].metrics.halstead.n2
old: 1.0
new: 44.0
path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: null
new: 2.1116400009269607
path: .spaces[0].spaces[1].metrics.halstead.time
old: 0.0
new: 395.8205214068838
path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: null
new: 61.32177012460091
path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: null
new: 41.64795396793538
path: .spaces[0].spaces[1].metrics.mi.mi_original
old: null
new: 71.21800128516949
Code
namespace widget {
class PluginWidgetProxy final : public PuppetWidget {
public:
explicit PluginWidgetProxy(dom::BrowserChild* aBrowserChild,
mozilla::plugins::PluginWidgetChild* aChannel);
protected:
virtual ~PluginWidgetProxy();
public:
NS_DECL_ISUPPORTS_INHERITED
// nsIWidget
using PuppetWidget::Create; // for Create signature not overridden here
[[nodiscard]] virtual nsresult Create(
nsIWidget* aParent, nsNativeWidget aNativeParent,
const LayoutDeviceIntRect& aRect,
nsWidgetInitData* aInitData = nullptr) override;
virtual void Destroy() override;
virtual void SetFocus(Raise, mozilla::dom::CallerType aCallerType) override;
virtual void SetParent(nsIWidget* aNewParent) override;
virtual nsIWidget* GetParent(void) override;
virtual void* GetNativeData(uint32_t aDataType) override;
void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
virtual nsTransparencyMode GetTransparencyMode() override {
return eTransparencyOpaque;
}
virtual void GetWindowClipRegion(
nsTArray* aRects) override;
public:
/**
* When tabs are closed PPluginWidget can terminate before plugin code is
* finished tearing us down. When this happens plugin calls over mActor
* fail triggering an abort in the content process. To protect against this
* the connection tells us when it is torn down here so we can avoid making
* calls while content finishes tearing us down.
*/
void ChannelDestroyed() { mActor = nullptr; }
private:
// Our connection with the chrome widget, created on PBrowser.
mozilla::plugins::PluginWidgetChild* mActor;
// PuppetWidget does not implement parent apis, but we need
// them for plugin widgets.
nsCOMPtr mParent;
uintptr_t mCachedPluginPort;
};
} // namespace widget