# Global Metrics

path: .metrics.cognitive.average
old: 3.4
new: 0.10526315789473684
path: .metrics.cognitive.sum
old: 68.0
new: 2.0
path: .metrics.loc.cloc
old: 24.0
new: 94.0
path: .metrics.loc.lloc
old: 139.0
new: 28.0
path: .metrics.loc.blank
old: 51.0
new: 27.0
path: .metrics.loc.ploc
old: 325.0
new: 121.0
path: .metrics.loc.sloc
old: 400.0
new: 242.0
path: .metrics.nexits.average
old: 2.55
new: 0.3157894736842105
path: .metrics.nexits.sum
old: 51.0
new: 6.0
path: .metrics.mi.mi_sei
old: -46.49322313843211
new: 18.53726301315197
path: .metrics.mi.mi_visual_studio
old: 0.12178222454714711
new: 20.33558304923429
path: .metrics.mi.mi_original
old: 0.2082476039756216
new: 34.773847014190636
path: .metrics.halstead.purity_ratio
old: 0.4770057071514931
new: 0.9158522653365702
path: .metrics.halstead.length
old: 2165.0
new: 404.0
path: .metrics.halstead.time
old: 93468.9057258757
new: 4330.705674310324
path: .metrics.halstead.N1
old: 1299.0
new: 235.0
path: .metrics.halstead.N2
old: 866.0
new: 169.0
path: .metrics.halstead.n2
old: 126.0
new: 51.0
path: .metrics.halstead.bugs
old: 4.715255035519635
new: 0.6082743845817487
path: .metrics.halstead.estimated_program_length
old: 1032.7173559829826
new: 370.0043151959744
path: .metrics.halstead.vocabulary
old: 157.0
new: 70.0
path: .metrics.halstead.volume
old: 15792.853921350372
new: 2476.2303388457663
path: .metrics.halstead.level
old: 0.009386873277210757
new: 0.031765805045157275
path: .metrics.halstead.n1
old: 31.0
new: 19.0
path: .metrics.halstead.effort
old: 1682440.3030657624
new: 77952.70213758583
path: .metrics.halstead.difficulty
old: 106.53174603174604
new: 31.480392156862745
path: .metrics.nom.functions
old: 20.0
new: 19.0
path: .metrics.nom.total
old: 20.0
new: 19.0
path: .metrics.nargs.average
old: 2.3
new: 0.42105263157894735
path: .metrics.nargs.sum
old: 46.0
new: 8.0
path: .metrics.cyclomatic.average
old: 4.636363636363637
new: 1.2083333333333333
path: .metrics.cyclomatic.sum
old: 102.0
new: 29.0

# Spaces Data

## Minimal test - lines (29, 240)

path: .spaces[0].metrics.mi.mi_original
old: 1.2388195222120828
new: 37.64559154341711
path: .spaces[0].metrics.mi.mi_sei
old: -47.578522774738474
new: 21.36749300300314
path: .spaces[0].metrics.mi.mi_visual_studio
old: 0.7244558609427385
new: 22.01496581486381
path: .spaces[0].metrics.nexits.sum
old: 51.0
new: 6.0
path: .spaces[0].metrics.nexits.average
old: 2.55
new: 0.3157894736842105
path: .spaces[0].metrics.cyclomatic.sum
old: 101.0
new: 27.0
path: .spaces[0].metrics.cyclomatic.average
old: 4.809523809523809
new: 1.173913043478261
path: .spaces[0].metrics.loc.sloc
old: 382.0
new: 212.0
path: .spaces[0].metrics.loc.cloc
old: 17.0
new: 76.0
path: .spaces[0].metrics.loc.blank
old: 47.0
new: 24.0
path: .spaces[0].metrics.loc.ploc
old: 318.0
new: 112.0
path: .spaces[0].metrics.loc.lloc
old: 139.0
new: 28.0
path: .spaces[0].metrics.nom.total
old: 20.0
new: 19.0
path: .spaces[0].metrics.nom.functions
old: 20.0
new: 19.0
path: .spaces[0].metrics.nargs.sum
old: 46.0
new: 8.0
path: .spaces[0].metrics.nargs.average
old: 2.3
new: 0.42105263157894735
path: .spaces[0].metrics.cognitive.sum
old: 68.0
new: 1.0
path: .spaces[0].metrics.cognitive.average
old: 3.4
new: 0.05263157894736842
path: .spaces[0].metrics.halstead.bugs
old: 4.814764147181034
new: 0.5879999999999997
path: .spaces[0].metrics.halstead.N1
old: 1299.0
new: 231.0
path: .spaces[0].metrics.halstead.N2
old: 860.0
new: 161.0
path: .spaces[0].metrics.halstead.volume
old: 15627.715832202844
new: 2352.0
path: .spaces[0].metrics.halstead.time
old: 96443.2648348444
new: 4116.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.45502869712599137
new: 0.8396492347055721
path: .spaces[0].metrics.halstead.level
old: 0.009002250562640661
new: 0.031746031746031744
path: .spaces[0].metrics.halstead.length
old: 2159.0
new: 392.0
path: .spaces[0].metrics.halstead.n2
old: 120.0
new: 46.0
path: .spaces[0].metrics.halstead.effort
old: 1735978.7670271993
new: 74088.0
path: .spaces[0].metrics.halstead.n1
old: 31.0
new: 18.0
path: .spaces[0].metrics.halstead.vocabulary
old: 151.0
new: 64.0
path: .spaces[0].metrics.halstead.difficulty
old: 111.08333333333331
new: 31.5
path: .spaces[0].metrics.halstead.estimated_program_length
old: 982.4069570950154
new: 329.14250000458424

