NOM / NOAM / NOOM
Class Metric | AST-based
Three related counts that describe the method landscape of a class:
| Metric | Full Name | Description |
|---|---|---|
| NOM | Number of Methods | Total methods in the class body, including abstract methods (NOM = NOAM + NOOM) |
| NOAM | Number of Added Methods | Concrete methods that are new (not overrides of a parent) |
| NOOM | Number of Overriding Methods | Concrete 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
- Abstract methods (
abstract_method_signaturenodes) ARE included in NOM and count toward NOAM. Only interface method signatures defined outside a class body are excluded. - Static methods are included.
- Constructor is included in NOAM.
- Only the
overridekeyword triggers NOOM; implicit overrides (no keyword) count as NOAM.
Related metrics
DIT · WMC · WOC · Refused Bequest strategy