# Global Metrics

path: .metrics.nexits.sum
old: 82.0
new: 1.0
path: .metrics.nexits.average
old: 1.1714285714285717
new: 0.3333333333333333
path: .metrics.nargs.average
old: 0.2714285714285714
new: 2.0
path: .metrics.nargs.sum
old: 19.0
new: 6.0
path: .metrics.nom.total
old: 70.0
new: 3.0
path: .metrics.nom.closures
old: 2.0
new: 0.0
path: .metrics.nom.functions
old: 68.0
new: 3.0
path: .metrics.loc.lloc
old: 212.0
new: 5.0
path: .metrics.loc.blank
old: 86.0
new: 5.0
path: .metrics.loc.cloc
old: 105.0
new: 6.0
path: .metrics.loc.ploc
old: 514.0
new: 16.0
path: .metrics.loc.sloc
old: 705.0
new: 27.0
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 49.460226431833526
path: .metrics.mi.mi_sei
old: -65.19673640944501
new: 80.18158386854716
path: .metrics.mi.mi_original
old: -22.88410507119876
new: 84.57698719843532
path: .metrics.cyclomatic.sum
old: 151.0
new: 5.0
path: .metrics.cyclomatic.average
old: 2.0684931506849313
new: 1.0
path: .metrics.halstead.length
old: 3147.0
new: 87.0
path: .metrics.halstead.volume
old: 26245.507959077913
new: 459.82999304101565
path: .metrics.halstead.N1
old: 1949.0
new: 47.0
path: .metrics.halstead.estimated_program_length
old: 2533.1444478294757
new: 168.64245895143551
path: .metrics.halstead.purity_ratio
old: 0.8049394495803863
new: 1.9384190684073048
path: .metrics.halstead.vocabulary
old: 324.0
new: 39.0
path: .metrics.halstead.effort
old: 2088812.0705053548
new: 5747.874913012695
path: .metrics.halstead.N2
old: 1198.0
new: 40.0
path: .metrics.halstead.n1
old: 38.0
new: 15.0
path: .metrics.halstead.bugs
old: 5.446844675388321
new: 0.10695890565800882
path: .metrics.halstead.difficulty
old: 79.58741258741259
new: 12.5
path: .metrics.halstead.n2
old: 286.0
new: 24.0
path: .metrics.halstead.time
old: 116045.11502807526
new: 319.32638405626085
path: .metrics.halstead.level
old: 0.0125648009840963
new: 0.08
path: .metrics.cognitive.average
old: 1.1285714285714286
new: 0.0
path: .metrics.cognitive.sum
old: 79.0
new: 0.0

# Spaces Data

## Minimal test - lines (9, 27)

path: .spaces[0].metrics.halstead.n1
old: 38.0
new: 15.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 2437.373995581631
new: 162.64528392343908
path: .spaces[0].metrics.halstead.n2
old: 276.0
new: 23.0
path: .spaces[0].metrics.halstead.time
old: 117448.67758128332
new: 318.86863913206133
path: .spaces[0].metrics.halstead.level
old: 0.012268847795163584
new: 0.07863247863247863
path: .spaces[0].metrics.halstead.N1
old: 1943.0
new: 47.0
path: .spaces[0].metrics.halstead.N2
old: 1184.0
new: 39.0
path: .spaces[0].metrics.halstead.bugs
old: 5.490676240347021
new: 0.1068566662708484
path: .spaces[0].metrics.halstead.vocabulary
old: 314.0
new: 38.0
path: .spaces[0].metrics.halstead.length
old: 3127.0
new: 86.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.7794608236589802
new: 1.891224231667896
path: .spaces[0].metrics.halstead.effort
old: 2114076.1964630997
new: 5739.635504377104
path: .spaces[0].metrics.halstead.volume
old: 25937.27908178412
new: 451.3217661561483
path: .spaces[0].metrics.halstead.difficulty
old: 81.5072463768116
new: 12.717391304347826
path: .spaces[0].metrics.cyclomatic.average
old: 2.0833333333333335
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 150.0
new: 4.0
path: .spaces[0].metrics.mi.mi_sei
old: -64.36657390946672
new: 55.40990903421515
path: .spaces[0].metrics.mi.mi_original
old: -22.03157946958356
new: 90.5967497525138
path: .spaces[0].metrics.mi.mi_visual_studio
old: 0.0
new: 52.980555410826774
path: .spaces[0].metrics.cognitive.sum
old: 79.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 1.1285714285714286
new: 0.0
path: .spaces[0].metrics.loc.lloc
old: 212.0
new: 5.0
path: .spaces[0].metrics.loc.cloc
old: 99.0
new: 0.0
path: .spaces[0].metrics.loc.sloc
old: 681.0
new: 19.0
path: .spaces[0].metrics.loc.blank
old: 81.0
new: 4.0
path: .spaces[0].metrics.loc.ploc
old: 501.0
new: 15.0
path: .spaces[0].metrics.nexits.sum
old: 82.0
new: 1.0
path: .spaces[0].metrics.nexits.average
old: 1.1714285714285717
new: 0.3333333333333333
path: .spaces[0].metrics.nargs.sum
old: 19.0
new: 6.0
path: .spaces[0].metrics.nargs.average
old: 0.2714285714285714
new: 2.0
path: .spaces[0].metrics.nom.closures
old: 2.0
new: 0.0
path: .spaces[0].metrics.nom.total
old: 70.0
new: 3.0
path: .spaces[0].metrics.nom.functions
old: 68.0
new: 3.0

