diff options
author | Eric Giffon <eric.giffon@sonarsource.com> | 2024-10-01 18:50:36 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-10-09 20:02:47 +0000 |
commit | edabd8b0238186fcb10255865e29f8311c2e4972 (patch) | |
tree | 8e32d81a745b5086140cfaf9e71d8ebcdab179e9 /server/sonar-ce-task-projectanalysis | |
parent | f5faab7f779124905eb84b7e8ae28db52c1dd685 (diff) | |
download | sonarqube-edabd8b0238186fcb10255865e29f8311c2e4972.tar.gz sonarqube-edabd8b0238186fcb10255865e29f8311c2e4972.zip |
SONAR-22872 Prevent duplication computation for each metric
Diffstat (limited to 'server/sonar-ce-task-projectanalysis')
-rw-r--r-- | server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistMeasuresStep.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistMeasuresStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistMeasuresStep.java index bf5ae6856f6..5429d26887e 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistMeasuresStep.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistMeasuresStep.java @@ -190,14 +190,14 @@ public class PersistMeasuresStep implements ComputationStep { .map(MeasureToMeasureDto::getMeasureValue) .filter(Objects::nonNull) .forEach(value -> measureDto.addValue(metric.getKey(), value)); + } - if (component.getType() == Type.FILE) { - if (computeDuplicationDataMeasure == null) { - throw new IllegalStateException("ComputeDuplicationDataMeasure not initialized in container"); - } - computeDuplicationDataMeasure.compute(component) - .ifPresent(duplicationData -> measureDto.addValue(DUPLICATIONS_DATA_KEY, duplicationData)); + if (component.getType() == Type.FILE) { + if (computeDuplicationDataMeasure == null) { + throw new IllegalStateException("ComputeDuplicationDataMeasure not initialized in container"); } + computeDuplicationDataMeasure.compute(component) + .ifPresent(duplicationData -> measureDto.addValue(DUPLICATIONS_DATA_KEY, duplicationData)); } return measureDto; |