Rule Definition
Source code containing short variable names is difficult to read and therefore to maintain.
Remediation
Modify the source code to reduce the number of the artifacts with variable names that are too short.
Violation Code Sample
class CastTest
{
private $b = 20; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$a = 20 + $this-> b; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++)
{ // Not a Violation (inside FOR)
$a += $this->
}
}
}
Reference
PHPMD http://phpmd.org/rules/naming.html#shortvariable
Related Technologies
Technical Criterion
Documentation - Naming Convention Conformity
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.