use of org.sonar.server.computation.task.projectanalysis.qualitygate.EvaluationResult in project sonarqube by SonarSource.
the class QualityGateMeasuresStep method evaluateQualityGate.
private static MetricEvaluationResult evaluateQualityGate(Measure measure, Collection<Condition> conditions) {
ConditionEvaluator conditionEvaluator = new ConditionEvaluator();
MetricEvaluationResult metricEvaluationResult = null;
for (Condition newCondition : PERIOD_ORDERING.immutableSortedCopy(conditions)) {
EvaluationResult newEvaluationResult = conditionEvaluator.evaluate(newCondition, measure);
if (metricEvaluationResult == null || newEvaluationResult.getLevel().ordinal() > metricEvaluationResult.evaluationResult.getLevel().ordinal()) {
metricEvaluationResult = new MetricEvaluationResult(newEvaluationResult, newCondition);
}
}
return metricEvaluationResult;
}
Aggregations