Global Metrics
path: .metrics.cognitive.average
old: 1.0
new: 0.0
path: .metrics.cognitive.sum
old: 1.0
new: 0.0
path: .metrics.halstead.effort
old: 5234.807694659977
new: 1855.1414925143415
path: .metrics.halstead.length
old: 90.0
new: 47.0
path: .metrics.halstead.bugs
old: 0.1004953344852172
new: 0.05032650501275717
path: .metrics.halstead.difficulty
old: 11.083333333333334
new: 8.125
path: .metrics.halstead.vocabulary
old: 38.0
new: 29.0
path: .metrics.halstead.purity_ratio
old: 1.8149118769568244
new: 2.3852280071454084
path: .metrics.halstead.N2
old: 38.0
new: 20.0
path: .metrics.halstead.N1
old: 52.0
new: 27.0
path: .metrics.halstead.level
old: 0.09022556390977444
new: 0.12307692307692308
path: .metrics.halstead.n2
old: 24.0
new: 16.0
path: .metrics.halstead.time
old: 290.82264970333205
new: 103.06341625079676
path: .metrics.halstead.estimated_program_length
old: 163.3420689261142
new: 112.1057163358342
path: .metrics.halstead.n1
old: 14.0
new: 13.0
path: .metrics.halstead.volume
old: 472.3134762099226
new: 228.3251067709959
path: .metrics.cyclomatic.sum
old: 4.0
new: 6.0
path: .metrics.cyclomatic.average
old: 1.3333333333333333
new: 1.0
path: .metrics.nargs.average
old: 2.0
new: 0.0
path: .metrics.nargs.sum
old: 2.0
new: 0.0
path: .metrics.nexits.average
old: 0.0
new: 0.5
path: .metrics.nexits.sum
old: 0.0
new: 1.0
path: .metrics.nom.functions
old: 1.0
new: 2.0
path: .metrics.nom.total
old: 1.0
new: 2.0
path: .metrics.loc.ploc
old: 23.0
new: 17.0
path: .metrics.loc.sloc
old: 41.0
new: 38.0
path: .metrics.loc.lloc
old: 4.0
new: 1.0
path: .metrics.loc.cloc
old: 12.0
new: 15.0
path: .metrics.mi.mi_sei
old: 74.26215973112349
new: 85.19999440450775
path: .metrics.mi.mi_original
old: 77.9003893892012
new: 82.45109750736705
path: .metrics.mi.mi_visual_studio
old: 45.55578326853871
new: 48.21701608617956
Spaces Data
Minimal test - lines (14, 35)
path: .spaces[0].spaces[0].metrics.nom.functions
old: 1.0
new: 2.0
path: .spaces[0].spaces[0].metrics.nom.total
old: 1.0
new: 2.0
path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].metrics.cognitive.average
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].metrics.loc.cloc
old: 0.0
new: 7.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 16.0
new: 10.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 17.0
new: 22.0
path: .spaces[0].spaces[0].metrics.loc.lloc
old: 4.0
new: 1.0
path: .spaces[0].spaces[0].metrics.loc.blank
old: 1.0
new: 5.0
path: .spaces[0].spaces[0].metrics.nexits.average
old: 0.0
new: 0.5
path: .spaces[0].spaces[0].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 2.0
new: 4.0
path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 93.08090520912296
new: 92.70970300709556
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 54.43327790007191
new: 54.21620058894477
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 58.79014807345358
new: 96.79896256867896
path: .spaces[0].spaces[0].metrics.halstead.length
old: 85.0
new: 41.0
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 34.0
new: 15.0
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.08403361344537814
new: 0.12307692307692308
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 5145.968663924718
new: 1546.9845932187052
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 139.7415308065537
new: 91.12526634448808
path: .spaces[0].spaces[0].metrics.halstead.time
old: 285.8871479958177
new: 85.94358851215028
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 20.0
new: 12.0
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 34.0
new: 25.0
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 11.9
new: 8.125
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.644018009488867
new: 2.2225674718167823
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 14.0
new: 13.0
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 51.0
new: 26.0
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 432.4343415062788
new: 190.3981037807637
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.09935510121828026
new: 0.04458643384712257
path: .spaces[0].spaces[0].metrics.nargs.average
old: 2.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 2.0
new: 0.0
Code
namespace widget {
// A class for drawing to double-buffered windows.
class WindowSurface {
public:
virtual ~WindowSurface() = default;
// Locks a region of the window for drawing, returning a draw target
// capturing the bounds of the provided region.
// Implementations must permit invocation from any thread.
virtual already_AddRefed Lock(
const LayoutDeviceIntRegion& aRegion) = 0;
// Swaps the provided invalid region from the back buffer to the window.
// Implementations must permit invocation from any thread.
virtual void Commit(const LayoutDeviceIntRegion& aInvalidRegion) = 0;
// Whether the window surface represents a fallback method.
virtual bool IsFallback() const { return false; }
};
} // namespace widget
Minimal test - lines (13, 36)
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 2.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 2.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 51.33944378621974
new: 53.07571685820053
path: .spaces[0].metrics.mi.mi_original
old: 87.79044887443575
new: 90.75947582752292
path: .spaces[0].metrics.mi.mi_sei
old: 73.31482093728931
new: 94.73902551430548
path: .spaces[0].metrics.cyclomatic.average
old: 1.5
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 3.0
new: 5.0
path: .spaces[0].metrics.cognitive.average
old: 1.0
new: 0.0
path: .spaces[0].metrics.cognitive.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.halstead.difficulty
old: 11.666666666666666
new: 8.0
path: .spaces[0].metrics.halstead.level
old: 0.08571428571428572
new: 0.125
path: .spaces[0].metrics.halstead.N2
old: 35.0
new: 16.0
path: .spaces[0].metrics.halstead.effort
old: 5206.2222621991405
new: 1616.9512630405357
path: .spaces[0].metrics.halstead.bugs
old: 0.1001291544077463
new: 0.04592086201053621
path: .spaces[0].metrics.halstead.N1
old: 52.0
new: 27.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 145.54163478716043
new: 96.2114326716684
path: .spaces[0].metrics.halstead.n1
old: 14.0
new: 13.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.6728923538754072
new: 2.2374751784108926
path: .spaces[0].metrics.halstead.volume
old: 446.2476224742121
new: 202.11890788006696
path: .spaces[0].metrics.halstead.n2
old: 21.0
new: 13.0
path: .spaces[0].metrics.halstead.vocabulary
old: 35.0
new: 26.0
path: .spaces[0].metrics.halstead.length
old: 87.0
new: 43.0
path: .spaces[0].metrics.halstead.time
old: 289.2345701221745
new: 89.8306257244742
path: .spaces[0].metrics.loc.cloc
old: 2.0
new: 8.0
path: .spaces[0].metrics.loc.ploc
old: 18.0
new: 12.0
path: .spaces[0].metrics.loc.sloc
old: 23.0
new: 24.0
path: .spaces[0].metrics.loc.blank
old: 3.0
new: 4.0
path: .spaces[0].metrics.loc.lloc
old: 4.0
new: 1.0
path: .spaces[0].metrics.nargs.sum
old: 2.0
new: 0.0
path: .spaces[0].metrics.nargs.average
old: 2.0
new: 0.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
Code
namespace mozilla {
namespace widget {
// A class for drawing to double-buffered windows.
class WindowSurface {
public:
virtual ~WindowSurface() = default;
// Locks a region of the window for drawing, returning a draw target
// capturing the bounds of the provided region.
// Implementations must permit invocation from any thread.
virtual already_AddRefed Lock(
const LayoutDeviceIntRegion& aRegion) = 0;
// Swaps the provided invalid region from the back buffer to the window.
// Implementations must permit invocation from any thread.
virtual void Commit(const LayoutDeviceIntRegion& aInvalidRegion) = 0;
// Whether the window surface represents a fallback method.
virtual bool IsFallback() const { return false; }
};
} // namespace widget
} // namespace mozilla