Description
Several modules exceed the local maintainability guideline of 400 lines, making them harder to understand, test, and maintain.
Affected Modules
The following files violate the 400-line cap:
src/parser/ast/rule.rs
src/parser/ast/expr.rs
src/parser/expression/pratt.rs
src/parser/tests/expression.rs
Impact
Oversized modules:
- Reduce code readability and comprehension
- Make testing and maintenance harder
- Increase cognitive load for contributors
- Violate established project maintainability guidelines
Actionable Fixes
src/parser/ast/rule.rs
- Move rule-term classification logic into a separate module
src/parser/ast/expr.rs
- Extract S-expression formatting into a dedicated module
src/parser/expression/pratt.rs
- Split postfix/diff/delay handling into separate focused modules
src/parser/tests/expression.rs
- Move giant test case tables into data fixtures
Recommendation
Split these modules by responsibility, following the single-responsibility principle. Each resulting module should focus on a specific concern and stay well under the 400-line guideline.
References
Requested by
@leynos
Description
Several modules exceed the local maintainability guideline of 400 lines, making them harder to understand, test, and maintain.
Affected Modules
The following files violate the 400-line cap:
src/parser/ast/rule.rssrc/parser/ast/expr.rssrc/parser/expression/pratt.rssrc/parser/tests/expression.rsImpact
Oversized modules:
Actionable Fixes
src/parser/ast/rule.rssrc/parser/ast/expr.rssrc/parser/expression/pratt.rssrc/parser/tests/expression.rsRecommendation
Split these modules by responsibility, following the single-responsibility principle. Each resulting module should focus on a specific concern and stay well under the 400-line guideline.
References
@leynosRequested by
@leynos