A class refers to more distinct types than the limit

tx0/java:class-fan-outstrictwarningmaintainability

What it finds

A class that uses a great many other types depends on all of them: it changes when they change, and it is hard to test or reuse on its own.

Counted are the distinct type names written in a top-level class, enum or record, nested classes included, other than its own name, its type parameters and the most basic types of java.lang (String, Object, the boxes and the like). A type above the parameter max, 30 by default, is reported.

From the rule's source, class_fan_out.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:class-fan-out" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:class-fan-out] reason="..."

tx0 explain tx0/java:class-fan-out shows the same in the terminal. Found a false positive? Report it.