Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/edu/hm/hafner/grading/AnalysisMarkdown.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ protected String getToolIcon(final AnalysisScore score) {
if (REGISTRY.contains(parserId)) {
var descriptor = REGISTRY.get(parserId);
if (!descriptor.getIconUrl().isBlank()) {
return format("<img src=\"%s\" alt=\"%s\" height=\"%d\" width=\"%d\">",
descriptor.getIconUrl(), score.getName(), ICON_SIZE, ICON_SIZE);
return format("<img src=\"%s\" alt=\"%s\" width=\"%d\">",
descriptor.getIconUrl(), score.getName(), ICON_SIZE);
}
}
return getDefaultIcon(score);
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/edu/hm/hafner/grading/ScoreMarkdown.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@
private final String icon;

static String iconUrl(final String url, final String altText) {
return format(
"<img src=\"%s\" alt=\"%s\" height=\"%d\" width=\"%d\">",
url, altText, ICON_SIZE, ICON_SIZE);
return format("<img src=\"%s\" alt=\"%s\" width=\"%d\">", url, altText, ICON_SIZE);

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

View workflow job for this annotation

GitHub Actions / Quality Monitor - Quality gates failed

Mutation survived

One mutation survived in line 55 (EmptyObjectReturnValsMutator)
Raw output
Survived mutations:
- replaced return value with "" for edu/hm/hafner/grading/ScoreMarkdown::iconUrl (org.pitest.mutationtest.engine.gregor.mutators.returns.EmptyObjectReturnValsMutator)

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

View workflow job for this annotation

GitHub Actions / Quality Monitor - Quality gates failed

Mutation survived

One mutation survived in line 55 (EmptyObjectReturnValsMutator)
Raw output
Survived mutations:
- replaced return value with "" for edu/hm/hafner/grading/ScoreMarkdown::iconUrl (org.pitest.mutationtest.engine.gregor.mutators.returns.EmptyObjectReturnValsMutator)
}

ScoreMarkdown(final String type, final String icon) {
Expand Down Expand Up @@ -297,7 +295,7 @@
static String openmoji(final String configurationIcon, final String label) {
var icon = Strings.CS.removeStart(configurationIcon, OPEN_MOJI);
return ("<img src=\"https://openmoji.org/data/color/svg/"
+ "%s.svg\" alt=\"%s\" height=\"18\" width=\"18\">").formatted(icon, label);
+ "%s.svg\" alt=\"%s\" width=\"18\">").formatted(icon, label);
}

String formatColumns(final Object... columns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ void shouldShowMaximumScore() {
.contains("Static Analysis Warnings - 100 of 100")
.contains("|CheckStyle|Whole Project|0|0|:white_check_mark:");
assertThat(analysisMarkdown.createSummary(score))
.contains("CheckStyle (Whole Project) - 100 of 100", "checkstyle_logo_small_64.png", "No warnings");
.contains("CheckStyle (Whole Project) - 100 of 100", "No warnings")
.contains("<img", "width=", "checkstyle_logo_small_64.png")
.doesNotContain("height=");
}

@Test
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/edu/hm/hafner/grading/TestMarkdownTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ void shouldNeverShow100PercentOnFailures() {
var testMarkdown = new TestMarkdown();

assertThat(clean(testMarkdown.createSummary(score)))
.contains("JUnit (Whole Project):", "✅", "999999 passed");
.contains("JUnit (Whole Project):", "✅", "999999 passed")
.contains("<img", "width=", "junit-diamond.svg")
.doesNotContain("height=");

classNode.addTestCase(builder.withTestName("Failed Test").withFailure().build());
root.replaceValue(new Rate(Metric.TEST_SUCCESS_RATE, 999_999, 1_000_000));
Expand Down
Loading