Skip to content

PMD - pull_request #206

PMD - pull_request

PMD - pull_request #206

Re-run triggered July 7, 2025 11:15
Status Success
Total duration 24s
Artifacts 1

check-pmd.yml

on: pull_request
pmd_analyse
19s
pmd_analyse
Fit to window
Zoom out
Zoom in

Annotations

5 errors and 3 warnings
A catch statement should never catch throwable since it includes errors.: powertools-idempotency/powertools-idempotency-core/src/main/java/software/amazon/lambda/powertools/idempotency/internal/IdempotencyHandler.java#L230
Catching Throwable errors is not recommended since its scope is very broad. It includes runtime issues such as OutOfMemoryError that should be exposed and managed separately. AvoidCatchingThrowable (Priority: 1, Ruleset: Error Prone) https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#avoidcatchingthrowable
Avoid empty catch blocks: powertools-idempotency/powertools-idempotency-core/src/main/java/software/amazon/lambda/powertools/idempotency/internal/IdempotencyHandler.java#L79
Empty Catch Block finds instances where an exception is caught, but nothing is done. In most circumstances, this swallows an exception which should either be acted on or reported. EmptyCatchBlock (Priority: 1, Ruleset: Error Prone) https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#emptycatchblock
Avoid empty catch blocks: powertools-idempotency/powertools-idempotency-core/src/main/java/software/amazon/lambda/powertools/idempotency/internal/IdempotencyHandler.java#L77
Empty Catch Block finds instances where an exception is caught, but nothing is done. In most circumstances, this swallows an exception which should either be acted on or reported. EmptyCatchBlock (Priority: 1, Ruleset: Error Prone) https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#emptycatchblock
Ensure that resources like this InputStream object are closed after use: powertools-common/src/main/java/software/amazon/lambda/powertools/common/internal/ClassPreLoader.java#L45
Ensure that resources (like `java.sql.Connection`, `java.sql.Statement`, and `java.sql.ResultSet` objects and any subtype of `java.lang.AutoCloseable`) are always closed after use. Failing to do so might result in resource leaks. Note: It suffices to configure the super type, e.g. `java.lang.AutoCloseable`, so that this rule automatically triggers on any subtype (e.g. `java.io.FileInputStream`). Additionally specifying `java.sql.Connection` helps in detecting the types, if the type resolution / auxclasspath is not correctly setup. Note: Since PMD 6.16.0 the default value for the property `types` contains `java.lang.AutoCloseable` and detects now cases where the standard `java.io.*Stream` classes are involved. In order to restore the old behaviour, just remove "AutoCloseable" from the types. CloseResource (Priority: 1, Ruleset: Error Prone) https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#closeresource
This class has only private constructors and may be final: powertools-common/src/main/java/software/amazon/lambda/powertools/common/internal/ClassPreLoader.java#L28
Reports classes that may be made final because they cannot be extended from outside their compilation unit anyway. This is because all their constructors are private, so a subclass could not call the super constructor. ClassWithOnlyPrivateConstructorsShouldBeFinal (Priority: 1, Ruleset: Design) https://docs.pmd-code.org/snapshot/pmd_rules_java_design.html#classwithonlyprivateconstructorsshouldbefinal
pmd_analyse
Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
'catch' branch identical to 'IdempotencyItemNotFoundException' branch: powertools-idempotency/powertools-idempotency-core/src/main/java/software/amazon/lambda/powertools/idempotency/internal/IdempotencyHandler.java#L79
Identical `catch` branches use up vertical space and increase the complexity of code without adding functionality. It's better style to collapse identical branches into a single multi-catch branch. IdenticalCatchBranches (Priority: 3, Ruleset: Code Style) https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#identicalcatchbranches
pmd_analyse
Cache not found for keys: setup-java-Linux-x64-maven-7245fab0e0102d78bdda8f3833b8f9b15f401f9b58ff7311d83593986f9305f9

Artifacts

Produced during runtime
Name Size Digest
PMD Report Expired
1.89 KB
sha256:564b82f0cdedde3901a53d5210234da45b8aec949e3f645f46d3b1b6802bb50a