### Code

    namespace mozilla {

    /**
     * ReentrantMonitor
     * Java-like monitor.
     * When possible, use ReentrantMonitorAutoEnter to hold this monitor within a
     * scope, instead of calling Enter/Exit directly.
     **/
    class ReentrantMonitor : BlockingResourceBase {
     public:
      /**
       * ReentrantMonitor
       * @param aName A name which can reference this monitor
       */
      explicit ReentrantMonitor(const char* aName)
          : BlockingResourceBase(aName, eReentrantMonitor)
    #ifdef DEBUG
            ,
            mEntryCount(0)
    #endif
      {
        MOZ_COUNT_CTOR(ReentrantMonitor);
        mReentrantMonitor = PR_NewMonitor();
        if (!mReentrantMonitor) {
          MOZ_CRASH("Can't allocate mozilla::ReentrantMonitor");
        }
      }

      /**
       * ~ReentrantMonitor
       **/
      ~ReentrantMonitor() {
        NS_ASSERTION(mReentrantMonitor,
                     "improperly constructed ReentrantMonitor or double free");
        PR_DestroyMonitor(mReentrantMonitor);
        mReentrantMonitor = 0;
        MOZ_COUNT_DTOR(ReentrantMonitor);
      }

    #ifndef DEBUG
      /**
       * Enter
       * @see prmon.h
       **/
      void Enter() { PR_EnterMonitor(mReentrantMonitor); }

      /**
       * Exit
       * @see prmon.h
       **/
      void Exit() { PR_ExitMonitor(mReentrantMonitor); }

      /**
       * Wait
       * @see prmon.h
       **/
      nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT) {
    #  ifdef MOZILLA_INTERNAL_API
        AUTO_PROFILER_THREAD_SLEEP;
    #  endif  // MOZILLA_INTERNAL_API
        return PR_Wait(mReentrantMonitor, aInterval) == PR_SUCCESS
                   ? NS_OK
                   : NS_ERROR_FAILURE;
      }

    #else  // ifndef DEBUG
      void Enter();
      void Exit();
      nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT);

    #endif  // ifndef DEBUG

      /**
       * Notify
       * @see prmon.h
       **/
      nsresult Notify() {
        return PR_Notify(mReentrantMonitor) == PR_SUCCESS ? NS_OK
                                                          : NS_ERROR_FAILURE;
      }

      /**
       * NotifyAll
       * @see prmon.h
       **/
      nsresult NotifyAll() {
        return PR_NotifyAll(mReentrantMonitor) == PR_SUCCESS ? NS_OK
                                                             : NS_ERROR_FAILURE;
      }

    #ifdef DEBUG
      /**
       * AssertCurrentThreadIn
       * @see prmon.h
       **/
      void AssertCurrentThreadIn() {
        PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mReentrantMonitor);
      }

      /**
       * AssertNotCurrentThreadIn
       * @see prmon.h
       **/
      void AssertNotCurrentThreadIn() {
        // FIXME bug 476536
      }

    #else
      void AssertCurrentThreadIn() {}
      void AssertNotCurrentThreadIn() {}

    #endif  // ifdef DEBUG

     private:
      ReentrantMonitor();
      ReentrantMonitor(const ReentrantMonitor&);
      ReentrantMonitor& operator=(const ReentrantMonitor&);

      PRMonitor* mReentrantMonitor;
    #ifdef DEBUG
      int32_t mEntryCount;
    #endif
    };

    /**
     * ReentrantMonitorAutoEnter
     * Enters the ReentrantMonitor when it enters scope, and exits it when
     * it leaves scope.
     *
     * MUCH PREFERRED to bare calls to ReentrantMonitor.Enter and Exit.
     */
    class MOZ_STACK_CLASS ReentrantMonitorAutoEnter {
     public:
      /**
       * Constructor
       * The constructor aquires the given lock.  The destructor
       * releases the lock.
       *
       * @param aReentrantMonitor A valid mozilla::ReentrantMonitor*.
       **/
      explicit ReentrantMonitorAutoEnter(
          mozilla::ReentrantMonitor& aReentrantMonitor)
          : mReentrantMonitor(&aReentrantMonitor) {
        NS_ASSERTION(mReentrantMonitor, "null monitor");
        mReentrantMonitor->Enter();
      }

      ~ReentrantMonitorAutoEnter(void) { mReentrantMonitor->Exit(); }

      nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT) {
        return mReentrantMonitor->Wait(aInterval);
      }

      nsresult Notify() { return mReentrantMonitor->Notify(); }
      nsresult NotifyAll() { return mReentrantMonitor->NotifyAll(); }

     private:
      ReentrantMonitorAutoEnter();
      ReentrantMonitorAutoEnter(const ReentrantMonitorAutoEnter&);
      ReentrantMonitorAutoEnter& operator=(const ReentrantMonitorAutoEnter&);
      static void* operator new(size_t) noexcept(true);

      friend class ReentrantMonitorAutoExit;

      mozilla::ReentrantMonitor* mReentrantMonitor;
    };

    /**
     * ReentrantMonitorAutoExit
     * Exit the ReentrantMonitor when it enters scope, and enters it when it leaves
     * scope.
     *
     * MUCH PREFERRED to bare calls to ReentrantMonitor.Exit and Enter.
     */
    class MOZ_STACK_CLASS ReentrantMonitorAutoExit {
     public:
      /**
       * Constructor
       * The constructor releases the given lock.  The destructor
       * acquires the lock. The lock must be held before constructing
       * this object!
       *
       * @param aReentrantMonitor A valid mozilla::ReentrantMonitor*. It
       *                 must be already locked.
       **/
      explicit ReentrantMonitorAutoExit(ReentrantMonitor& aReentrantMonitor)
          : mReentrantMonitor(&aReentrantMonitor) {
        NS_ASSERTION(mReentrantMonitor, "null monitor");
        mReentrantMonitor->AssertCurrentThreadIn();
        mReentrantMonitor->Exit();
      }

      explicit ReentrantMonitorAutoExit(
          ReentrantMonitorAutoEnter& aReentrantMonitorAutoEnter)
          : mReentrantMonitor(aReentrantMonitorAutoEnter.mReentrantMonitor) {
        NS_ASSERTION(mReentrantMonitor, "null monitor");
        mReentrantMonitor->AssertCurrentThreadIn();
        mReentrantMonitor->Exit();
      }

      ~ReentrantMonitorAutoExit(void) { mReentrantMonitor->Enter(); }

     private:
      ReentrantMonitorAutoExit();
      ReentrantMonitorAutoExit(const ReentrantMonitorAutoExit&);
      ReentrantMonitorAutoExit& operator=(const ReentrantMonitorAutoExit&);
      static void* operator new(size_t) noexcept(true);

      ReentrantMonitor* mReentrantMonitor;
    };

    }  // namespace mozilla

