# Global Metrics

path: .metrics.cognitive.average
old: 7.4
new: 0.0
path: .metrics.cognitive.sum
old: 37.0
new: 0.0
path: .metrics.nom.functions
old: 5.0
new: 1.0
path: .metrics.nom.total
old: 5.0
new: 1.0
path: .metrics.nargs.sum
old: 10.0
new: 0.0
path: .metrics.nargs.average
old: 2.0
new: 0.0
path: .metrics.halstead.time
old: 11998.103570731648
new: 163.73742093035787
path: .metrics.halstead.N1
old: 389.0
new: 48.0
path: .metrics.halstead.estimated_program_length
old: 597.0539236933809
new: 167.82521876648653
path: .metrics.halstead.n2
old: 76.0
new: 28.0
path: .metrics.halstead.n1
old: 26.0
new: 10.0
path: .metrics.halstead.bugs
old: 1.1998735680518346
new: 0.06852131868140754
path: .metrics.halstead.effort
old: 215965.8642731697
new: 2947.273576746442
path: .metrics.halstead.purity_ratio
old: 0.8897972037159179
new: 1.9744143384292532
path: .metrics.halstead.N2
old: 282.0
new: 37.0
path: .metrics.halstead.difficulty
old: 48.23684210526316
new: 6.607142857142857
path: .metrics.halstead.length
old: 671.0
new: 85.0
path: .metrics.halstead.level
old: 0.020731042007637753
new: 0.15135135135135136
path: .metrics.halstead.volume
old: 4477.197404462873
new: 446.07383864270474
path: .metrics.halstead.vocabulary
old: 102.0
new: 38.0
path: .metrics.nexits.average
old: 3.2
new: 0.0
path: .metrics.nexits.sum
old: 16.0
new: 0.0
path: .metrics.cyclomatic.average
old: 4.571428571428571
new: 1.0
path: .metrics.cyclomatic.sum
old: 32.0
new: 3.0
path: .metrics.mi.mi_visual_studio
old: 20.675510159189795
new: 44.175433796717286
path: .metrics.mi.mi_original
old: 35.35512237221455
new: 75.53999179238656
path: .metrics.mi.mi_sei
old: 3.4926413538711394
new: 57.33171471205002
path: .metrics.loc.cloc
old: 21.0
new: 5.0
path: .metrics.loc.ploc
old: 125.0
new: 31.0
path: .metrics.loc.lloc
old: 79.0
new: 2.0
path: .metrics.loc.blank
old: 39.0
new: 13.0
path: .metrics.loc.sloc
old: 185.0
new: 49.0

# Spaces Data

## Minimal test - lines (16, 47)

path: .spaces[0].metrics.loc.ploc
old: 8.0
new: 23.0
path: .spaces[0].metrics.loc.blank
old: 2.0
new: 9.0
path: .spaces[0].metrics.loc.lloc
old: 3.0
new: 2.0
path: .spaces[0].metrics.loc.sloc
old: 10.0
new: 32.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 62.57395692810862
new: 48.53864340604769
path: .spaces[0].metrics.mi.mi_original
old: 107.00146634706574
new: 83.00108022434155
path: .spaces[0].metrics.mi.mi_sei
old: 78.87327259355523
new: 44.248034554880746
path: .spaces[0].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 1.0
new: 0.0
path: .spaces[0].metrics.halstead.length
old: 38.0
new: 81.0
path: .spaces[0].metrics.halstead.level
old: 0.0875
new: 0.15294117647058825
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.3913359316651803
new: 1.9188976990190372
path: .spaces[0].metrics.halstead.bugs
old: 0.04886879751228095
new: 0.06523920129305934
path: .spaces[0].metrics.halstead.effort
old: 1775.1267196287183
new: 2738.071818071563
path: .spaces[0].metrics.halstead.difficulty
old: 11.428571428571429
new: 6.538461538461538
path: .spaces[0].metrics.halstead.estimated_program_length
old: 52.87076540327685
new: 155.430713620542
path: .spaces[0].metrics.halstead.n2
old: 7.0
new: 26.0
path: .spaces[0].metrics.halstead.vocabulary
old: 17.0
new: 36.0
path: .spaces[0].metrics.halstead.N2
old: 16.0
new: 34.0
path: .spaces[0].metrics.halstead.N1
old: 22.0
new: 47.0
path: .spaces[0].metrics.halstead.volume
old: 155.32358796751288
new: 418.7639251168273
path: .spaces[0].metrics.halstead.time
old: 98.61815109048436
new: 152.11510100397572
path: .spaces[0].metrics.cyclomatic.average
old: 2.0
new: 1.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

### Code

    class nsToolkit {
     public:
      nsToolkit();
      virtual ~nsToolkit();

      static nsToolkit* GetToolkit();

      static void Shutdown() {
        delete gToolkit;
        gToolkit = nullptr;
      }

      static void PostSleepWakeNotification(const char* aNotification);

      static nsresult SwizzleMethods(Class aClass, SEL orgMethod, SEL posedMethod,
                                     bool classMethods = false);

      void MonitorAllProcessMouseEvents();
      void StopMonitoringAllProcessMouseEvents();

     protected:
      nsresult RegisterForSleepWakeNotifications();
      void RemoveSleepWakeNotifications();

     protected:
      static nsToolkit* gToolkit;

      CFRunLoopSourceRef mSleepWakeNotificationRLS;
      io_object_t mPowerNotifier;

      id mAllProcessMouseMonitor;
    };