Skip to content

Commit

Permalink
Simplify the selection of the cell icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed May 10, 2023
1 parent 9cde654 commit be43693
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,7 @@ private String getTrendIcon(final String trend) {
if (!StringUtils.containsAny(trend, "123456789") || trend.startsWith("n/a")) {

Check warning on line 438 in plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageChecksPublisher.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 438 is only partially covered, one branch is missing
return StringUtils.EMPTY;
}
if (trend.startsWith("+")) {
return GAP + Icon.ARROW_UP.markdown;
}
else if (trend.startsWith("-")) {
return GAP + Icon.ARROW_DOWN.markdown;
}
return GAP + Icon.ARROW_RIGHT.markdown;
return GAP + (trend.startsWith("+") ? Icon.ARROW_UP.markdown : Icon.ARROW_DOWN.markdown);
}

private String getBulletListItem(final int level, final String text) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ private CoverageBuildAction createCoverageBuildAction(final Node result) {

return new CoverageBuildAction(run, COVERAGE_ID, REPORT_NAME, StringUtils.EMPTY, result,
new QualityGateResult(), null, "refId",
new TreeMap<>(Map.of(Metric.LINE, Fraction.ONE_HALF, Metric.MODULE, Fraction.ZERO)),
new TreeMap<>(Map.of(
Metric.LINE, Fraction.ONE_HALF,
Metric.MODULE, Fraction.ZERO,
Metric.PACKAGE, Fraction.ONE_HALF.negate())),
List.of(testCoverage), new TreeMap<>(Map.of(Metric.LINE, Fraction.ONE_HALF)), List.of(testCoverage),
new TreeMap<>(Map.of(Metric.LINE, Fraction.ONE_HALF)), List.of(testCoverage), false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
||Module Coverage|Package Coverage|File Coverage|Class Coverage|Method Coverage|Line Coverage|Branch Coverage|Instruction Coverage
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:
:feet: **Overall project**|100.00% (1/1)|100.00% (4/4)|70.00% (7/10)|83.33% (15/18)|95.10% (97/102)|91.02% (294/323)|93.97% (109/116)|93.33% (1260/1350)
:chart_with_upwards_trend: **Overall project (difference to reference job)**|+0.00%|n/a|n/a|n/a|n/a|+50.00% :arrow_up:|n/a|n/a
:chart_with_upwards_trend: **Overall project (difference to reference job)**|+0.00%|-50.00% :arrow_down:|n/a|n/a|n/a|+50.00% :arrow_up:|n/a|n/a
:feet: **Modified files**|n/a|n/a|n/a|n/a|n/a|50.00% (1/2)|n/a|n/a
:chart_with_upwards_trend: **Modified files (difference to overall project)**|n/a|n/a|n/a|n/a|n/a|+50.00% :arrow_up:|n/a|n/a
:feet: **Modified code lines**|n/a|n/a|n/a|n/a|n/a|50.00% (1/2)|n/a|n/a
Expand Down

0 comments on commit be43693

Please sign in to comment.