A RetroSearch Logo

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

Search Query:

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

[apex] ExcessivePublicCount ignores properties · Issue #4596 · pmd/pmd · GitHub

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:

public class ClassDemonstratingIssue {
    public String prop1 {get; set;}
    public String prop2 {get; set;}
    public String prop3 {get; set;}
    public String prop4 {get; set;}
    public String prop5 {get; set;}
    public String prop6 {get; set;}
    public String prop7 {get; set;}
    public String prop8 {get; set;}
    public String prop9 {get; set;}
    public String prop10 {get; set;}
    public String prop11 {get; set;}
    public String prop12 {get; set;}
    public String prop13 {get; set;}
    public String prop14 {get; set;}
    public String prop15 {get; set;}
    public String prop16 {get; set;}
    public String prop17 {get; set;}
    public String prop18 {get; set;}
    public String prop19 {get; set;}
    public String prop20 {get; set;}
    public String prop21 {get; set;}
    public String prop22 {get; set;}
}

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


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