### Code

    namespace mozilla::widget {

    WindowSurfaceX11SHM::WindowSurfaceX11SHM(Display* aDisplay, Drawable aWindow,
                                             Visual* aVisual, unsigned int aDepth) {
      mFrontImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
      mBackImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
    }

    already_AddRefed WindowSurfaceX11SHM::Lock(
        const LayoutDeviceIntRegion& aRegion) {
      mBackImage.swap(mFrontImage);
      return mBackImage->CreateDrawTarget(aRegion);
    }

    void WindowSurfaceX11SHM::Commit(const LayoutDeviceIntRegion& aInvalidRegion) {
      mBackImage->Put(aInvalidRegion);
    }

    }  // namespace mozilla::widget

## Minimal test - lines (23, 25)

path: .spaces[0].spaces[2].metrics.loc.ploc
old: 5.0
new: 3.0
path: .spaces[0].spaces[2].metrics.loc.sloc
old: 5.0
new: 3.0
path: .spaces[0].spaces[2].metrics.loc.lloc
old: 3.0
new: 1.0
path: .spaces[0].spaces[2].metrics.nargs.average
old: 0.0
new: 1.0
path: .spaces[0].spaces[2].metrics.nargs.sum
old: 0.0
new: 1.0
path: .spaces[0].spaces[2].metrics.halstead.N1
old: 13.0
new: 8.0
path: .spaces[0].spaces[2].metrics.halstead.N2
old: 7.0
new: 6.0
path: .spaces[0].spaces[2].metrics.halstead.vocabulary
old: 11.0
new: 12.0
path: .spaces[0].spaces[2].metrics.halstead.volume
old: 69.18863237274594
new: 50.18947501009619
path: .spaces[0].spaces[2].metrics.halstead.effort
old: 290.59225596553296
new: 210.795795042404
path: .spaces[0].spaces[2].metrics.halstead.n1
old: 6.0
new: 7.0
path: .spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 1.3559707739381874
new: 2.2329374949171457
path: .spaces[0].spaces[2].metrics.halstead.estimated_program_length
old: 27.11941547876375
new: 31.26112492884004
path: .spaces[0].spaces[2].metrics.halstead.time
old: 16.144014220307387
new: 11.710877502355778
path: .spaces[0].spaces[2].metrics.halstead.bugs
old: 0.014624064806680482
new: 0.01180646926336541
path: .spaces[0].spaces[2].metrics.halstead.length
old: 20.0
new: 14.0
path: .spaces[0].spaces[2].metrics.mi.mi_original
old: 122.665555617859
new: 132.6102931370529
path: .spaces[0].spaces[2].metrics.mi.mi_sei
old: 101.3699566451662
new: 115.71718014704972
path: .spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 71.73424305137954
new: 77.54987902751634

