PMD - pull_request #349
Annotations
10 errors
|
This if statement can be replaced by `return !{condition};`:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L173
Avoid unnecessary if-then-else statements when returning a boolean. The result of
the conditional test can be returned instead.
SimplifyBooleanReturns (Priority: 1, Ruleset: Design)
https://docs.pmd-code.org/snapshot/pmd_rules_java_design.html#simplifybooleanreturns
|
|
This statement should have braces:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L172
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: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#controlstatementbraces
|
|
This statement should have braces:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L169
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: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#controlstatementbraces
|
|
This statement should have braces:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L167
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: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#controlstatementbraces
|
|
This statement should have braces:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L137
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: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#controlstatementbraces
|
|
This statement should have braces:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L113
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: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#controlstatementbraces
|
|
This statement should have braces:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L112
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: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#controlstatementbraces
|
|
Unnecessary modifier 'final' on method 'isInitialized': the method is already in a final class:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L110
Fields in interfaces and annotations are automatically `public static final`, and methods are `public abstract`.
Classes, interfaces or annotations nested in an interface or annotation are automatically `public static`
(all nested interfaces and annotations are automatically static).
Nested enums are automatically `static`.
For historical reasons, modifiers which are implied by the context are accepted by the compiler, but are superfluous.
UnnecessaryModifier (Priority: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#unnecessarymodifier
|
|
Use of modifier volatile is not recommended.:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L60
Use of the keyword 'volatile' is generally used to fine tune a Java application, and therefore, requires
a good expertise of the Java Memory Model. Moreover, its range of action is somewhat misknown. Therefore,
the volatile keyword should not be used for maintenance purpose and portability.
AvoidUsingVolatile (Priority: 1, Ruleset: Multithreading)
https://docs.pmd-code.org/snapshot/pmd_rules_java_multithreading.html#avoidusingvolatile
|
|
Unnecessary modifier 'final' on method 'getDescriptor': the method is already in a final class:
examples/powertools-examples-kafka/src/main/java/org/demo/kafka/protobuf/ProtobufProduct.java#L35
Fields in interfaces and annotations are automatically `public static final`, and methods are `public abstract`.
Classes, interfaces or annotations nested in an interface or annotation are automatically `public static`
(all nested interfaces and annotations are automatically static).
Nested enums are automatically `static`.
For historical reasons, modifiers which are implied by the context are accepted by the compiler, but are superfluous.
UnnecessaryModifier (Priority: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#unnecessarymodifier
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
PMD Report
Expired
|
3.03 KB |
sha256:07cf50d347a1123b9241c2a08ed43143064e9092ad6e895297fee097edd2d800
|
|