Skip to content

UNI006: Low cohesion

What and why

Type LCOM >= 0.8.

Low cohesion suggests the type mixes unrelated behavior.

Threshold: LCOM >= 0.8.

How to fix: split unrelated methods into separate types.

Default thresholds

Severity Condition
Warning LCOM >= 0.8

Fix guidance

Group related methods or split the type (threshold: LCOM >= 0.8).

Tags

maintainability

Suppression

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