# Global Metrics

path: .metrics.cyclomatic.sum
old: 191.0
new: 7.0
path: .metrics.cyclomatic.average
old: 5.787878787878788
new: 1.0
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 43.878956363532666
path: .metrics.mi.mi_original
old: -36.77013033445364
new: 75.03301538164085
path: .metrics.mi.mi_sei
old: -86.94895949276463
new: 61.405747931751506
path: .metrics.nargs.average
old: 4.3076923076923075
new: 0.3333333333333333
path: .metrics.nargs.sum
old: 112.0
new: 1.0
path: .metrics.nom.total
old: 26.0
new: 3.0
path: .metrics.nom.functions
old: 26.0
new: 3.0
path: .metrics.loc.cloc
old: 75.0
new: 7.0
path: .metrics.loc.sloc
old: 838.0
new: 47.0
path: .metrics.loc.ploc
old: 696.0
new: 29.0
path: .metrics.loc.lloc
old: 323.0
new: 0.0
path: .metrics.loc.blank
old: 67.0
new: 11.0
path: .metrics.halstead.N2
old: 1968.0
new: 36.0
path: .metrics.halstead.effort
old: 4481831.580851038
new: 3377.747633628616
path: .metrics.halstead.volume
old: 37722.31604687527
new: 469.1316157817522
path: .metrics.halstead.bugs
old: 9.061131509390954
new: 0.07504070016220885
path: .metrics.halstead.length
old: 4438.0
new: 87.0
path: .metrics.halstead.level
old: 0.008416718782572441
new: 0.1388888888888889
path: .metrics.halstead.difficulty
old: 118.81114551083591
new: 7.2
path: .metrics.halstead.N1
old: 2470.0
new: 51.0
path: .metrics.halstead.time
old: 248990.6433806132
new: 187.65264631270088
path: .metrics.halstead.vocabulary
old: 362.0
new: 42.0
path: .metrics.halstead.n2
old: 323.0
new: 30.0
path: .metrics.halstead.purity_ratio
old: 0.6531008947953505
new: 2.186508826171373
path: .metrics.halstead.estimated_program_length
old: 2898.4617711017654
new: 190.22626787690945
path: .metrics.halstead.n1
old: 39.0
new: 12.0
path: .metrics.cognitive.average
old: 7.8076923076923075
new: 0.0
path: .metrics.cognitive.sum
old: 203.0
new: 0.0
path: .metrics.nexits.average
old: 1.3461538461538465
new: 0.0
path: .metrics.nexits.sum
old: 35.0
new: 0.0

# Spaces Data

## Minimal test - lines (14, 45)

path: .spaces[0].metrics.loc.ploc
old: 4.0
new: 22.0
path: .spaces[0].metrics.loc.sloc
old: 4.0
new: 32.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 7.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 3.0
path: .spaces[0].metrics.loc.lloc
old: 2.0
new: 0.0
path: .spaces[0].metrics.mi.mi_original
old: 124.56873074920276
new: 81.83937385881141
path: .spaces[0].metrics.mi.mi_sei
old: 104.21747782850352
new: 65.81697004897666
path: .spaces[0].metrics.mi.mi_visual_studio
old: 72.84721096444605
new: 47.85928295836925
path: .spaces[0].metrics.halstead.vocabulary
old: 16.0
new: 39.0
path: .spaces[0].metrics.halstead.bugs
old: 0.021893168468250224
new: 0.07116631496131502
path: .spaces[0].metrics.halstead.estimated_program_length
old: 48.18080946738404
new: 171.40151256706753
path: .spaces[0].metrics.halstead.purity_ratio
old: 2.094817802929741
new: 2.0650784646634643
path: .spaces[0].metrics.halstead.time
old: 29.57142857142857
new: 173.30899127528556
path: .spaces[0].metrics.halstead.length
old: 23.0
new: 83.0
path: .spaces[0].metrics.halstead.N2
old: 9.0
new: 32.0
path: .spaces[0].metrics.halstead.n2
old: 7.0
new: 27.0
path: .spaces[0].metrics.halstead.N1
old: 14.0
new: 51.0
path: .spaces[0].metrics.halstead.volume
old: 92.0
new: 438.6883841655666
path: .spaces[0].metrics.halstead.n1
old: 9.0
new: 12.0
path: .spaces[0].metrics.halstead.level
old: 0.1728395061728395
new: 0.140625
path: .spaces[0].metrics.halstead.difficulty
old: 5.785714285714286
new: 7.111111111111111
path: .spaces[0].metrics.halstead.effort
old: 532.2857142857142
new: 3119.56184295514
path: .spaces[0].metrics.nom.total
old: 1.0
new: 3.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 3.0
path: .spaces[0].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 2.0
new: 6.0
path: .spaces[0].metrics.nargs.average
old: 2.0
new: 0.3333333333333333
path: .spaces[0].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[0].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 1.0
new: 0.0

### Code

    namespace mozilla {
    namespace widget {

    class MediaHardwareKeysEventSourceMac final
        : public mozilla::dom::MediaControlKeySource {
     public:
      NS_INLINE_DECL_REFCOUNTING(MediaHardwareKeysEventSourceMac, override)
      MediaHardwareKeysEventSourceMac() = default;

      static CGEventRef EventTapCallback(CGEventTapProxy proxy, CGEventType type,
                                         CGEventRef event, void* refcon);

      bool Open() override;
      void Close() override;
      bool IsOpened() const override;

      // Currently we don't support showing supported keys on the touch bar.
      void SetSupportedMediaKeys(const MediaKeysArray& aSupportedKeys) override {}

     private:
      ~MediaHardwareKeysEventSourceMac() = default;

      bool StartEventTap();
      void StopEventTap();

      // They are used to intercept mac hardware media keys.
      CFMachPortRef mEventTap = nullptr;
      CFRunLoopSourceRef mEventTapSource = nullptr;
    };

    }  // namespace widget
    }  // namespace mozilla