Edit on GitHub

NOM / NOAM / NOOM

Class Metric  |  AST-based

Three related counts that describe the method landscape of a class:

MetricFull NameDescription
NOMNumber of MethodsTotal methods in the class body, including abstract methods (NOM = NOAM + NOOM)
NOAMNumber of Added MethodsConcrete methods that are new (not overrides of a parent)
NOOMNumber of Overriding MethodsConcrete methods declared with the override keyword

Formula

NOM = NOAM + NOOM

What it measures

A high NOM indicates a class carries many responsibilities. The split between NOAM and NOOM reveals whether the class extends a parent's contract (override-heavy) or adds entirely new behaviour (add-heavy).

Used by the Refused Bequest strategy to detect subclasses that barely override anything from their parent.

TypeScript Example

class Animal {
  speak(): string { return "..."; }   // abstract baseline
  eat():   void   { }
}

class Dog extends Animal {
  override speak(): string { return "Woof"; }  // NOOM
  fetch(): void { }                              // NOAM
  sit():   void { }                              // NOAM
}
// Dog: NOM=3, NOAM=2, NOOM=1

Thresholds

NOM, NOAM, and NOOM are informational — they are not directly threshold-checked. However they drive the Refused Bequest strategy (override ratio < 0.33 with DIT > 0).

Notes

Related metrics

DIT · WMC · WOC · Refused Bequest strategy