This weakness occurs when a single source code file grows excessively large, containing too many lines of code.
Overly large source files create significant challenges for developers. They become difficult to read, understand, and maintain, which slows down development and increases the likelihood of errors. This complexity indirectly harms security by making it harder to spot and fix vulnerabilities during code reviews or maintenance, often allowing bugs to persist longer in the codebase. While specific thresholds can vary by project and team, a common guideline is to keep files under 1000 lines of code. Enforcing reasonable file size limits promotes modular design, improves team collaboration, and makes the code more manageable. This proactive practice reduces technical debt and creates a clearer code structure where security flaws are easier to identify and address before they become exploitable issues.
Impact: Reduce Maintainability