## Minimal test - lines (37, 151)

path: .spaces[0].spaces[0].metrics.nexits.sum
old: 1.0
new: 3.0
path: .spaces[0].spaces[0].metrics.nexits.average
old: 1.0
new: 0.2727272727272727
path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 2.0
new: 1.3333333333333333
path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 2.0
new: 16.0
path: .spaces[0].spaces[0].metrics.nargs.average
old: 0.0
new: 0.18181818181818185
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 0.0
new: 2.0
path: .spaces[0].spaces[0].metrics.loc.lloc
old: 1.0
new: 15.0
path: .spaces[0].spaces[0].metrics.loc.ploc
old: 4.0
new: 65.0
path: .spaces[0].spaces[0].metrics.loc.blank
old: 0.0
new: 10.0
path: .spaces[0].spaces[0].metrics.loc.cloc
old: 0.0
new: 40.0
path: .spaces[0].spaces[0].metrics.loc.sloc
old: 4.0
new: 115.0
path: .spaces[0].spaces[0].metrics.nom.functions
old: 1.0
new: 11.0
path: .spaces[0].spaces[0].metrics.nom.total
old: 1.0
new: 11.0
path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 0.0
new: 1.0
path: .spaces[0].spaces[0].metrics.cognitive.average
old: 0.0
new: 0.09090909090909093
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.061340391791938176
new: 0.22845051344720704
path: .spaces[0].spaces[0].metrics.halstead.length
old: 42.0
new: 193.0
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 2496.3283013448213
new: 17941.968497129645
path: .spaces[0].spaces[0].metrics.halstead.time
old: 138.68490563026785
new: 996.7760276183136
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 28.0
new: 54.0
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 2.560490859673001
new: 1.371678992071272
path: .spaces[0].spaces[0].metrics.halstead.n2
old: 11.0
new: 39.0
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 17.0
new: 15.0
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 201.90890672641936
new: 1110.6932879175497
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 26.0
new: 109.0
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 12.363636363636363
new: 16.153846153846153
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 16.0
new: 84.0
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 107.54061610626604
new: 264.7340454697555
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.08088235294117647
new: 0.06190476190476191
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 120.4813848276313
new: 53.98585316868311
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 70.45695019159726
new: 31.57067436765094
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 98.32068413705466
new: 43.40076014594811

