From d9127ca6f8567cdda2afcc7c97d649382a916877 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Tue, 14 Sep 2021 15:13:57 -0500 Subject: [PATCH] SONAR-13798 Show NCLOC of the analysis when it's over the license's limit --- .../measure/PostMeasuresComputationCheck.java | 3 +++ .../measure/PostMeasuresComputationChecksStep.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationCheck.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationCheck.java index 68a31aaa327..b9bce9ac015 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationCheck.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationCheck.java @@ -22,6 +22,7 @@ package org.sonar.ce.task.projectanalysis.measure; import org.sonar.api.ExtensionPoint; import org.sonar.api.ce.ComputeEngineSide; import org.sonar.ce.task.projectanalysis.analysis.AnalysisMetadataHolder; +import org.sonar.ce.task.projectanalysis.component.Component; /** * Extension point that is called during processing of a task @@ -54,5 +55,7 @@ public interface PostMeasuresComputationCheck { */ int getNcloc(); + Component getRoot(); + } } diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationChecksStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationChecksStep.java index 10ff4ee0aa8..82390f9bad6 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationChecksStep.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationChecksStep.java @@ -23,6 +23,7 @@ import java.util.Optional; import org.sonar.api.ce.ComputeEngineSide; import org.sonar.api.measures.CoreMetrics; import org.sonar.ce.task.projectanalysis.analysis.AnalysisMetadataHolder; +import org.sonar.ce.task.projectanalysis.component.Component; import org.sonar.ce.task.projectanalysis.component.TreeRootHolder; import org.sonar.ce.task.projectanalysis.metric.Metric; import org.sonar.ce.task.projectanalysis.metric.MetricRepository; @@ -86,5 +87,9 @@ public class PostMeasuresComputationChecksStep implements ComputationStep { return nclocMeasure.map(Measure::getIntValue).orElse(0); } + @Override public Component getRoot() { + return treeRootHolder.getRoot(); + } + } } -- 2.39.5