Skip to content

ALL-MODU0006 · module_statement_count

Limit the total statement inventory one source module owns.

This is a deterministic rule for all languages. Read its implementation.

Count statements throughout the module, including statements nested inside classes, functions, and control-flow blocks. Declarations count because they also ask a reader to understand one source-level decision. Comments and blank lines do not count.

The finding names the module and its exact recursive statement count. The value is the number of statements owned by that file.

Generated parsers, schemas, and migration snapshots can be excluded by path. Hand-written modules should split at a coherent responsibility boundary instead of raising the ceiling.

A file with 150 statements across ten functions returns 150. A file with 201 returns 201 and fails the standard ceiling even when no individual function is long.

  • Generalizes Ruff PLR0915 too-many-statements. Open reference
  • Cites “Clean Code”, chapter 10, Classes