Static Code fixing #73
Annotations
1 error and 1 warning
Static Code Analyzer
Process completed with exit code 1.
|
The initializer for variable 'itemPrice' is never used (overwritten on line 82):
src/main/java/it/eng/dome/billing/engine/price/PriceService.java#L66
Reports assignments to variables that are never used before the variable is overwritten,
or goes out of scope. Unused assignments are those for which
1. The variable is never read after the assignment, or
2. The assigned value is always overwritten by other assignments before the next read of
the variable.
The rule tracks assignements to fields of `this`, and static fields of the current class.
This may cause some false positives in timing-sensitive concurrent code, which the rule cannot detect.
The rule may be suppressed with the standard `@SuppressWarnings("unused")` tag.
The rule subsumes {% rule "UnusedLocalVariable" %}, and {% rule "UnusedFormalParameter" %}.
Those violations are filtered
out by default, in case you already have enabled those rules, but may be enabled with the property
`reportUnusedVariables`. Variables whose name starts with `ignored` or `unused` are filtered out, as
is standard practice for exceptions.
Limitations:
* The rule currently cannot know which method calls throw exceptions, or which exceptions they throw.
In the body of a try block, every method or constructor call is assumed to throw. This may cause false-negatives.
The only other language construct that is assumed to throw is the `throw` statement, in particular,
things like `assert` statements, or NullPointerExceptions on dereference are ignored.
* The rule cannot resolve assignments across constructors, when they're called with the special
`this(...)` syntax. This may cause false-negatives.
Both of those limitations may be partly relaxed in PMD 7.
UnusedAssignment (Priority: 3, Ruleset: Best Practices)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#unusedassignment
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
PMD Report
|
1.37 KB |
|