Skip to main content

What it flags

A class has more than 30 methods, accessors, constructors or function-valued fields. Plain data properties (entities, DTOs) are not counted.

How to review or fix

Override with limits.largeClassMembers.

Configuration

Set the rule to "off" in loadwise.config.json to drop its findings:
This rule checks JavaScript and TypeScript classes only; other languages are not checked. An object with a level and options sets the rule’s thresholds. It takes two options, both positive integers:
  • maxMethods: the most methods, accessors, constructors and function-valued fields a class can have. Without it, the limit comes from the maintainability policy’s limits.largeClassMembers, or 30 when the policy does not set it.
  • maxLines: the most lines of code a class can have, not counting comments and blank lines. Without it, class length is not checked.
A class gets at most one finding. Its length is checked only when its member count is within maxMethods.
level is required: "warn" reports findings without changing the exit code. An overrides entry can set different options for the files it matches, and its options win over the top-level ones.