Skip to content

ALL-CLAS0001 · class_method_order

Count classes whose methods do not follow one explicit source order.

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

Inspect methods declared directly in each class. Put the configured lifecycle names first in their declared sequence, then the language protocol members a provider marks as such. Order every remaining method by visibility, then by member kind, then case-insensitively by name when alphabetical is true. A # region boundary or its language equivalent starts a new independently ordered section. Accessors that share one name, such as a property setter beside its getter, stay stable. The value is the number of classes whose current order differs.

Every language that declares members inside a type takes part. A provider maps its own spelling onto the shared visibility and member kinds, so a Java private static helper, a Rust associated function, a TypeScript #field accessor, and a Python classmethod all sort under one declared policy rather than a Python-shaped category list.

Continue with evidence and references, or open the examples.