fix: race-conditions during startup #883
Annotations
5 errors and 8 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.
|
Ensure that resources like this InputStream object are closed after use:
plugin/src/main/java/io/snyk/eclipse/plugin/utils/FileDownloadResponseHandler.java#L27
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: 3, Ruleset: Error Prone)
https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#closeresource
|
Avoid assignments in operands:
plugin/src/main/java/io/snyk/eclipse/plugin/utils/FileDownloadResponseHandler.java#L33
Avoid assignments in operands; this can make code more complicated and harder to read.
AssignmentInOperand (Priority: 3, Ruleset: Error Prone)
https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#assignmentinoperand
|
Assigning an Object to null is a code smell. Consider refactoring.:
plugin/src/main/java/io/snyk/eclipse/plugin/wizards/SnykWizardAuthenticatePage.java#L73
Assigning a "null" to a variable (outside of its declaration) is usually bad form. Sometimes, this type
of assignment is an indication that the programmer doesn't completely understand what is going on in the code.
NOTE: This sort of assignment may used in some cases to dereference objects and encourage garbage collection.
NullAssignment (Priority: 3, Ruleset: Error Prone)
https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#nullassignment
|
Avoid using literals in if statements:
plugin/src/main/java/io/snyk/languageserver/LsRuntimeEnvironment.java#L97
Avoid using hard-coded literals in conditional statements. By declaring them as static variables
or private members with descriptive names maintainability is enhanced. By default, the literals "-1" and "0" are ignored.
More exceptions can be defined with the property "ignoreMagicNumbers".
The rule doesn't consider deeper expressions by default, but this can be enabled via the property `ignoreExpressions`.
With this property set to false, if-conditions like `i == 1 + 5` are reported as well. Note that in that case,
the property ignoreMagicNumbers is not taken into account, if there are multiple literals involved in such an expression.
AvoidLiteralsInIfCondition (Priority: 3, Ruleset: Error Prone)
https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidliteralsinifcondition
|
Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings:
plugin/src/main/java/io/snyk/languageserver/LsRuntimeEnvironment.java#L144
The use of the '+=' operator for appending strings causes the JVM to create and use an internal StringBuffer.
If a non-trivial number of these concatenations are being used then the explicit use of a StringBuilder or
threadsafe StringBuffer is recommended to avoid this.
UseStringBufferForStringAppends (Priority: 3, Ruleset: Performance)
https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_performance.html#usestringbufferforstringappends
|
Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings:
plugin/src/main/java/io/snyk/languageserver/LsRuntimeEnvironment.java#L146
The use of the '+=' operator for appending strings causes the JVM to create and use an internal StringBuffer.
If a non-trivial number of these concatenations are being used then the explicit use of a StringBuilder or
threadsafe StringBuffer is recommended to avoid this.
UseStringBufferForStringAppends (Priority: 3, Ruleset: Performance)
https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_performance.html#usestringbufferforstringappends
|
build (windows-latest)
Cache not found for keys: setup-java-Windows-x64-maven-f9a3da0c3f32fa6313510bee638bc6722621eaa5cde458f6d27310594dbccd91
|
build (macos-latest)
Cache not found for keys: setup-java-macOS-arm64-maven-a311aae086465d2053d22e4760e9bfa61d03463d26f0aa05a6decf4153fc9aea
|
Artifacts
Produced during runtime
Name | Size | Digest | |
---|---|---|---|
PMD Report
|
2.11 KB |
sha256:8e83105345cc6ed8a09787f15db9e22be5774f90d562217ed7368a652d9d5fb2
|
|