Method uses too many variables

objectscriptQuality release 
1.0.0
Id 
OS0010
Rule type 
Code Smell
Severity 

Major

Major
SQALE characteristic 
  • Efficiency
    • Efficiency compliance
Tags 
design, maintainability, performance
Remediation function 
Constant/issue
Remediation cost 
2d

This check detects the number of local variables declared/used in a method and reports an issue if this number is deemed to be too high (this number is configurable).

Moreover, it is often the case that a method with too many variables is also too complex. It is therefore strongly recommended to refactor the code in order to avoid this issue.

Parameters

NameDescriptionDefault value
nrVarsThreshold
Maximum number of variables allowed for a method
10