1.2.1217. Too Many Parameters¶
Method has too many parameters. Exakat has a default parameter count which may be configured.
A method that needs more than 8 parameters is trying to do too much : it should be reviewed and split into smaller methods.
<?php
// This methods has too many parameters.
function alertSomeone($name, $email, $title, $message, $attachements, $signature, $bcc, $cc, $extra_headers) {
/* too much code here */
}
?>
Name |
Default |
Type |
Description |
parametersCount |
8 |
integer |
Minimal number of parameters to report. |
See also How many parameters is too many ? and Too Many Parameters.
1.2.1217.1. Connex PHP features¶
1.2.1217.1.1. Suggestions¶
Reduce the number of parameters to a lower level
Break the function into smaller functions
Turn the function into a class
1.2.1217.1.2. Specs¶
Short name |
Functions/TooManyParameters |
Rulesets |
|
Exakat since |
1.1.9 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Slow (1 hour) |
Precision |
Very high |
Examples |
|
Available in |