UNI004: High complexity
What and why
Method complexity exceeds thresholds: CycCC >= 15 or CogCC >= 15.
High complexity raises defect risk and review cost.
Threshold: CycCC >= 15 or CogCC >= 15.
How to fix: decompose conditionals, extract methods, or simplify control flow.
Default thresholds
| Severity | Condition |
|---|---|
| Warning | CycCC >= 15 or CogCC >= 15 |
Fix guidance
Reduce branching and extract logic (threshold: CycCC >= 15 or CogCC >= 15).
Tags
maintainability
Suppression
Place // unilyze-disable UNI004 -- reason in the leading trivia of the reported type or method declaration.
Metric findings are matched by type or method name, so suppressing one overload also suppresses same-name overloads.
For partial types, place the directive on the declaration indexed by unilyze.
For project-wide suppression, use "rules": { "UNI004": "off" }; use a baseline to freeze existing findings while reporting new ones.