NOI — Number of Implemented Interfaces
Class Metric | AST-based | Thresholds configurable
Count of interfaces listed in the implements clause of a class declaration.
Formula
NOI = |named children in implements_clause|
TypeScript Example
class HttpAdapter
implements IFetchable, IRetryable, ILoggable {
// NOI = 3
}
NOI: 3
Default Thresholds
| Level | Default | Meaning |
|---|---|---|
| Warning | 3 | Class has many interface contracts; verify LSP compliance |
| Error | 5 | Class violates Interface Segregation Principle |
Configuration
# tsmetrics.yaml
thresholds:
noi:
warning: 3
error: 5
Notes
- Generic interfaces like
Comparable<T>count as one interface. - The
extendsclause (parent class) is not counted here — see DIT. - Implementing the same interface twice is counted once.