# Global Metrics

path: .metrics.cyclomatic.average
old: 1.0
new: 2.2666666666666666
path: .metrics.cyclomatic.sum
old: 10.0
new: 340.0
path: .metrics.halstead.level
old: 0.10368663594470048
new: 0.01291103834083777
path: .metrics.halstead.estimated_program_length
old: 300.4363582436418
new: 7466.538495675907
path: .metrics.halstead.N1
old: 88.0
new: 4396.0
path: .metrics.halstead.length
old: 150.0
new: 7188.0
path: .metrics.halstead.n1
old: 14.0
new: 42.0
path: .metrics.halstead.volume
old: 882.3964574042762
new: 69307.0675687663
path: .metrics.halstead.N2
old: 62.0
new: 2792.0
path: .metrics.halstead.time
old: 472.7902006338961
new: 298224.86318009
path: .metrics.halstead.difficulty
old: 9.644444444444444
new: 77.45310435931307
path: .metrics.halstead.effort
old: 8510.22361141013
new: 5368047.537241619
path: .metrics.halstead.n2
old: 45.0
new: 757.0
path: .metrics.halstead.purity_ratio
old: 2.002909054957612
new: 1.0387504863210777
path: .metrics.halstead.vocabulary
old: 59.0
new: 799.0
path: .metrics.halstead.bugs
old: 0.13894387061056407
new: 10.21934311103472
path: .metrics.nom.closures
old: 0.0
new: 4.0
path: .metrics.nom.functions
old: 2.0
new: 131.0
path: .metrics.nom.total
old: 2.0
new: 135.0
path: .metrics.mi.mi_original
old: 64.83773906886603
new: -87.96810724454309
path: .metrics.mi.mi_visual_studio
old: 37.91680647302107
new: 0.0
path: .metrics.mi.mi_sei
old: 45.396678670746
new: -140.23054491517306
path: .metrics.nexits.average
old: 0.5
new: 0.4740740740740741
path: .metrics.nexits.sum
old: 1.0
new: 64.0
path: .metrics.loc.lloc
old: 1.0
new: 497.0
path: .metrics.loc.blank
old: 13.0
new: 260.0
path: .metrics.loc.cloc
old: 9.0
new: 283.0
path: .metrics.loc.sloc
old: 69.0
new: 1960.0
path: .metrics.loc.ploc
old: 47.0
new: 1417.0
path: .metrics.nargs.average
old: 0.0
new: 1.6444444444444444
path: .metrics.nargs.sum
old: 0.0
new: 222.0
path: .metrics.cognitive.average
old: 0.0
new: 1.5777777777777775
path: .metrics.cognitive.sum
old: 0.0
new: 213.0

# Spaces Data

## Minimal test - lines (146, 162)

path: .spaces[1].metrics.mi.mi_visual_studio
old: null
new: 54.986105923244175
path: .spaces[1].metrics.mi.mi_original
old: null
new: 94.02624112874751
path: .spaces[1].metrics.mi.mi_sei
old: null
new: 60.15397951667016
path: .spaces[1].metrics.nom.functions
old: 0.0
new: 1.0
path: .spaces[1].metrics.nom.total
old: 0.0
new: 1.0
path: .spaces[1].metrics.nargs.sum
old: 0.0
new: 2.0
path: .spaces[1].metrics.nargs.average
old: null
new: 2.0
path: .spaces[1].metrics.cyclomatic.sum
old: 1.0
new: 2.0
path: .spaces[1].metrics.halstead.bugs
old: 0.0
new: 0.06650264935620799
path: .spaces[1].metrics.halstead.purity_ratio
old: null
new: 1.456532636912119
path: .spaces[1].metrics.halstead.N1
old: 0.0
new: 42.0
path: .spaces[1].metrics.halstead.N2
old: 1.0
new: 33.0
path: .spaces[1].metrics.halstead.vocabulary
old: 1.0
new: 28.0
path: .spaces[1].metrics.halstead.volume
old: 0.0
new: 360.5516191543203
path: .spaces[1].metrics.halstead.n1
old: 0.0
new: 9.0
path: .spaces[1].metrics.halstead.n2
old: 1.0
new: 19.0
path: .spaces[1].metrics.halstead.length
old: 1.0
new: 75.0
path: .spaces[1].metrics.halstead.effort
old: 0.0
new: 2817.995549706135
path: .spaces[1].metrics.halstead.time
old: 0.0
new: 156.5553083170075
path: .spaces[1].metrics.halstead.estimated_program_length
old: null
new: 109.23994776840892
path: .spaces[1].metrics.halstead.difficulty
old: 0.0
new: 7.815789473684211
path: .spaces[1].metrics.halstead.level
old: null
new: 0.12794612794612795
path: .spaces[1].metrics.cognitive.average
old: null
new: 0.0
path: .spaces[1].metrics.loc.ploc
old: 1.0
new: 17.0
path: .spaces[1].metrics.loc.sloc
old: 1.0
new: 17.0
path: .spaces[1].metrics.nexits.average
old: null
new: 0.0

