Invokable Control Element with Signature Containing an Excessive Number of Parameters

Incomplete Base
Structure: Simple
Description

This weakness occurs when a function, method, or subroutine is defined with an unnecessarily high number of parameters in its signature.

Extended Description

Functions with too many parameters are difficult to read, test, and maintain. This complexity slows down development and increases the chance of errors, as developers struggle to understand the correct order and purpose of each argument. Over time, this makes the codebase more fragile and harder to secure. While the exact threshold can vary by project, a common best practice is to limit functions to a maximum of seven parameters. Exceeding this guideline is a strong indicator that the function's responsibilities should be refactored, perhaps by grouping related parameters into a dedicated object or class, to improve clarity and reduce security risks introduced by maintainability issues.

Common Consequences 1
Scope: Other

Impact: Reduce Maintainability

References 1
Automated Source Code Maintainability Measure (ASCMM)
Object Management Group (OMG)
01-2016
ID: REF-960
Related Weaknesses
Taxonomy Mapping
  • OMG ASCMM