ALL-FUNC1001 · abstraction_level
Judge whether a function stays at one useful level of abstraction.
This is a contextual rule for all languages. Read its implementation.
Definition
Section titled “Definition”Compare the function name, orchestration, domain operations, low-level mechanics, and extracted helpers. Mixed means a reader must repeatedly switch between policy and mechanism. The criteria independently establish a shared intent level, interleaving, repeated switching, and a deliberate boundary purpose. Small functions are structurally cohesive enough to skip model judgment, so candidates need six statements and four behavior operations.
Evidence
Section titled “Evidence”Findings cite the function body, callees, names, and the level assigned to each operation.
Exceptions
Section titled “Exceptions”Composition roots and small adapters may coordinate levels when the boundary remains obvious.
Examples
Section titled “Examples”publish_report that validates policy and also hand-builds HTTP frames is mixed. A
composition root that wires a report service to an HTTP adapter is a boundary. A function
whose every statement names a domain operation is cohesive.
References
Section titled “References”- Cites “Clean Code”, Functions
- Cites “A Philosophy of Software Design”, different layer different abstraction
- Cites “Refactoring”, Extract Function