Function-level metrics

MetricKeyDescriptionDefault thresholds
Cyclomatic ComplexityCCNumber of independent execution pathswarn: 10, err: 25
Halstead VolumeVSize of implementation based on operator/operand countsinformational
Maintainability IndexMIComposite score 0–100; higher = more maintainableinformational
LOC / SLOCTotal / source lines of codewarn: 50, err: 100
Max NestingMaximum block nesting depthwarn: 3, err: 5
Param CountNumber of formal parameterswarn: 4, err: 7
Closure DepthMaximum function nesting depth (detects callback hell)informational
Long Parameter ListFlags functions with more than 4 parametersthreshold: 4

Class-level metrics

MetricKeyDescriptionDefault thresholds
Weighted Methods per ClassWMCSum of cyclomatic complexity across all methodswarn: 20, err: 50
Depth of Inheritance TreeDITEdges from class to root of inheritance hierarchyinformational
Number of MethodsNOM/NOAM/NOOMTotal, added, and overriding methodsinformational
Weight of ClassWOCRatio of public attributes to total public interfaceinformational
Tight Class CohesionTCCFraction of method pairs sharing a field accessinformational
Coupling Between ObjectsCBOCount of distinct external types referenced structurallyinformational
Response For ClassRFCNOM + number of unique callees in method bodiesinformational
Number of Implemented InterfacesNOICount of interfaces in the implements clausewarn: 3, err: 5

React / FP metrics

MetricDescription
Number of Used ComponentsDistinct PascalCase JSX component references in render output
JSX Nesting LevelMaximum depth of nested JSX elements
Hook ComplexityTotal hook call count and number of distinct hook types per component
Custom Hook CohesionFraction of return value pairs sharing internal state — low score suggests splitting the hook
Effect DensityRatio of useEffect calls to component SLOC
Component Responsibility ScoreWeighted score of props, state, effects, and JSX — detects "God Components"
Prop Drilling DepthMaximum JSX nesting depth at which props are passed down
Render ComplexityCyclomatic-style count of &&, ternaries, and .map() in JSX

Module-level metrics

MetricDescription
Module CohesionFraction of exported function pairs that share an import dependency (FP analogue of TCC)
Function CouplingFan-out: number of distinct import sources (relative + package)
Pure Function RatioFraction of functions with no detected side effects

File-level metrics

MetricDescription
Technical DebtPer-function debt aggregated to file level
Edit on GitHub