feat: summary panel [IDE-892] #774
Annotations
5 errors and 9 warnings
build (ubuntu-latest)
Process completed with exit code 1.
|
build (windows-latest)
The job was canceled because "ubuntu-latest" failed.
|
build (windows-latest)
The operation was canceled.
|
build (macos-latest)
The job was canceled because "ubuntu-latest" failed.
|
build (macos-latest)
The operation was canceled.
|
Position literals first in String comparisons:
plugin/src/main/java/io/snyk/eclipse/plugin/html/BaseHtmlProvider.java#L153
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.
LiteralsFirstInComparisons (Priority: 3, Ruleset: Best Practices)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#literalsfirstincomparisons
|
Avoid using redundant field initializer for 'instance':
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L115
Java will initialize fields with known default values so any explicit initialization of those same defaults
is redundant and results in a larger class file (approximately three additional bytecode instructions per field).
RedundantFieldInitializer (Priority: 3, Ruleset: Performance)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_performance.html#redundantfieldinitializer
|
Possible unsafe assignment to non-final static field 'instance' in a constructor.:
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L119
Identifies a possible unsafe usage of a static field.
AssignmentToNonFinalStatic (Priority: 3, Ruleset: Error Prone)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_errorprone.html#assignmenttononfinalstatic
|
Switch statements or expressions should be exhaustive, add a default case (or missing enum branches):
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L361
Switch statements should be exhaustive, to make their control flow
easier to follow. This can be achieved by adding a `default` case, or,
if the switch is on an enum type, by ensuring there is one switch branch
for each enum constant.
This rule doesn't consider Switch Statements, that use Pattern Matching, since for these the
compiler already ensures that all cases are covered. The same is true for Switch Expressions,
which are also not considered by this rule.
NonExhaustiveSwitch (Priority: 3, Ruleset: Best Practices)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#nonexhaustiveswitch
|
The initializer for variable 'nodeText' is never used (overwritten on lines 441 and 444):
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L438
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
|
Avoid instantiating new objects inside loops:
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L543
New objects created within loops should be checked to see if they can created outside them and reused.
AvoidInstantiatingObjectsInLoops (Priority: 3, Ruleset: Performance)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_performance.html#avoidinstantiatingobjectsinloops
|
Avoid instantiating new objects inside loops:
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L547
New objects created within loops should be checked to see if they can created outside them and reused.
AvoidInstantiatingObjectsInLoops (Priority: 3, Ruleset: Performance)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_performance.html#avoidinstantiatingobjectsinloops
|
Avoid instantiating new objects inside loops:
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L550
New objects created within loops should be checked to see if they can created outside them and reused.
AvoidInstantiatingObjectsInLoops (Priority: 3, Ruleset: Performance)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_performance.html#avoidinstantiatingobjectsinloops
|
Switch statements or expressions should be exhaustive, add a default case (or missing enum branches):
plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java#L580
Switch statements should be exhaustive, to make their control flow
easier to follow. This can be achieved by adding a `default` case, or,
if the switch is on an enum type, by ensuring there is one switch branch
for each enum constant.
This rule doesn't consider Switch Statements, that use Pattern Matching, since for these the
compiler already ensures that all cases are covered. The same is true for Switch Expressions,
which are also not considered by this rule.
NonExhaustiveSwitch (Priority: 3, Ruleset: Best Practices)
https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#nonexhaustiveswitch
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
PMD Report
|
2.48 KB |
|