Monolithic route file
Part of Architecture & Best Practices, which counts for 15% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.
What it detects
A single file registers a large number of routes for many different resources. That makes the file harder to navigate, harder to review (unrelated endpoints all show up in the same diff), and harder to apply resource-specific middleware to consistently. This is a rule-of-thumb heuristic on route count, not a hard architectural limit.
Why it matters
A single file registering routes for many unrelated resources becomes hard to navigate and hard to review: a pull request touching one resource shows a diff against a file full of routes nobody on that review has context on, and applying resource-specific middleware consistently (auth, validation, rate limits) gets easier to get wrong as the file grows. This is a structural, rule-of-thumb observation about file size, not a functional defect.
How to fix it
Split the file into one router module per resource (users.js, orders.js, invoices.js, and so on) and mount each on its own sub-path from a top-level routes index. Keep resource-specific middleware defined alongside the routes it protects rather than centralized in the giant file.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo