Skip to content

UNI001: God class detected

What and why

Type exceeds size thresholds: lines >= 500 or methods >= 20 (Critical: lines >= 1000).

God classes accumulate unrelated responsibilities and resist change.

Threshold: lines >= 500 or methods >= 20 (Critical: lines >= 1000).

How to fix: extract cohesive method groups into separate types; tune thresholds in .unilyze.json if justified.

Default thresholds

Severity Condition
Warning lines >= 500 or methods >= 20
Critical lines >= 1000

Fix guidance

Split the type into smaller, focused classes (threshold: lines >= 500 or methods >= 20).

Tags

maintainability

Suppression

Place // unilyze-disable UNI001 -- 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": { "UNI001": "off" }; use a baseline to freeze existing findings while reporting new ones.