Edit on GitHub

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

LevelDefaultMeaning
Warning3Class has many interface contracts; verify LSP compliance
Error5Class violates Interface Segregation Principle

Configuration

# tsmetrics.yaml
thresholds:
  noi:
    warning: 3
    error:   5

Notes

Related metrics

DIT · CBO · WMC