From ba01903c2cd74dcfbb0e7c203aa356f2b9c4ab3e Mon Sep 17 00:00:00 2001 From: Marcin Stachniuk Date: Wed, 11 Dec 2024 14:04:29 +0100 Subject: [PATCH] Code review remarks Co-authored-by: Peter Trifanov --- .../go/externalreport/GolangCILintReportSensor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sonar-go-plugin/src/main/java/org/sonar/go/externalreport/GolangCILintReportSensor.java b/sonar-go-plugin/src/main/java/org/sonar/go/externalreport/GolangCILintReportSensor.java index 2b289568..49926474 100644 --- a/sonar-go-plugin/src/main/java/org/sonar/go/externalreport/GolangCILintReportSensor.java +++ b/sonar-go-plugin/src/main/java/org/sonar/go/externalreport/GolangCILintReportSensor.java @@ -91,14 +91,14 @@ protected RuleKey createRuleKey(String source, RuleType ruleType, Severity ruleS @Override protected List impacts(String severity, String source) { var isSonarCloud = context.runtime().getProduct() == SonarProduct.SONARQUBE && context.runtime().getEdition() == SonarEdition.SONARCLOUD; - if (!isSonarCloud) { + if (isSonarCloud) { // SonarQube Cloud does not yet support the `impact` field for external issues - if (GOSEC.equals(source)) { - return List.of(new Impact(SoftwareQuality.SECURITY, org.sonar.api.issue.impact.Severity.MEDIUM)); - } - return List.of(new Impact(SoftwareQuality.MAINTAINABILITY, org.sonar.api.issue.impact.Severity.MEDIUM)); + return List.of(); } - return List.of(); + if (GOSEC.equals(source)) { + return List.of(new Impact(SoftwareQuality.SECURITY, org.sonar.api.issue.impact.Severity.MEDIUM)); + } + return List.of(new Impact(SoftwareQuality.MAINTAINABILITY, org.sonar.api.issue.impact.Severity.MEDIUM)); } } }