]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13798 Show NCLOC of the analysis when it's over the license's limit
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Tue, 14 Sep 2021 20:13:57 +0000 (15:13 -0500)
committersonartech <sonartech@sonarsource.com>
Thu, 16 Sep 2021 20:03:31 +0000 (20:03 +0000)
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationCheck.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/PostMeasuresComputationChecksStep.java

index 68a31aaa3270ba542db82eae9f69916964b12642..b9bce9ac01581f837e1b2379b561b64018690dd6 100644 (file)
@@ -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();
+
   }
 }
index 10ff4ee0aa89b5a7954dfbde9dc10552e26c3133..82390f9bad64e29d8c65251ac8d3a0e8f7362f75 100644 (file)
@@ -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();
+    }
+
   }
 }