# Global Metrics

path: .metrics.cyclomatic.average
old: 3.230769230769231
new: 3.4
path: .metrics.cyclomatic.sum
old: 672.0
new: 17.0
path: .metrics.nexits.average
old: 3.581081081081081
new: 2.0
path: .metrics.nexits.sum
old: 265.0
new: 4.0
path: .metrics.cognitive.sum
old: 576.0
new: 10.0
path: .metrics.cognitive.average
old: 7.783783783783784
new: 5.0
path: .metrics.loc.blank
old: 214.0
new: 4.0
path: .metrics.loc.lloc
old: 1088.0
new: 14.0
path: .metrics.loc.ploc
old: 2152.0
new: 38.0
path: .metrics.loc.cloc
old: 327.0
new: 8.0
path: .metrics.loc.sloc
old: 2693.0
new: 50.0
path: .metrics.halstead.time
old: 675775.1071011039
new: 727.3338825554097
path: .metrics.halstead.vocabulary
old: 978.0
new: 52.0
path: .metrics.halstead.purity_ratio
old: 0.9020852470793118
new: 1.573064780200775
path: .metrics.halstead.n2
old: 928.0
new: 36.0
path: .metrics.halstead.n1
old: 50.0
new: 16.0
path: .metrics.halstead.volume
old: 103846.80210687064
new: 906.3699151844336
path: .metrics.halstead.level
old: 0.008537258509659614
new: 0.06923076923076923
path: .metrics.halstead.estimated_program_length
old: 9430.399172967123
new: 250.1173000519232
path: .metrics.halstead.length
old: 10454.0
new: 159.0
path: .metrics.halstead.effort
old: 12163951.92781987
new: 13092.009885997377
path: .metrics.halstead.difficulty
old: 117.13362068965516
new: 14.444444444444445
path: .metrics.halstead.bugs
old: 17.630388213080877
new: 0.18516104720514528
path: .metrics.halstead.N1
old: 6106.0
new: 94.0
path: .metrics.halstead.N2
old: 4348.0
new: 65.0
path: .metrics.nargs.sum
old: 114.0
new: 6.0
path: .metrics.nargs.average
old: 1.5405405405405406
new: 3.0
path: .metrics.nom.functions
old: 74.0
new: 2.0
path: .metrics.nom.total
old: 74.0
new: 2.0
path: .metrics.mi.mi_sei
old: -229.11254353846587
new: 53.61358369452275
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 39.94508784821405
path: .metrics.mi.mi_original
old: -171.57775428785772
new: 68.30610022044603

# Spaces Data

## Minimal test - lines (11, 50)

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.nexits.average
old: 4.0
new: 2.0
path: .spaces[0].metrics.nargs.sum
old: 3.0
new: 6.0
path: .spaces[0].metrics.loc.cloc
old: 1.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 20.0
new: 35.0
path: .spaces[0].metrics.loc.lloc
old: 10.0
new: 14.0
path: .spaces[0].metrics.loc.sloc
old: 24.0
new: 40.0
path: .spaces[0].metrics.cognitive.average
old: 4.0
new: 5.0
path: .spaces[0].metrics.cognitive.sum
old: 4.0
new: 10.0
path: .spaces[0].metrics.mi.mi_original
old: 86.93159160917236
new: 72.32887406471322
path: .spaces[0].metrics.mi.mi_visual_studio
old: 50.83718807553939
new: 42.29758717234691
path: .spaces[0].metrics.mi.mi_sei
old: 65.77320306150645
new: 47.25294413127359
path: .spaces[0].metrics.cyclomatic.sum
old: 5.0
new: 16.0
path: .spaces[0].metrics.cyclomatic.average
old: 5.0
new: 4.0
path: .spaces[0].metrics.halstead.bugs
old: 0.12000568412031644
new: 0.18584826616521752
path: .spaces[0].metrics.halstead.vocabulary
old: 30.0
new: 49.0
path: .spaces[0].metrics.halstead.difficulty
old: 16.1875
new: 15.030303030303031
path: .spaces[0].metrics.halstead.volume
old: 421.99259122233263
new: 875.8947356819725
path: .spaces[0].metrics.halstead.estimated_program_length
old: 117.30296890880646
new: 230.46500593882897
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.363988010567517
new: 1.47733978165916
path: .spaces[0].metrics.halstead.length
old: 86.0
new: 156.0
path: .spaces[0].metrics.halstead.time
old: 379.50028168952826
new: 731.386849997068
path: .spaces[0].metrics.halstead.N1
old: 49.0
new: 94.0
path: .spaces[0].metrics.halstead.N2
old: 37.0
new: 62.0
path: .spaces[0].metrics.halstead.effort
old: 6831.005070411509
new: 13164.963299947223
path: .spaces[0].metrics.halstead.level
old: 0.06177606177606178
new: 0.06653225806451613
path: .spaces[0].metrics.halstead.n2
old: 16.0
new: 33.0
path: .spaces[0].metrics.halstead.n1
old: 14.0
new: 16.0

### Code

    namespace mozilla {
    namespace widget {

    WindowSurfaceX11::WindowSurfaceX11(Display* aDisplay, Window aWindow,
                                       Visual* aVisual, unsigned int aDepth)
        : mDisplay(aDisplay),
          mWindow(aWindow),
          mVisual(aVisual),
          mDepth(aDepth),
          mFormat(GetVisualFormat(aVisual, aDepth)) {}

    /* static */
    gfx::SurfaceFormat WindowSurfaceX11::GetVisualFormat(const Visual* aVisual,
                                                         unsigned int aDepth) {
      switch (aDepth) {
        case 32:
          if (aVisual->red_mask == 0xff0000 && aVisual->green_mask == 0xff00 &&
              aVisual->blue_mask == 0xff) {
            return gfx::SurfaceFormat::B8G8R8A8;
          }
          break;
        case 24:
          if (aVisual->red_mask == 0xff0000 && aVisual->green_mask == 0xff00 &&
              aVisual->blue_mask == 0xff) {
            return gfx::SurfaceFormat::B8G8R8X8;
          }
          break;
        case 16:
          if (aVisual->red_mask == 0xf800 && aVisual->green_mask == 0x07e0 &&
              aVisual->blue_mask == 0x1f) {
            return gfx::SurfaceFormat::R5G6B5_UINT16;
          }
          break;
      }

      return gfx::SurfaceFormat::UNKNOWN;
    }

    }  // namespace widget
    }  // namespace mozilla