### Code

    struct NoteWeakMapChildrenTracer : public JS::CallbackTracer {
      NoteWeakMapChildrenTracer(JSRuntime* aRt,
                                nsCycleCollectionNoteRootCallback& aCb)
          : JS::CallbackTracer(aRt, JS::TracerKind::Callback,
                               JS::IdTraceAction::CanSkip),
            mCb(aCb),
            mTracedAny(false),
            mMap(nullptr),
            mKey(nullptr),
            mKeyDelegate(nullptr) {}
      void onChild(const JS::GCCellPtr& aThing) override;
      nsCycleCollectionNoteRootCallback& mCb;
      bool mTracedAny;
      JSObject* mMap;
      JS::GCCellPtr mKey;
      JSObject* mKeyDelegate;
    };

## Minimal test - lines (164, 179)

path: .spaces[2].metrics.nargs.average
old: 0.0
new: 1.0
path: .spaces[2].metrics.nargs.sum
old: 0.0
new: 1.0
path: .spaces[2].metrics.cyclomatic.sum
old: 7.0
new: 5.0
path: .spaces[2].metrics.cyclomatic.average
old: 1.0
new: 5.0
path: .spaces[2].metrics.mi.mi_original
old: 71.15755360431761
new: 94.35308407222271
path: .spaces[2].metrics.mi.mi_visual_studio
old: 41.61260444696936
new: 55.177242147498674
path: .spaces[2].metrics.mi.mi_sei
old: 42.91578624583906
new: 60.93097378858475
path: .spaces[2].metrics.cognitive.average
old: 0.0
new: 5.0
path: .spaces[2].metrics.cognitive.sum
old: 0.0
new: 5.0
path: .spaces[2].metrics.halstead.bugs
old: 0.12946808674330756
new: 0.0822563787044733
path: .spaces[2].metrics.halstead.n1
old: 14.0
new: 16.0
path: .spaces[2].metrics.halstead.difficulty
old: 9.390243902439025
new: 10.823529411764708
path: .spaces[2].metrics.halstead.volume
old: 815.171719606977
new: 358.15198247445016
path: .spaces[2].metrics.halstead.effort
old: 7654.661269480151
new: 3876.4685161940497
path: .spaces[2].metrics.halstead.estimated_program_length
old: 272.9626010981479
new: 133.48686830125575
path: .spaces[2].metrics.halstead.level
old: 0.10649350649350647
new: 0.09239130434782608
path: .spaces[2].metrics.halstead.n2
old: 41.0
new: 17.0
path: .spaces[2].metrics.halstead.time
old: 425.25895941556394
new: 215.3593620107805
path: .spaces[2].metrics.halstead.length
old: 141.0
new: 71.0
path: .spaces[2].metrics.halstead.vocabulary
old: 55.0
new: 33.0
path: .spaces[2].metrics.halstead.N1
old: 86.0
new: 48.0
path: .spaces[2].metrics.halstead.N2
old: 55.0
new: 23.0
path: .spaces[2].metrics.halstead.purity_ratio
old: 1.93590497232729
new: 1.880096736637405
path: .spaces[2].metrics.loc.cloc
old: 2.0
new: 0.0
path: .spaces[2].metrics.loc.lloc
old: 1.0
new: 8.0
path: .spaces[2].metrics.loc.sloc
old: 50.0
new: 16.0
path: .spaces[2].metrics.loc.ploc
old: 39.0
new: 14.0
path: .spaces[2].metrics.loc.blank
old: 9.0
new: 2.0
path: .spaces[2].metrics.nexits.average
old: 0.5
new: 2.0
path: .spaces[2].metrics.nexits.sum
old: 1.0
new: 2.0
path: .spaces[2].metrics.nom.functions
old: 2.0
new: 1.0
path: .spaces[2].metrics.nom.total
old: 2.0
new: 1.0

