max-function-length
ProBoilerplate BloatEnforce a maximum number of lines per function to catch AI-generated monolithic functions
max-function-length
Enforce a maximum number of lines per function to catch AI-generated monolithic functions
Category: Boilerplate Bloat | Tier: Pro
Why This Matters
AI tends to produce monolithic functions that handle validation, business logic, I/O, and error handling all in one block. Long functions are hard to test, hard to reuse, and hard to understand at a glance.
Bad Code
// Function is too long -- hard to understand and test
function processOrder(order) {
// ... 80+ lines of validation, calculation,
// database calls, email sending, logging ...
}
Good Code
// Break into focused, testable functions
function processOrder(order) {
validateOrder(order);
const total = calculateTotal(order);
await saveOrder(order, total);
await notifyCustomer(order);
}
Configuration
This rule wraps max-lines-per-function. See upstream documentation for full configuration options.