Global Metrics

path: .metrics.mi.mi_sei
old: 31.317763726373215
new: 57.97155021552955

path: .metrics.mi.mi_visual_studio
old: 23.706972318766063
new: 42.39825997411692

path: .metrics.mi.mi_original
old: 40.53892266508997
new: 72.50102455573993

path: .metrics.cyclomatic.sum
old: 4.0
new: 2.0

path: .metrics.loc.sloc
old: 270.0
new: 57.0

path: .metrics.loc.lloc
old: 0.0
new: 1.0

path: .metrics.loc.blank
old: 28.0
new: 16.0

path: .metrics.loc.cloc
old: 189.0
new: 9.0

path: .metrics.loc.ploc
old: 53.0
new: 32.0

path: .metrics.halstead.purity_ratio
old: 1.0819140449113056
new: 2.535154027278764

path: .metrics.halstead.vocabulary
old: 61.0
new: 49.0

path: .metrics.halstead.n2
old: 50.0
new: 37.0

path: .metrics.halstead.time
old: 1523.3823719427087
new: 211.6897360146139

path: .metrics.halstead.level
old: 0.06402048655569782
new: 0.13703703703703704

path: .metrics.halstead.effort
old: 27420.882694968757
new: 3810.415248263051

path: .metrics.halstead.volume
old: 1755.4982519186144
new: 522.1680155027144

path: .metrics.halstead.N2
old: 142.0
new: 45.0

path: .metrics.halstead.bugs
old: 0.30310960542103405
new: 0.08131929713177406

path: .metrics.halstead.length
old: 296.0
new: 93.0

path: .metrics.halstead.N1
old: 154.0
new: 48.0

path: .metrics.halstead.n1
old: 11.0
new: 12.0

path: .metrics.halstead.difficulty
old: 15.62
new: 7.297297297297297

path: .metrics.halstead.estimated_program_length
old: 320.2465572937465
new: 235.76932453692504

Spaces Data

Minimal test - lines (24, 53)

path: .spaces[0].metrics.halstead.volume
old: 0.0
new: 420.60075897674335

path: .spaces[0].metrics.halstead.estimated_program_length
old: null
new: 190.22626787690945

path: .spaces[0].metrics.halstead.N1
old: 0.0
new: 44.0

path: .spaces[0].metrics.halstead.N2
old: 1.0
new: 34.0

path: .spaces[0].metrics.halstead.effort
old: 0.0
new: 2860.085161041855

path: .spaces[0].metrics.halstead.purity_ratio
old: null
new: 2.4387983061142235

path: .spaces[0].metrics.halstead.level
old: null
new: 0.14705882352941177

path: .spaces[0].metrics.halstead.n2
old: 1.0
new: 30.0

path: .spaces[0].metrics.halstead.time
old: 0.0
new: 158.89362005788084

path: .spaces[0].metrics.halstead.bugs
old: 0.0
new: 0.06716320130884802

path: .spaces[0].metrics.halstead.vocabulary
old: 1.0
new: 42.0

path: .spaces[0].metrics.halstead.n1
old: 0.0
new: 12.0

path: .spaces[0].metrics.halstead.difficulty
old: 0.0
new: 6.8

path: .spaces[0].metrics.halstead.length
old: 1.0
new: 78.0

path: .spaces[0].metrics.loc.blank
old: 0.0
new: 7.0

path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 2.0

path: .spaces[0].metrics.loc.sloc
old: 1.0
new: 30.0

path: .spaces[0].metrics.loc.ploc
old: 1.0
new: 21.0

path: .spaces[0].metrics.mi.mi_original
old: null
new: 84.25384526463486

path: .spaces[0].metrics.mi.mi_visual_studio
old: null
new: 49.27125454072214

path: .spaces[0].metrics.mi.mi_sei
old: null
new: 65.424489721939

Code

class nsObserverService final : public nsIObserverService,
                                public nsIMemoryReporter {
 public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_OBSERVERSERVICE_CID)

  nsObserverService();

  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVERSERVICE
  NS_DECL_NSIMEMORYREPORTER

  void Shutdown();

  [[nodiscard]] static nsresult Create(nsISupports* aOuter, const nsIID& aIID,
                                       void** aInstancePtr);

  // Unmark any strongly held observers implemented in JS so the cycle
  // collector will not traverse them.
  NS_IMETHOD UnmarkGrayStrongObservers();

 private:
  ~nsObserverService(void);
  void RegisterReporter();
  nsresult EnsureValidCall() const;
  nsresult FilterHttpOnTopics(const char* aTopic);

  static const size_t kSuspectReferentCount = 100;
  bool mShuttingDown;
  nsTHashtable mObserverTopicTable;
};