You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This class should violate ExcessivePublicCount, as it does in PMD 6.55.0.
Note that if you remove the {get; set;}, then it starts throwing violations again. It seems to just be when there's the getters/setters that the 7.x version of the rule returns false negatives.
With PMD 7, the rule has been changed to consider only "top-level" methods of a class. This excluded methods defined inside a property. The properties' methods have only been considered accidentally in PMD 6.
However, these properties are still public members and should be considered towards the public count. I'm going to change the rule to count explicitly "properties" in addition to "methods" and "attributes" (aka. fields). However, I'm only counting each property once (PMD 6 counted each property twice, as it didn't count properties but methods).
adangel
changed the title
[apex] ExcessivePublicCount ignores getters/setters
[apex] ExcessivePublicCount ignores properties
Jun 24, 2023
Affects PMD Version: 7.0.0-rc3
Rule:
Please provide the rule name and a link to the rule documentation:
ExcessivePublicCount
Description:
Unlike previous versions of the rule (e.g., 6.55.0), the 7.x version no longer includes getters/setters in its total.
Code Sample demonstrating the issue:
Expected outcome:
This class should violate ExcessivePublicCount, as it does in PMD 6.55.0.
Note that if you remove the
{get; set;}
, then it starts throwing violations again. It seems to just be when there's the getters/setters that the 7.x version of the rule returns false negatives.Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
CLI
The text was updated successfully, but these errors were encountered: