C and C++


LANG.FUNCS.TMFP : Too Many Parameters

Summary

The number of parameters for a function exceeds the limit specified by the MAX_NUM_PARAMS setting (which defaults to 6).

Properties

Class Name Too Many Parameters
Significance style
Mnemonic LANG.FUNCS.TMFP
Categories
CWE CWE:710 Improper Adherence to Coding Standards
  CWE:1064 Invokable Control Element with Signature Containing an Excessive Number of Parameters
JSF++ JSF++:110 Functions with more than 7 arguments will not be used.
JPL JPL:25 Use short functions with a limited number of parameters.
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default. To enable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Too Many Parameters"

Example

int way_too_many(int x, int y, int z, 
                 int dx, int dy, int dz,
                 char *caption)         /* 'Too Many Parameters' warning issued here */
{
  /* function body ... */
  return 1;
}

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.