From 18b02ff22b2001cc0a07a8bc97aaf4f0098a1661 Mon Sep 17 00:00:00 2001 From: OrlovAlexander <35396155+OrlovAlexander85@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:59:52 +0200 Subject: [PATCH] NO-JIRA Fix code smells --- ...eliabilityAndSecurityRatingMeasuresVisitor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/ReliabilityAndSecurityRatingMeasuresVisitor.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/ReliabilityAndSecurityRatingMeasuresVisitor.java index 6525640a193..b2d403c6189 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/ReliabilityAndSecurityRatingMeasuresVisitor.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/ReliabilityAndSecurityRatingMeasuresVisitor.java @@ -32,17 +32,17 @@ import org.sonar.ce.task.projectanalysis.measure.RatingMeasures; import org.sonar.ce.task.projectanalysis.metric.Metric; import org.sonar.ce.task.projectanalysis.metric.MetricRepository; import org.sonar.core.issue.DefaultIssue; -import org.sonar.server.measure.Rating; import org.sonar.core.metric.SoftwareQualitiesMetrics; +import org.sonar.server.measure.Rating; import static org.sonar.api.measures.CoreMetrics.RELIABILITY_RATING_KEY; import static org.sonar.api.measures.CoreMetrics.SECURITY_RATING_KEY; import static org.sonar.api.rules.RuleType.BUG; import static org.sonar.api.rules.RuleType.VULNERABILITY; import static org.sonar.ce.task.projectanalysis.component.CrawlerDepthLimit.FILE; -import static org.sonar.server.measure.Rating.RATING_BY_SEVERITY; import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING_KEY; import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING_KEY; +import static org.sonar.server.measure.Rating.RATING_BY_SEVERITY; /** * Compute following measures for projects and descendants: @@ -57,7 +57,8 @@ public class ReliabilityAndSecurityRatingMeasuresVisitor extends PathAwareVisito private final ComponentIssuesRepository componentIssuesRepository; private final Map metricsByKey; - public ReliabilityAndSecurityRatingMeasuresVisitor(MetricRepository metricRepository, MeasureRepository measureRepository, ComponentIssuesRepository componentIssuesRepository) { + public ReliabilityAndSecurityRatingMeasuresVisitor(MetricRepository metricRepository, MeasureRepository measureRepository, + ComponentIssuesRepository componentIssuesRepository) { super(FILE, Order.POST_ORDER, CounterFactory.INSTANCE); this.measureRepository = measureRepository; this.componentIssuesRepository = componentIssuesRepository; @@ -106,9 +107,7 @@ public class ReliabilityAndSecurityRatingMeasuresVisitor extends PathAwareVisito componentIssuesRepository.getIssues(component) .stream() .filter(issue -> issue.resolution() == null) - .forEach(issue -> { - processIssue(path, issue); - }); + .forEach(issue -> processIssue(path, issue)); } private static void processIssue(Path path, DefaultIssue issue) { @@ -123,7 +122,8 @@ public class ReliabilityAndSecurityRatingMeasuresVisitor extends PathAwareVisito processSoftwareQualityRating(path, issue, SoftwareQuality.SECURITY, SOFTWARE_QUALITY_SECURITY_RATING_KEY); } - private static void processSoftwareQualityRating(Path path, DefaultIssue issue, SoftwareQuality softwareQuality, String metricKey) { + private static void processSoftwareQualityRating(Path path, DefaultIssue issue, SoftwareQuality softwareQuality, + String metricKey) { Severity severity = issue.impacts().get(softwareQuality); if (severity != null) { Rating rating = Rating.RATING_BY_SOFTWARE_QUALITY_SEVERITY.get(severity); -- 2.39.5