### Code

    class ReentrantMonitor : BlockingResourceBase {
     public:
      /**
       * ReentrantMonitor
       * @param aName A name which can reference this monitor
       */
      explicit ReentrantMonitor(const char* aName)
          : BlockingResourceBase(aName, eReentrantMonitor)
    #ifdef DEBUG
            ,
            mEntryCount(0)
    #endif
      {
        MOZ_COUNT_CTOR(ReentrantMonitor);
        mReentrantMonitor = PR_NewMonitor();
        if (!mReentrantMonitor) {
          MOZ_CRASH("Can't allocate mozilla::ReentrantMonitor");
        }
      }

      /**
       * ~ReentrantMonitor
       **/
      ~ReentrantMonitor() {
        NS_ASSERTION(mReentrantMonitor,
                     "improperly constructed ReentrantMonitor or double free");
        PR_DestroyMonitor(mReentrantMonitor);
        mReentrantMonitor = 0;
        MOZ_COUNT_DTOR(ReentrantMonitor);
      }

    #ifndef DEBUG
      /**
       * Enter
       * @see prmon.h
       **/
      void Enter() { PR_EnterMonitor(mReentrantMonitor); }

      /**
       * Exit
       * @see prmon.h
       **/
      void Exit() { PR_ExitMonitor(mReentrantMonitor); }

      /**
       * Wait
       * @see prmon.h
       **/
      nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT) {
    #  ifdef MOZILLA_INTERNAL_API
        AUTO_PROFILER_THREAD_SLEEP;
    #  endif  // MOZILLA_INTERNAL_API
        return PR_Wait(mReentrantMonitor, aInterval) == PR_SUCCESS
                   ? NS_OK
                   : NS_ERROR_FAILURE;
      }

    #else  // ifndef DEBUG
      void Enter();
      void Exit();
      nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT);

    #endif  // ifndef DEBUG

      /**
       * Notify
       * @see prmon.h
       **/
      nsresult Notify() {
        return PR_Notify(mReentrantMonitor) == PR_SUCCESS ? NS_OK
                                                          : NS_ERROR_FAILURE;
      }

      /**
       * NotifyAll
       * @see prmon.h
       **/
      nsresult NotifyAll() {
        return PR_NotifyAll(mReentrantMonitor) == PR_SUCCESS ? NS_OK
                                                             : NS_ERROR_FAILURE;
      }

    #ifdef DEBUG
      /**
       * AssertCurrentThreadIn
       * @see prmon.h
       **/
      void AssertCurrentThreadIn() {
        PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mReentrantMonitor);
      }

      /**
       * AssertNotCurrentThreadIn
       * @see prmon.h
       **/
      void AssertNotCurrentThreadIn() {
        // FIXME bug 476536
      }

    #else
      void AssertCurrentThreadIn() {}
      void AssertNotCurrentThreadIn() {}

    #endif  // ifdef DEBUG

     private:
      ReentrantMonitor();
      ReentrantMonitor(const ReentrantMonitor&);
      ReentrantMonitor& operator=(const ReentrantMonitor&);

      PRMonitor* mReentrantMonitor;
    #ifdef DEBUG
      int32_t mEntryCount;
    #endif
    };