### Code

    void NoteWeakMapChildrenTracer::onChild(const JS::GCCellPtr& aThing) {
      if (aThing.is()) {
        return;
      }

      if (!JS::GCThingIsMarkedGray(aThing) && !mCb.WantAllTraces()) {
        return;
      }

      if (JS::IsCCTraceKind(aThing.kind())) {
        mCb.NoteWeakMapping(mMap, mKey, mKeyDelegate, aThing);
        mTracedAny = true;
      } else {
        JS::TraceChildren(this, aThing);
      }
    }

## Minimal test - lines (115, 144)

path: .spaces[0].metrics.mi.mi_original
old: null
new: 84.53595752222927
path: .spaces[0].metrics.mi.mi_sei
old: null
new: 60.51854090790238
path: .spaces[0].metrics.mi.mi_visual_studio
old: null
new: 49.43623246913992
path: .spaces[0].metrics.halstead.level
old: null
new: 0.11910669975186104
path: .spaces[0].metrics.halstead.difficulty
old: 0.0
new: 8.395833333333334
path: .spaces[0].metrics.halstead.length
old: 1.0
new: 70.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: null
new: 158.14481635314195
path: .spaces[0].metrics.halstead.effort
old: 0.0
new: 3061.639155091514
path: .spaces[0].metrics.halstead.n1
old: 0.0
new: 13.0
path: .spaces[0].metrics.halstead.N2
old: 1.0
new: 31.0
path: .spaces[0].metrics.halstead.N1
old: 0.0
new: 39.0
path: .spaces[0].metrics.halstead.purity_ratio
old: null
new: 2.259211662187742
path: .spaces[0].metrics.halstead.volume
old: 0.0
new: 364.6617355940265
path: .spaces[0].metrics.halstead.bugs
old: 0.0
new: 0.07028264235013472
path: .spaces[0].metrics.halstead.vocabulary
old: 1.0
new: 37.0
path: .spaces[0].metrics.halstead.n2
old: 1.0
new: 24.0
path: .spaces[0].metrics.halstead.time
old: 0.0
new: 170.0910641717508
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 3.0
path: .spaces[0].metrics.loc.ploc
old: 1.0
new: 22.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 7.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 1.0
path: .spaces[0].metrics.loc.sloc
old: 1.0
new: 30.0

### Code

    namespace mozilla {

    struct DeferredFinalizeFunctionHolder {
      DeferredFinalizeFunction run;
      void* data;
    };

    class IncrementalFinalizeRunnable : public DiscardableRunnable {
      typedef AutoTArray DeferredFinalizeArray;
      typedef CycleCollectedJSRuntime::DeferredFinalizerTable
          DeferredFinalizerTable;

      CycleCollectedJSRuntime* mRuntime;
      DeferredFinalizeArray mDeferredFinalizeFunctions;
      uint32_t mFinalizeFunctionToRun;
      bool mReleasing;

      static const PRTime SliceMillis = 5; /* ms */

     public:
      IncrementalFinalizeRunnable(CycleCollectedJSRuntime* aRt,
                                  DeferredFinalizerTable& aFinalizerTable);
      virtual ~IncrementalFinalizeRunnable();

      void ReleaseNow(bool aLimited);

      NS_DECL_NSIRUNNABLE
    };

    }  // namespace mozilla