### Code

    void WindowSurfaceX11SHM::Commit(const LayoutDeviceIntRegion& aInvalidRegion) {
      mBackImage->Put(aInvalidRegion);
    }

## Minimal test - lines (17, 21)

path: .spaces[0].spaces[1].metrics.mi.mi_original
old: 128.2308890745831
new: 120.43750918471346
path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: 109.39903562407548
new: 98.1555651051968
path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 74.98882402022403
new: 70.43129192088506
path: .spaces[0].spaces[1].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[0].spaces[1].metrics.nexits.average
old: 0.0
new: 1.0
path: .spaces[0].spaces[1].metrics.nargs.average
old: 0.0
new: 1.0
path: .spaces[0].spaces[1].metrics.nargs.sum
old: 0.0
new: 1.0
path: .spaces[0].spaces[1].metrics.halstead.N2
old: 5.0
new: 11.0
path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 9.0
new: 19.0
path: .spaces[0].spaces[1].metrics.halstead.n2
old: 3.0
new: 9.0
path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 20.264662506490403
new: 61.74860596185444
path: .spaces[0].spaces[1].metrics.halstead.N1
old: 10.0
new: 14.0
path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.012792406331498463
new: 0.024986395079283148
path: .spaces[0].spaces[1].metrics.halstead.effort
old: 237.7443751081734
new: 648.9889256649922
path: .spaces[0].spaces[1].metrics.halstead.level
old: 0.2
new: 0.16363636363636364
path: .spaces[0].spaces[1].metrics.halstead.time
old: 13.208020839342968
new: 36.05494031472179
path: .spaces[0].spaces[1].metrics.halstead.length
old: 15.0
new: 25.0
path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 5.0
new: 6.111111111111111
path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 1.3509775004326936
new: 2.4699442384741777
path: .spaces[0].spaces[1].metrics.halstead.volume
old: 47.548875021634686
new: 106.19818783608964
path: .spaces[0].spaces[1].metrics.halstead.n1
old: 6.0
new: 10.0
path: .spaces[0].spaces[1].metrics.loc.sloc
old: 4.0
new: 5.0
path: .spaces[0].spaces[1].metrics.loc.ploc
old: 4.0
new: 5.0

### Code

    already_AddRefed WindowSurfaceX11SHM::Lock(
        const LayoutDeviceIntRegion& aRegion) {
      mBackImage.swap(mFrontImage);
      return mBackImage->CreateDrawTarget(aRegion);
    }

## Minimal test - lines (11, 15)

path: .spaces[0].spaces[0].metrics.nargs.average
old: null
new: 4.0
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 0.0
new: 4.0
path: .spaces[0].spaces[0].metrics.cognitive.average
old: null
new: 0.0
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 119.9182600710316
new: 93.9574777749936
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 116.36888622012586
new: 117.52761678803869
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 68.05198024568763
new: 68.72960046084133
path: .spaces[0].spaces[0].metrics.nom.total
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].metrics.nom.functions
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 9.0
new: 11.0
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.6604238642264002
new: 1.5484435539067694
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 36.529325012980806
new: 66.58307281799108
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 2.0
new: 8.181818181818182
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 9.0
new: 20.0
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 13.0
new: 20.0
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 13.0
new: 23.0
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.009939153977950322
new: 0.04407672215390553
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.5
new: 0.12222222222222222
path: .spaces[0].spaces[0].metrics.halstead.length
old: 22.0
new: 43.0
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 162.81934759820803
new: 1520.5328842921904
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 81.40967379910403
new: 185.8429080801566
path: .spaces[0].spaces[0].metrics.halstead.time
old: 9.045519311011558
new: 84.4740491273439
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 4.0
new: 9.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 7.0
new: 5.0
path: .spaces[0].spaces[0].metrics.loc.lloc
old: 0.0
new: 2.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 6.0
new: 5.0
path: .spaces[0].spaces[0].metrics.loc.cloc
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nexits.average
old: null
new: 0.0

### Code

    WindowSurfaceX11SHM::WindowSurfaceX11SHM(Display* aDisplay, Drawable aWindow,
                                             Visual* aVisual, unsigned int aDepth) {
      mFrontImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
      mBackImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
    }