## Minimal test - lines (203, 238)

path: .spaces[0].spaces[2].metrics.cyclomatic.sum
old: 5.0
new: 4.0
path: .spaces[0].spaces[2].metrics.cyclomatic.average
old: 5.0
new: 1.0
path: .spaces[0].spaces[2].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[2].metrics.nexits.average
old: 1.0
new: 0.0
path: .spaces[0].spaces[2].metrics.halstead.N1
old: 81.0
new: 57.0
path: .spaces[0].spaces[2].metrics.halstead.effort
old: 16207.5518752584
new: 7210.934721451216
path: .spaces[0].spaces[2].metrics.halstead.vocabulary
old: 40.0
new: 23.0
path: .spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 1.3102218835892585
new: 0.8624818916347249
path: .spaces[0].spaces[2].metrics.halstead.length
old: 132.0
new: 94.0
path: .spaces[0].spaces[2].metrics.halstead.estimated_program_length
old: 172.9492886337821
new: 81.07329781366414
path: .spaces[0].spaces[2].metrics.halstead.level
old: 0.04334365325077399
new: 0.05896805896805897
path: .spaces[0].spaces[2].metrics.halstead.n2
old: 21.0
new: 12.0
path: .spaces[0].spaces[2].metrics.halstead.time
old: 900.4195486254667
new: 400.60748452506755
path: .spaces[0].spaces[2].metrics.halstead.volume
old: 702.4945085251319
new: 425.2148238693592
path: .spaces[0].spaces[2].metrics.halstead.n1
old: 19.0
new: 11.0
path: .spaces[0].spaces[2].metrics.halstead.difficulty
old: 23.071428571428573
new: 16.958333333333332
path: .spaces[0].spaces[2].metrics.halstead.N2
old: 51.0
new: 37.0
path: .spaces[0].spaces[2].metrics.halstead.bugs
old: 0.2134799171040084
new: 0.1244151081181466
path: .spaces[0].spaces[2].metrics.mi.mi_sei
old: 69.64394896711335
new: 75.89195846894884
path: .spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 48.52907640150256
new: 47.10731096459038
path: .spaces[0].spaces[2].metrics.mi.mi_original
old: 82.98472064656937
new: 80.55350174944955
path: .spaces[0].spaces[2].metrics.nom.total
old: 1.0
new: 3.0
path: .spaces[0].spaces[2].metrics.nom.functions
old: 1.0
new: 3.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: 3.0
path: .spaces[0].spaces[2].metrics.cognitive.sum
old: 3.0
new: 0.0
path: .spaces[0].spaces[2].metrics.cognitive.average
old: 3.0
new: 0.0
path: .spaces[0].spaces[2].metrics.loc.blank
old: 3.0
new: 4.0
path: .spaces[0].spaces[2].metrics.loc.ploc
old: 20.0
new: 23.0
path: .spaces[0].spaces[2].metrics.loc.cloc
old: 3.0
new: 9.0
path: .spaces[0].spaces[2].metrics.loc.sloc
old: 26.0
new: 36.0

### Code

    class MOZ_STACK_CLASS ReentrantMonitorAutoExit {
     public:
      /**
       * Constructor
       * The constructor releases the given lock.  The destructor
       * acquires the lock. The lock must be held before constructing
       * this object!
       *
       * @param aReentrantMonitor A valid mozilla::ReentrantMonitor*. It
       *                 must be already locked.
       **/
      explicit ReentrantMonitorAutoExit(ReentrantMonitor& aReentrantMonitor)
          : mReentrantMonitor(&aReentrantMonitor) {
        NS_ASSERTION(mReentrantMonitor, "null monitor");
        mReentrantMonitor->AssertCurrentThreadIn();
        mReentrantMonitor->Exit();
      }

      explicit ReentrantMonitorAutoExit(
          ReentrantMonitorAutoEnter& aReentrantMonitorAutoEnter)
          : mReentrantMonitor(aReentrantMonitorAutoEnter.mReentrantMonitor) {
        NS_ASSERTION(mReentrantMonitor, "null monitor");
        mReentrantMonitor->AssertCurrentThreadIn();
        mReentrantMonitor->Exit();
      }

      ~ReentrantMonitorAutoExit(void) { mReentrantMonitor->Enter(); }

     private:
      ReentrantMonitorAutoExit();
      ReentrantMonitorAutoExit(const ReentrantMonitorAutoExit&);
      ReentrantMonitorAutoExit& operator=(const ReentrantMonitorAutoExit&);
      static void* operator new(size_t) noexcept(true);

      ReentrantMonitor* mReentrantMonitor;
    };

