5 new issues
Total | New | Outstanding | Fixed | Trend |
---|---|---|---|---|
5 | 5 | 0 | 0 | 👎 |
Reference build: Plugins » analysis-model » master #1624
Details
Severity distribution of new issues
Error | Warning High | Warning Normal | Warning Low |
---|---|---|---|
0 | 0 | 5 | 0 |
Annotations
Check warning on line 7 in src/main/java/edu/hm/hafner/analysis/parser/GrypeParser.java
ci-jenkins-io / PMD
UnnecessaryImport
NORMAL:
Unused import 'edu.umd.cs.findbugs.annotations.CheckForNull'.
Raw output
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. <pre> <code> import java.io.File; // not used, can be removed import java.util.Collections; // used below import java.util.*; // so this one is not used import java.lang.Object; // imports from java.lang, unnecessary import java.lang.Object; // duplicate, unnecessary public class Foo { static Object emptyList() { return Collections.emptyList(); } } </code> </pre> <a href="https://pmd.github.io/pmd-6.55.0/pmd_rules_java_codestyle.html#unnecessaryimport"> See PMD documentation. </a>
Check warning on line 11 in src/main/java/edu/hm/hafner/analysis/parser/GrypeParser.java
ci-jenkins-io / PMD
UnnecessaryImport
NORMAL:
Unused import 'java.lang.String.*'.
Raw output
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. <pre> <code> import java.io.File; // not used, can be removed import java.util.Collections; // used below import java.util.*; // so this one is not used import java.lang.Object; // imports from java.lang, unnecessary import java.lang.Object; // duplicate, unnecessary public class Foo { static Object emptyList() { return Collections.emptyList(); } } </code> </pre> <a href="https://pmd.github.io/pmd-6.55.0/pmd_rules_java_codestyle.html#unnecessaryimport"> See PMD documentation. </a>
Check warning on line 53 in src/main/java/edu/hm/hafner/analysis/parser/GrypeParser.java
ci-jenkins-io / PMD
UseLocaleWithCaseConversions
NORMAL:
When doing a String.toLowerCase()/toUpperCase() call, use a Locale.
Raw output
When doing `String::toLowerCase()/toUpperCase()` conversions, use an explicit locale argument to specify the case transformation rules. Using `String::toLowerCase()` without arguments implicitly uses `Locale::getDefault()`. The problem is that the default locale depends on the current JVM setup (and usually on the system in which it is running). Using the system default may be exactly what you want (e.g. if you are manipulating strings you got through standard input), but it may as well not be the case (e.g. if you are getting the string over the network or a file, and the encoding is well-defined and independent of the environment). In the latter case, using the default locale makes the case transformation brittle, as it may yield unexpected results on a machine whose locale has other case translation rules. For example, in Turkish, the uppercase form of `i` is `İ` (U+0130, not ASCII) and not `I` (U+0049) as in English. The rule is intended to *force* developers to think about locales when dealing with strings. By taking a conscious decision about the choice of locale at the time of writing, you reduce the risk of surprising behaviour down the line, and communicate your intent to future readers. <pre> <code> // violation - implicitly system-dependent conversion if (x.toLowerCase().equals("list")) {} // The above will not match "LIST" on a system with a Turkish locale. // It could be replaced with if (x.toLowerCase(Locale.US).equals("list")) { } // or simply if (x.equalsIgnoreCase("list")) { } // ok - system independent conversion String z = a.toLowerCase(Locale.ROOT); // ok - explicit system-dependent conversion String z2 = a.toLowerCase(Locale.getDefault()); </code> </pre> <a href="https://pmd.github.io/pmd-6.55.0/pmd_rules_java_errorprone.html#uselocalewithcaseconversions"> See PMD documentation. </a>
Check warning on line 25 in src/main/java/edu/hm/hafner/analysis/registry/ParserRegistry.java
ci-jenkins-io / PMD
UnnecessaryImport
NORMAL:
Duplicate import 'j2html.tags.ContainerTag'.
Raw output
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. <pre> <code> import java.io.File; // not used, can be removed import java.util.Collections; // used below import java.util.*; // so this one is not used import java.lang.Object; // imports from java.lang, unnecessary import java.lang.Object; // duplicate, unnecessary public class Foo { static Object emptyList() { return Collections.emptyList(); } } </code> </pre> <a href="https://pmd.github.io/pmd-6.55.0/pmd_rules_java_codestyle.html#unnecessaryimport"> See PMD documentation. </a>
Check warning on line 26 in src/main/java/edu/hm/hafner/analysis/registry/ParserRegistry.java
ci-jenkins-io / PMD
UnnecessaryImport
NORMAL:
Duplicate import 'j2html.tags.DomContent'.
Raw output
Reports import statements that can be removed. They are either unused, duplicated, or the members they import are already implicitly in scope, because they're in java.lang, or the current package. <pre> <code> import java.io.File; // not used, can be removed import java.util.Collections; // used below import java.util.*; // so this one is not used import java.lang.Object; // imports from java.lang, unnecessary import java.lang.Object; // duplicate, unnecessary public class Foo { static Object emptyList() { return Collections.emptyList(); } } </code> </pre> <a href="https://pmd.github.io/pmd-6.55.0/pmd_rules_java_codestyle.html#unnecessaryimport"> See PMD documentation. </a>