CRITICAL
Rule Definition
Unused private fields make the code more complex to read and are redundant.
Remediation
Modify the source code of the class to reduce the number of unused private fields.
Violation Code Sample
class CastTest {
private static $test = 2; // Unused
private $a = 5; // Unused
private $b = 6;
public function testtest() {
return $this->b++;
}
}
Reference
PHPMD - http://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Related Technologies
Technical Criterion
Programming Practices - OO Inheritance and Polymorphism
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.