CRITICAL
Rule Definition
If a Method exceeds the maximum length this usually indicates that the class is doing too much and will therefore be difficult to understand and maintain.
Remediation
Modify the source code of the method to reduce the length.
Violation Code Sample
class ClassTest
{
public function doSomething()
{
print("function doSomething() " . PHP_EOL);
print("function doSomething() " . PHP_EOL);
// 99 copies omitted for brevity.
}
}
Reference
PHPMD http://phpmd.org/rules/codesize.html#toomanyfields
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.