# Global Metrics

path: .metrics.halstead.N2
old: 228.0
new: 68.0
path: .metrics.halstead.vocabulary
old: 121.0
new: 59.0
path: .metrics.halstead.length
old: 513.0
new: 150.0
path: .metrics.halstead.N1
old: 285.0
new: 82.0
path: .metrics.halstead.bugs
old: 0.5202401218642614
new: 0.13860031191098995
path: .metrics.halstead.level
old: 0.057565789473684216
new: 0.10407239819004524
path: .metrics.halstead.n2
old: 105.0
new: 46.0
path: .metrics.halstead.time
old: 3425.4303478712623
new: 471.0377224307851
path: .metrics.halstead.purity_ratio
old: 1.4990171137523254
new: 2.0145971087630454
path: .metrics.halstead.n1
old: 16.0
new: 13.0
path: .metrics.halstead.effort
old: 61657.74626168272
new: 8478.679003754132
path: .metrics.halstead.estimated_program_length
old: 768.9957793549429
new: 302.1895663144568
path: .metrics.halstead.volume
old: 3549.376840721867
new: 882.3964574042762
path: .metrics.halstead.difficulty
old: 17.37142857142857
new: 9.608695652173912
path: .metrics.nexits.average
old: 1.0
new: null
path: .metrics.nexits.sum
old: 3.0
new: 0.0
path: .metrics.loc.ploc
old: 90.0
new: 42.0
path: .metrics.loc.sloc
old: 141.0
new: 75.0
path: .metrics.loc.cloc
old: 10.0
new: 17.0
path: .metrics.loc.blank
old: 41.0
new: 16.0
path: .metrics.loc.lloc
old: 5.0
new: 0.0
path: .metrics.cyclomatic.average
old: 1.0769230769230769
new: 1.0
path: .metrics.cyclomatic.sum
old: 14.0
new: 7.0
path: .metrics.nargs.average
old: 1.3333333333333333
new: null
path: .metrics.nargs.sum
old: 4.0
new: 0.0
path: .metrics.cognitive.average
old: 0.3333333333333333
new: null
path: .metrics.cognitive.sum
old: 1.0
new: 0.0
path: .metrics.mi.mi_sei
old: 10.84202958605676
new: 51.22399839181007
path: .metrics.mi.mi_original
old: 45.10254766384613
new: 64.1769570040534
path: .metrics.mi.mi_visual_studio
old: 26.37575886774627
new: 37.53038421289673
path: .metrics.nom.total
old: 3.0
new: 0.0
path: .metrics.nom.functions
old: 3.0
new: 0.0

# Spaces Data

## Minimal test - lines (15, 73)

path: .spaces[0].metrics.mi.mi_original
old: null
new: 68.62060688140534
path: .spaces[0].metrics.mi.mi_sei
old: null
new: 53.67985669922817
path: .spaces[0].metrics.mi.mi_visual_studio
old: null
new: 40.12900987216686
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 6.0
path: .spaces[0].metrics.loc.ploc
old: 1.0
new: 35.0
path: .spaces[0].metrics.loc.sloc
old: 1.0
new: 59.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 10.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 14.0
path: .spaces[0].metrics.halstead.n1
old: 0.0
new: 13.0
path: .spaces[0].metrics.halstead.vocabulary
old: 1.0
new: 54.0
path: .spaces[0].metrics.halstead.volume
old: 0.0
new: 828.7038003115395
path: .spaces[0].metrics.halstead.estimated_program_length
old: null
new: 267.7653485251756
path: .spaces[0].metrics.halstead.length
old: 1.0
new: 144.0
path: .spaces[0].metrics.halstead.level
old: null
new: 0.10173697270471464
path: .spaces[0].metrics.halstead.N2
old: 1.0
new: 62.0
path: .spaces[0].metrics.halstead.n2
old: 1.0
new: 41.0
path: .spaces[0].metrics.halstead.time
old: 0.0
new: 452.53066602378107
path: .spaces[0].metrics.halstead.N1
old: 0.0
new: 82.0
path: .spaces[0].metrics.halstead.difficulty
old: 0.0
new: 9.829268292682928
path: .spaces[0].metrics.halstead.purity_ratio
old: null
new: 1.8594815869803865
path: .spaces[0].metrics.halstead.effort
old: 0.0
new: 8145.551988428059
path: .spaces[0].metrics.halstead.bugs
old: 0.0
new: 0.134945712864937

### Code

    namespace mozilla {
    namespace widget {

    class AndroidVsyncSupport;

    /**
     * A thread-safe way to listen to vsync notifications on Android. All methods
     * can be called on any thread.
     * Observers must keep a strong reference to the AndroidVsync instance until
     * they unregister themselves.
     */
    class AndroidVsync final : public SupportsThreadSafeWeakPtr {
     public:
      MOZ_DECLARE_THREADSAFEWEAKREFERENCE_TYPENAME(AndroidVsync)
      MOZ_DECLARE_REFCOUNTED_TYPENAME(AndroidVsync)

      static RefPtr GetInstance();

      ~AndroidVsync();

      class Observer {
       public:
        // Will be called on the Java UI thread.
        virtual void OnVsync(const TimeStamp& aTimeStamp) = 0;
      };

      // INPUT observers are called before RENDER observers.
      enum ObserverType { INPUT, RENDER };
      void RegisterObserver(Observer* aObserver, ObserverType aType);
      void UnregisterObserver(Observer* aObserver, ObserverType aType);

      TimeDuration GetVsyncRate();

     private:
      friend class AndroidVsyncSupport;

      AndroidVsync();

      // Called by Java, via AndroidVsyncSupport
      void NotifyVsync(int64_t aFrameTimeNanos);

      struct Impl {
        void UpdateObservingVsync();

        TimeDuration mVsyncDuration;
        nsTArray mInputObservers;
        nsTArray mRenderObservers;
        RefPtr mSupport;
        java::AndroidVsync::GlobalRef mSupportJava;
        bool mObservingVsync = false;
      };

      DataMutex mImpl;

      static StaticDataMutex> sInstance;
    };

    }  // namespace widget
    }  // namespace mozilla