Avoid classes exceeding maximum length (PHP) | CAST Appmarq

Avoid classes exceeding maximum length (PHP)

CRITICAL

Rule Definition
If a Class 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 class to reduce its length.

Violation Code Sample
class ClassTooBig
{ 
 public function test() 
 { 
 // 1000 lines of code 
 } 
}

Reference
PHPMD http://phpmd.org/rules/codesize.html#excessiveparameterlist

Related Technologies

Health Factor

  Total Quality Index


Technical Criterion
CWE-1064 - Invokable Control Element with Signature Containing an Excessive Number of Parameters

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.

Benchmark Statistics

Global Compliance

99.97%

Total Violations
31
Total Opportunities
90,679
Average Violations / App.
0.62
The compliance score represents 1 minus the ratio between the number of times a rule has been violated compared to the number of opportunities in a set of applications that the rule could have been violated.

Industry Insights

Select from drop-down

99.92%

IT & Business Consulting

99.86%

Telecommunications

99.83%