PMD - pull_request #1128
Annotations
3 errors
|
Position literals first in String comparisons:
powertools-logging/powertools-logging-logback/src/main/java/software/amazon/lambda/powertools/logging/logback/LambdaJsonEncoder.java#L124
Position literals first in all String comparisons, if the second argument is null then NullPointerExceptions
can be avoided, they will just return false. Note that switching literal positions for compareTo and
compareToIgnoreCase may change the result, see examples.
Note that compile-time constant strings are treated like literals. This is because they are inlined into
the class file, are necessarily non-null, and therefore cannot cause an NPE at runtime.
LiteralsFirstInComparisons (Priority: 1, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#literalsfirstincomparisons
|
|
Avoid using implementation types like 'TreeMap'; use the interface instead:
powertools-logging/powertools-logging-logback/src/main/java/software/amazon/lambda/powertools/logging/logback/LambdaJsonEncoder.java#L120
Excessive coupling to implementation types (e.g., `HashSet`) limits your ability to use alternate
implementations in the future as requirements change. Whenever available, declare variables
and parameters using a more general type (e.g, `Set`).
This rule reports uses of concrete collection types. User-defined types that should be treated
the same as interfaces can be configured with the property `allowedTypes`.
LooseCoupling (Priority: 1, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#loosecoupling
|
|
Avoid using implementation types like 'TreeMap'; use the interface instead:
powertools-logging/powertools-logging-logback/src/main/java/software/amazon/lambda/powertools/logging/logback/LambdaJsonEncoder.java#L86
Excessive coupling to implementation types (e.g., `HashSet`) limits your ability to use alternate
implementations in the future as requirements change. Whenever available, declare variables
and parameters using a more general type (e.g, `Set`).
This rule reports uses of concrete collection types. User-defined types that should be treated
the same as interfaces can be configured with the property `allowedTypes`.
LooseCoupling (Priority: 1, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#loosecoupling
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
PMD Report
|
1.26 KB |
sha256:31383ccdcdabe369e9e32478656d673235e061f684b86c4f82e60eb2cb04a13f
|
|