Closed chenggangpro closed 2 years ago
@chenggangpro
Thanks for reporting. I have fixed it today and it should work for you if ($missedLines -eq 0) { $coveragePercentage = 100 } elseif ($coveredLines -eq 0) { $coveragePercentage = 0 } elseif ($coveredLines -eq 0 -and $missedLines -eq 0) { $coveragePercentage = 0 } else { $coveragePercentage = [math]::Round(100 - (($missedLines / $coveredLines) * 100)) }
@chenggangpro
If the fix is working for you hit STAR ⭐ on top right of this repo
Hi guys,
I'm new here.It seems like a bug as I mentioned below . When
$coveredLines
is 0, there is no place to check "$coveredLines" . Then it will raise an error aboutAttempted to divide by zero.
I think when$coveredLines
is 0 ,$coveragePercentage
should be zero directlyhttps://github.com/PavanMudigonda/jacoco-reporter/blob/95a0b976e99043d65782a3a68f3fda0b51dbd5f6/action.ps1#L142