Global Metrics

path: .metrics.nom.functions
old: 22.0
new: 1.0

path: .metrics.nom.total
old: 22.0
new: 1.0

path: .metrics.loc.sloc
old: 497.0
new: 64.0

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

path: .metrics.loc.ploc
old: 369.0
new: 23.0

path: .metrics.loc.blank
old: 75.0
new: 14.0

path: .metrics.loc.cloc
old: 53.0
new: 27.0

path: .metrics.mi.mi_visual_studio
old: 0.0
new: 41.01665277073896

path: .metrics.mi.mi_original
old: -2.166936762350332
new: 70.13847623796362

path: .metrics.mi.mi_sei
old: -44.31349530737786
new: 68.13591089458687

path: .metrics.halstead.N2
old: 623.0
new: 37.0

path: .metrics.halstead.n2
old: 219.0
new: 31.0

path: .metrics.halstead.n1
old: 29.0
new: 7.0

path: .metrics.halstead.difficulty
old: 41.24885844748859
new: 4.17741935483871

path: .metrics.halstead.level
old: 0.024243095145846015
new: 0.23938223938223935

path: .metrics.halstead.N1
old: 1043.0
new: 63.0

path: .metrics.halstead.effort
old: 546617.12843936
new: 2192.2793967449816

path: .metrics.halstead.estimated_program_length
old: 1843.5598149113569
new: 173.23157007639637

path: .metrics.halstead.length
old: 1666.0
new: 100.0

path: .metrics.halstead.vocabulary
old: 248.0
new: 38.0

path: .metrics.halstead.purity_ratio
old: 1.106578520354956
new: 1.7323157007639636

path: .metrics.halstead.bugs
old: 2.228439781893775
new: 0.056252610335630074

path: .metrics.halstead.volume
old: 13251.691053104534
new: 524.7927513443585

path: .metrics.halstead.time
old: 30367.618246631107
new: 121.79329981916564

path: .metrics.nexits.average
old: 2.090909090909091
new: 0.0

path: .metrics.nexits.sum
old: 46.0
new: 0.0

path: .metrics.cyclomatic.average
old: 4.391304347826087
new: 1.0

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

path: .metrics.nargs.sum
old: 21.0
new: 1.0

path: .metrics.nargs.average
old: 0.9545454545454546
new: 1.0

path: .metrics.cognitive.sum
old: 75.0
new: 0.0

path: .metrics.cognitive.average
old: 3.409090909090909
new: 0.0

Spaces Data

Minimal test - lines (12, 62)

path: .spaces[0].metrics.cyclomatic.average
old: 3.0
new: 1.0

path: .spaces[0].metrics.nexits.average
old: 3.0
new: 0.0

path: .spaces[0].metrics.nexits.sum
old: 3.0
new: 0.0

path: .spaces[0].metrics.halstead.volume
old: 202.04660144782295
new: 501.4827251399043

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

path: .spaces[0].metrics.halstead.n2
old: 11.0
new: 29.0

path: .spaces[0].metrics.halstead.difficulty
old: 7.272727272727272
new: 4.103448275862069

path: .spaces[0].metrics.halstead.effort
old: 1469.4298287114398
new: 2057.8084238499523

path: .spaces[0].metrics.halstead.length
old: 46.0
new: 97.0

path: .spaces[0].metrics.halstead.n1
old: 10.0
new: 7.0

path: .spaces[0].metrics.halstead.N1
old: 30.0
new: 63.0

path: .spaces[0].metrics.halstead.estimated_program_length
old: 71.27302875388389
new: 160.5329333131028

path: .spaces[0].metrics.halstead.bugs
old: 0.04308353332155985
new: 0.05392813141276745

path: .spaces[0].metrics.halstead.time
old: 81.63499048396888
new: 114.32269021388625

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.5494136685626934
new: 1.6549786939495137

path: .spaces[0].metrics.halstead.vocabulary
old: 21.0
new: 36.0

path: .spaces[0].metrics.halstead.level
old: 0.1375
new: 0.2436974789915966

path: .spaces[0].metrics.cognitive.average
old: 2.0
new: 0.0

path: .spaces[0].metrics.cognitive.sum
old: 2.0
new: 0.0

path: .spaces[0].metrics.mi.mi_sei
old: 100.17984829106916
new: 73.02073026198644

path: .spaces[0].metrics.mi.mi_original
old: 93.38454497952068
new: 74.28306511564213

path: .spaces[0].metrics.mi.mi_visual_studio
old: 54.61084501726356
new: 43.44038895651587

path: .spaces[0].metrics.loc.sloc
old: 21.0
new: 51.0

path: .spaces[0].metrics.loc.blank
old: 3.0
new: 12.0

path: .spaces[0].metrics.loc.ploc
old: 10.0
new: 19.0

path: .spaces[0].metrics.loc.lloc
old: 5.0
new: 1.0

path: .spaces[0].metrics.loc.cloc
old: 8.0
new: 20.0

Code

namespace lul {

class Summariser {
 public:
  Summariser(SecMap* aSecMap, uintptr_t aTextBias, void (*aLog)(const char*));

  virtual void Entry(uintptr_t aAddress, uintptr_t aLength);
  virtual void End();

  // Tell the summariser that the value for |aNewReg| at |aAddress| is
  // recovered using the LExpr that can be constructed using the
  // components |how|, |oldReg| and |offset|.  The summariser will
  // inspect the components and may reject them for various reasons,
  // but the hope is that it will find them acceptable and record this
  // rule permanently.
  virtual void Rule(uintptr_t aAddress, int aNewReg, LExprHow how,
                    int16_t oldReg, int64_t offset);

  virtual uint32_t AddPfxInstr(PfxInstr pfxi);

  // Send output to the logging sink, for debugging.
  virtual void Log(const char* str) { mLog(str); }

 private:
  // The SecMap in which we park the finished summaries (RuleSets) and
  // also any PfxInstrs derived from Dwarf expressions.
  SecMap* mSecMap;

  // Running state for the current summary (RuleSet) under construction.
  RuleSet mCurrRules;

  // The start of the address range to which the RuleSet under
  // construction applies.
  uintptr_t mCurrAddr;

  // The highest address, plus one, for which the RuleSet under
  // construction could possibly apply.  If there are no further
  // incoming events then mCurrRules will eventually be emitted
  // as-is, for the range mCurrAddr.. mMax1Addr - 1, if that is
  // nonempty.
  uintptr_t mMax1Addr;

  // The bias value (to add to the SVMAs, to get AVMAs) to be used
  // when adding entries into mSecMap.
  uintptr_t mTextBias;

  // A logging sink, for debugging.
  void (*mLog)(const char* aFmt);
};

}  // namespace lul