From 2f914b5a8322a5acb444b3ab2d6f4a9893b2d4ac Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Sun, 14 Nov 2021 22:30:11 +0100 Subject: [PATCH] [code style] 'if' construct must use '{}'s. there are cases where automated code style checkers hurt readability --- .../hafner/analysis/parser/CodeCheckerParser.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/edu/hm/hafner/analysis/parser/CodeCheckerParser.java b/src/main/java/edu/hm/hafner/analysis/parser/CodeCheckerParser.java index 140ead318..c63cf49a8 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/CodeCheckerParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/CodeCheckerParser.java @@ -45,10 +45,16 @@ protected Optional createIssue(final Matcher matcher, final LookaheadStre } private Severity getSeverity(final String severityText) { - if (severityText.contains("CRITICAL")) return Severity.ERROR; - if (severityText.contains("HIGH")) return Severity.WARNING_HIGH; - if (severityText.contains("MEDIUM")) return Severity.WARNING_NORMAL; - + + 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; } }