Bump org.jvnet.hudson.plugins:analysis-pom from 11.2958.v63511c4c1160 to 12.3096.v9249970da_fef #703
46 new issues
| Total | New | Outstanding | Fixed | Trend |
|---|---|---|---|---|
| 46 | 46 | 0 | 0 | 👎 |
Reference build: Plugins » coverage-plugin » main #526
Details
Severity distribution of new issues
| Error | Warning High | Warning Normal | Warning Low |
|---|---|---|---|
| 0 | 0 | 46 | 0 |
Annotations
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getFullyQualifiedFileName' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getModifiedLinesBlocks' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getStartLine' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getEndLine' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getType' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getFilesWithModifiedLines' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'renderLine' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getColorClass' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getTooltip' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getSummaryColumn' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getPath' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'isPainted' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getCovered' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getMissed' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getColumnHeader' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getSurvived' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getKilled' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'calculateCodeDeltaToReference' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getCoverageRelevantChanges' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'mapScmChangesToReportPaths' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'createOldPathMapping' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getFileHash' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getModified' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getFileName' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>
ci-jenkins-io / PMD
PublicMemberInNonPublicType
NORMAL:
Public member 'getPackageName' declared in a non-public type.
Raw output
A non-public type should not declare its own members as public, as their visibility is effectively limited to private, package-private, or protected, making the use of the public modifier misleading. Declaring members as public within a non-public type creates confusion and can lead to unintended consequences if the type is later made public, as this would expose all its public members. However, it is acceptable for a non-public type to inherit public members from a superclass, as this is part of the superclass's design. To avoid such issues, these members should be declared as protected, package-private, or even private, as appropriate. Note that altering the visibility of such members might unintentionally affect the API of a public subtype. Specifically, a public subtype of a package-private supertype inherits all public methods of the supertype. Converting these methods to private removes them from the subtype as well, which can inadvertently change the subtype's public API. <pre> <code> class Wrong { public void method() {} // violation public int field; // violation } class Correct { void method() {} // or even private void privateMethod() {} int field; // or even private int privateField; } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.21.0/pmd_rules_java_design.html#publicmemberinnonpublictype"> See PMD documentation. </a>