Skip to content

Commit

Permalink
Fix warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed May 8, 2024
1 parent 055bf31 commit eb2524b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/main/java/edu/hm/hafner/grading/CoverageScore.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@ private CoverageScore(final String id, final String name, final CoverageConfigur
scores.stream().map(CoverageScore::getReport).forEach(report::addChild);

Check warning on line 62 in src/main/java/edu/hm/hafner/grading/CoverageScore.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Mutation survived

One mutation survived in line 62 (VoidMethodCallMutator)
Raw output
Survived mutations:
- removed call to java/util/stream/Stream::forEach (org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator)
}

private int getMissedFiles(final CoverageScore score) {
var value = score.getReport().getValue(Metric.FILE);
if (value.isEmpty()) {
return 0;
}
var coverage = value.get();
if (coverage instanceof Coverage) {
return ((Coverage) coverage).getMissed();
}
return 0;
}

private CoverageScore(final String id, final String name, final CoverageConfiguration configuration,
final Node report, final Metric metric) {
super(id, name, configuration);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/edu/hm/hafner/grading/ScoreMarkdown.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.apache.commons.lang3.StringUtils;

import edu.hm.hafner.grading.TruncatedString.TruncatedStringBuilder;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
* Base class to render results in Markdown.
Expand Down Expand Up @@ -53,6 +54,8 @@ abstract class ScoreMarkdown<S extends Score<S, C>, C extends Configuration> {
*
* @return Markdown text
*/
@SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE",
justification = "Output is Unix anyway")
public static String getPercentageImage(final String title, final int percentage) {
if (percentage < 0 || percentage > HUNDRED_PERCENT) {

Check warning on line 60 in src/main/java/edu/hm/hafner/grading/ScoreMarkdown.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Partially covered line

Line 60 is only partially covered, 2 branches are missing
throw new IllegalArgumentException("Percentage must be between 0 and 100: " + percentage);

Check warning on line 61 in src/main/java/edu/hm/hafner/grading/ScoreMarkdown.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Not covered line

Line 61 is not covered by tests
Expand Down

0 comments on commit eb2524b

Please sign in to comment.