A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/825 below:

[java] Excessive*Length ignores too much · Issue #825 · pmd/pmd · GitHub

Affects PMD Version: 6.0.0

Rule: ExcessiveClassLengthRule and ExcessiveMethodLengthRule

Description: I was checking a class with a 200-line constructor in our codebase and ExcessiveMethodLength didn't pick it up. I fired up the debugger and found out that the constructor DataPoints are not added to the StatisticalRuleHelper.

Resolution: ExcessiveLengthRule ctor needs to be vararg and

From a user perspective (everyday developer), all of those are methods and all of those are classes.

Alternatively the AST needs to change and let Constructor/AnnotMethod extend Method, and Enum/AnnotType extend ClassOrIface. Maybe it was in the past?

Code Sample demonstrating the issue:

class ExcessiveConstructor {
	ExcessiveConstructor() {
		// 300 lines of garbage
	}
}

ExcessiveConstructor.java.txt

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other] CLI:

pmd -d ExcessiveConstructor.java -f text -R category/java/design.xml/ExcessiveMethodLength
<no output>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4