Skip to content

Fix the 89 PMD violations reported by the Maven site #122

Description

@bertysentry

Summary

The PMD report (generated by mvn site, PMD 7.7.0, ruleset pmd.xml) flags 89 violations. They are currently report-only — PMD does not gate mvn verify — so the build is green, but the findings should be cleaned up (and once clean, we can consider enabling pmd:check to keep it that way).

Full report: PMD page of the Maven site (pmd.html), raw XML at target/pmd.xml.

Breakdown by rule

Count Rule Ruleset Notes
68 UselessParentheses Code Style Mostly mechanical; concentrated in light/MD4.java and light/Envelopes.java, plus WsmanClient, WinRMEndpoint, NTLMMessage, Type1Message, WmiHelper.
11 UnnecessaryModifier Code Style public on interface methods (WindowsRemoteExecutor, ShareRemoteDirectoryConsumer) and final on try-with-resources vars (WinRMCommandExecutor, WinRMWqlExecutor, ByteArrayUtils, NtlmCrypto).
6 EmptyCatchBlock Error Prone light/HttpTransport.java (×3), KerberosAuthScheme, Type3Message, WsmanClient. Add an explanatory comment or handle.
2 AvoidBranchingStatementAsLastInLoop Error Prone NtlmCrypto.Cursor.skipUntil, WsmanClient.request.
1 EmptyControlStatement Code Style Empty while in HttpTransport.readChunked.
1 UnusedFormalParameter Best Practices Unused constructor parameter target in light/CipherGen.java.

Notes

  • The bulk (UselessParentheses, UnnecessaryModifier) is mechanical and safe to auto-fix.
  • The EmptyCatchBlock / EmptyControlStatement cases deserve a look each — most are deliberate (best-effort cleanup, draining a stream); add a short comment so PMD (and readers) can see the intent, or suppress narrowly.
  • Some light/* classes (MD4, CipherGen, NTLM messages) are ports of reference NTLM/crypto code; if we want to keep them close to upstream, consider a targeted suppression rather than reformatting.

Acceptance criteria

  • PMD report shows 0 violations (or only explicitly justified @SuppressWarnings("PMD.<rule>") / // NOPMD with a reason).
  • mvn verify site still green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersjavaPull requests that update Java codeqaQA is required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions