[java] LawOfDemeter: False positive with static property access - should treat class-level property as global object, not dot-accessed property #2179
Labels
a:false-positive
PMD flags a piece of code that is not problematic
Milestone
#2160 (comment)
Affects PMD Version:
6.20.0
Rule:
LawOfDemeter.
Description:
Static property access warning must not be flagged for Law of Demeter when it can be mitigated by static import. The access of a static property is double-counted; the dot accessor count must start from the static property, not the class in which it exists. A very special case for this would be the static property at the class level 'class'. This should be treated as a global variable as well.
Code Sample demonstrating the issue:
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
The text was updated successfully, but these errors were encountered: