1.2.1207. 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.1207.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.1207.2. Specs

Short name

Functions/TooManyParameters

Rulesets

All, Suggestions

Exakat since

1.1.9

PHP Version

All

Severity

Minor

Time To Fix

Slow (1 hour)

Precision

Very high

Features

parameter

Examples

WordPress, ChurchCRM

Available in

Entreprise Edition, Exakat Cloud