Skip to content

Commit

Permalink
Fix PMD warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Oct 27, 2024
1 parent bac307e commit 427a61d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/edu/hm/hafner/grading/AnalysisScore.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,12 @@ private Optional<String> reportSeverity(final Severity severity) {
}

private String getItemCount(final int count) {
if (REGISTRY.contains(getId())) {
if (REGISTRY.get(getId()).getType() == Type.VULNERABILITY) {
if (count == 1) {
return "vulnerability";
}
return "vulnerabilities";
if (REGISTRY.contains(getId())
&& REGISTRY.get(getId()).getType() == Type.VULNERABILITY) {
if (count == 1) {
return "vulnerability";

Check warning on line 171 in src/main/java/edu/hm/hafner/grading/AnalysisScore.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/edu/hm/hafner/grading/AnalysisScore.java#L171

Added line #L171 was not covered by tests
}
return "vulnerabilities";
}
return getItemName() + plural(count);
}
Expand Down

0 comments on commit 427a61d

Please sign in to comment.