Skip to main content

React analyzer

React Structural Complexity

Measures control-flow complexity per component or custom hook: branches, loops, early returns, JSX conditionals, logical operators, optional chains and nullish defaults.

technical-debt react-structural

React Structural Complexity

Measures control-flow complexity per component or custom hook: branches, loops, early returns, JSX conditionals, logical operators, optional chains and nullish defaults.

Component structural complexity, which is distinct from cyclomatic complexity, captures how hard the JSX tree is to read. Deeply nested conditionals inside JSX, multiple early returns with different shapes, and prop spreading that obscures what is actually rendered all add to this score.

Severity guide

info
A signal worth being aware of but not requiring action.
warning
A pattern likely to cause subtle bugs or performance issues; refactor recommended.
critical
A pattern actively breaking expected behavior or contracts; fix immediately.

Remediation

Address the flagged pattern; the message field describes the specific instance.

Review the issue location and apply the React/Next.js best practice for the pattern. Each emission carries enough context to act on directly.

Documentation