Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.List;
import java.util.Locale;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand All @@ -15,7 +14,6 @@
import edu.hm.hafner.coverage.FractionValue;
import edu.hm.hafner.coverage.IntegerValue;
import edu.hm.hafner.coverage.Metric;
import edu.hm.hafner.coverage.Node;
import edu.hm.hafner.coverage.Percentage;
import edu.hm.hafner.coverage.Value;

Expand Down Expand Up @@ -417,23 +415,6 @@ public List<String> getFormattedValues(final Stream<? extends Value> values, fin
return values.map(value -> formatDetails(value, locale)).collect(Collectors.toList());
}

/**
* Returns a stream of {@link Coverage} values for the given root node sorted by the metric ordinal.
*
* @param coverage
* The coverage root node
*
* @return a stream containing the existent coverage values
*/
public Stream<Coverage> getSortedCoverageValues(final Node coverage) {
return Metric.getCoverageMetrics()
.stream()
.map(m -> m.getValueFor(coverage))
.flatMap(Optional::stream)
.filter(value -> value instanceof Coverage)
.map(Coverage.class::cast);
}

/**
* Returns a localized human-readable label for the specified metric.
*
Expand Down Expand Up @@ -498,6 +479,8 @@ public String getDisplayName(final Baseline baseline) {
return Messages.Baseline_MODIFIED_LINES_DELTA();
case MODIFIED_FILES_DELTA:
return Messages.Baseline_MODIFIED_FILES_DELTA();
case INDIRECT:
return Messages.Baseline_INDIRECT();
default:
throw new NoSuchElementException("No display name found for baseline " + baseline);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ public Baseline getDeltaBaseline(final Baseline baseline) {
if (baseline == Baseline.MODIFIED_FILES) {
return Baseline.MODIFIED_FILES_DELTA;
}
if (baseline == Baseline.INDIRECT) {
return Baseline.INDIRECT;
}
throw new NoSuchElementException("No delta baseline for this baseline: " + baseline);
}

Expand Down
Loading