Skip to content

Commit

Permalink
remove state in getSeverity
Browse files Browse the repository at this point in the history
  • Loading branch information
ferkulat committed Nov 14, 2021
1 parent 9417a13 commit 54265f4
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/main/java/edu/hm/hafner/analysis/parser/CodeCheckerParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,10 @@ protected Optional<Issue> createIssue(final Matcher matcher, final LookaheadStre
}

private Severity getSeverity(final String severityText) {
Severity severity;
if (severityText.contains("CRITICAL")) {
severity = Severity.ERROR;
}
else if (severityText.contains("HIGH")) {
severity = Severity.WARNING_HIGH;
}
else if (severityText.contains("MEDIUM")) {
severity = Severity.WARNING_NORMAL;
}
else {
severity = Severity.WARNING_LOW;
}
return severity;
if (severityText.contains("CRITICAL")) { return Severity.ERROR; }
if (severityText.contains("HIGH" )) { return Severity.WARNING_HIGH; }
if (severityText.contains("MEDIUM" )) { return Severity.WARNING_NORMAL;}

return Severity.WARNING_LOW;
}
}

0 comments on commit 54265f4

Please sign in to comment.