Skip to content

Cleaning/Refactoring Code - Tests #502

Cleaning/Refactoring Code - Tests

Cleaning/Refactoring Code - Tests #502

Triggered via pull request November 19, 2024 07:38
Status Success
Total duration 43s
Artifacts 1

pmd.yml

on: pull_request
PMD Static Code Analysis
33s
PMD Static Code Analysis
Fit to window
Zoom out
Zoom in

Annotations

11 errors and 13 warnings
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/ArgumentsUtil.java#L67
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/ArgumentsUtil.java#L73
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/ArgumentsUtil.java#L98
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/ArgumentsUtil.java#L125
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/ArgumentsUtil.java#L138
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/ArgumentsUtil.java#L166
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Client.java#L80
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Client.java#L86
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Client.java#L158
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Client.java#L197
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#guardlogstatement
PMD Static Code Analysis
This version of the CodeQL Action was deprecated on January 18th, 2023, and is no longer updated or supported. For better performance, improved security, and new features, upgrade to v2. For more information, see https://github.blog/changelog/2023-01-18-code-scanning-codeql-action-v1-is-now-deprecated/
PMD Static Code Analysis
The following actions uses node12 which is deprecated and will be forced to run on node16: github/codeql-action/upload-sarif@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
PMD Static Code Analysis
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/setup-java@v3, pmd/pmd-github-action@v1, github/codeql-action/upload-sarif@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
Unused import 'java.io.IOException': file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L3
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. If some imports cannot be resolved, for instance because you run PMD with an incomplete auxiliary classpath, some imports may be conservatively marked as used even if they're not to avoid false positives. UnnecessaryImport (Priority: 4, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#unnecessaryimport
Unused import 'java.io.StringWriter': file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L5
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. If some imports cannot be resolved, for instance because you run PMD with an incomplete auxiliary classpath, some imports may be conservatively marked as used even if they're not to avoid false positives. UnnecessaryImport (Priority: 4, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#unnecessaryimport
Unused import 'java.util.stream.Collectors': file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L7
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. If some imports cannot be resolved, for instance because you run PMD with an incomplete auxiliary classpath, some imports may be conservatively marked as used even if they're not to avoid false positives. UnnecessaryImport (Priority: 4, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#unnecessaryimport
Unused import 'com.fasterxml.jackson.core.JsonParser': file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L16
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. If some imports cannot be resolved, for instance because you run PMD with an incomplete auxiliary classpath, some imports may be conservatively marked as used even if they're not to avoid false positives. UnnecessaryImport (Priority: 4, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#unnecessaryimport
Unused import 'com.fasterxml.jackson.databind.ObjectMapper': file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L17
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. If some imports cannot be resolved, for instance because you run PMD with an incomplete auxiliary classpath, some imports may be conservatively marked as used even if they're not to avoid false positives. UnnecessaryImport (Priority: 4, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#unnecessaryimport
Logger should be defined private static final and have the correct class: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L113
A logger should normally be defined private static final and be associated with the correct class. `private final Log log;` is also allowed for rare cases where loggers need to be passed around, with the restriction that the logger needs to be passed into the constructor. ProperLogger (Priority: 3, Ruleset: Error Prone) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_errorprone.html#properlogger
Avoid unnecessary constructors - the compiler will generate these for you: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L118
This rule detects when a constructor is not necessary; i.e., when there is only one constructor and the constructor is identical to the default constructor. The default constructor should has same access modifier as the declaring class. In an enum type, the default constructor is implicitly private. UnnecessaryConstructor (Priority: 3, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#unnecessaryconstructor
Document empty constructor: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L118
Uncommented Empty Constructor finds instances where a constructor does not contain statements, but there is no comment. By explicitly commenting empty constructors it is easier to distinguish between intentional (commented) and unintentional empty constructors. UncommentedEmptyConstructor (Priority: 3, Ruleset: Documentation) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_documentation.html#uncommentedemptyconstructor
This statement should have braces: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L129
Enforce a policy for braces on control statements. It is recommended to use braces on 'if ... else' statements and loop statements, even if they are optional. This usually makes the code clearer, and helps prepare the future when you need to add another statement. That said, this rule lets you control which statements are required to have braces via properties. From 6.2.0 on, this rule supersedes WhileLoopMustUseBraces, ForLoopMustUseBraces, IfStmtMustUseBraces, and IfElseStmtMustUseBraces. ControlStatementBraces (Priority: 3, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#controlstatementbraces
This statement should have braces: file:///home/runner/work/zingg/zingg/common/client/src/main/java/zingg/common/client/Arguments.java#L161
Enforce a policy for braces on control statements. It is recommended to use braces on 'if ... else' statements and loop statements, even if they are optional. This usually makes the code clearer, and helps prepare the future when you need to add another statement. That said, this rule lets you control which statements are required to have braces via properties. From 6.2.0 on, this rule supersedes WhileLoopMustUseBraces, ForLoopMustUseBraces, IfStmtMustUseBraces, and IfElseStmtMustUseBraces. ControlStatementBraces (Priority: 3, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#controlstatementbraces
Deprecation notice: v1, v2, and v3 of the artifact actions
The following artifacts were uploaded using a version of actions/upload-artifact that is scheduled for deprecation: "PMD Report". Please update your workflow to use v4 of the artifact actions. Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

Artifacts

Produced during runtime
Name Size
PMD Report
945 KB