## Minimal test - lines (160, 194)

path: .spaces[0].spaces[1].metrics.cyclomatic.sum
old: 2.0
new: 6.0
path: .spaces[0].spaces[1].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[0].spaces[1].metrics.nom.functions
old: 1.0
new: 5.0
path: .spaces[0].spaces[1].metrics.nom.total
old: 1.0
new: 5.0
path: .spaces[0].spaces[1].metrics.nexits.average
old: 1.0
new: 0.6
path: .spaces[0].spaces[1].metrics.nexits.sum
old: 1.0
new: 3.0
path: .spaces[0].spaces[1].metrics.loc.cloc
old: 0.0
new: 7.0
path: .spaces[0].spaces[1].metrics.loc.ploc
old: 4.0
new: 22.0
path: .spaces[0].spaces[1].metrics.loc.sloc
old: 4.0
new: 35.0
path: .spaces[0].spaces[1].metrics.loc.blank
old: 0.0
new: 6.0
path: .spaces[0].spaces[1].metrics.loc.lloc
old: 1.0
new: 6.0
path: .spaces[0].spaces[1].metrics.halstead.N2
old: 16.0
new: 39.0
path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 2.560490859673001
new: 1.1759258463708997
path: .spaces[0].spaces[1].metrics.halstead.level
old: 0.08088235294117647
new: 0.0670611439842209
path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 12.363636363636363
new: 14.911764705882351
path: .spaces[0].spaces[1].metrics.halstead.effort
old: 2496.3283013448213
new: 7317.039799922115
path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.061340391791938176
new: 0.12563260263831297
path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 107.54061610626604
new: 117.59258463708996
path: .spaces[0].spaces[1].metrics.halstead.n1
old: 17.0
new: 13.0
path: .spaces[0].spaces[1].metrics.halstead.volume
old: 201.90890672641936
new: 490.6890595608519
path: .spaces[0].spaces[1].metrics.halstead.length
old: 42.0
new: 100.0
path: .spaces[0].spaces[1].metrics.halstead.n2
old: 11.0
new: 17.0
path: .spaces[0].spaces[1].metrics.halstead.time
old: 138.68490563026785
new: 406.50221110678416
path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 28.0
new: 30.0
path: .spaces[0].spaces[1].metrics.halstead.N1
old: 26.0
new: 61.0
path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: 98.32068413705466
new: 71.9800461237941
path: .spaces[0].spaces[1].metrics.mi.mi_original
old: 120.4813848276313
new: 79.80514603806076
path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 70.45695019159726
new: 46.66967604564957
path: .spaces[0].spaces[1].metrics.nargs.sum
old: 0.0
new: 3.0
path: .spaces[0].spaces[1].metrics.nargs.average
old: 0.0
new: 0.6

### Code

    class MOZ_STACK_CLASS ReentrantMonitorAutoEnter {
     public:
      /**
       * Constructor
       * The constructor aquires the given lock.  The destructor
       * releases the lock.
       *
       * @param aReentrantMonitor A valid mozilla::ReentrantMonitor*.
       **/
      explicit ReentrantMonitorAutoEnter(
          mozilla::ReentrantMonitor& aReentrantMonitor)
          : mReentrantMonitor(&aReentrantMonitor) {
        NS_ASSERTION(mReentrantMonitor, "null monitor");
        mReentrantMonitor->Enter();
      }

      ~ReentrantMonitorAutoEnter(void) { mReentrantMonitor->Exit(); }

      nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT) {
        return mReentrantMonitor->Wait(aInterval);
      }

      nsresult Notify() { return mReentrantMonitor->Notify(); }
      nsresult NotifyAll() { return mReentrantMonitor->NotifyAll(); }

     private:
      ReentrantMonitorAutoEnter();
      ReentrantMonitorAutoEnter(const ReentrantMonitorAutoEnter&);
      ReentrantMonitorAutoEnter& operator=(const ReentrantMonitorAutoEnter&);
      static void* operator new(size_t) noexcept(true);

      friend class ReentrantMonitorAutoExit;

      mozilla::ReentrantMonitor* mReentrantMonitor;
    };