Details
Description
On a rare occasion when coverage report contains line like this
<metrics loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
analysis crashes with the following error:
Caused by: java.lang.NumberFormatException at java.math.BigDecimal.<init>(BigDecimal.java:459) at java.math.BigDecimal.<init>(BigDecimal.java:728) at java.math.BigDecimal.valueOf(BigDecimal.java:1054) at org.sonar.api.utils.ParsingUtils.scaleValue(ParsingUtils.java:70) at org.sonar.api.utils.ParsingUtils.scaleValue(ParsingUtils.java:63) at org.sonar.plugins.php.phpunit.PhpUnitCoverageResultParser.saveCoverageMeasure(PhpUnitCoverageResultParser.java:157) at org.sonar.plugins.php.phpunit.PhpUnitCoverageResultParser.parseFileNodes(PhpUnitCoverageResultParser.java:123) at org.sonar.plugins.php.phpunit.PhpUnitCoverageResultParser.parseFile(PhpUnitCoverageResultParser.java:107) at org.sonar.plugins.php.phpunit.PhpUnitCoverageResultParser.parse(PhpUnitCoverageResultParser.java:91) at org.sonar.plugins.php.phpunit.PhpUnitSensor.analyse(PhpUnitSensor.java:74) at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64) at org.sonar.batch.phases.Phases.execute(Phases.java:93) at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
See the example with the full stacktrace here: https://gist.github.com/1433882
Attachments
Issue Links
- is duplicated by
-
SONARPHP-75 PHP Coverage report parrsing can fail if a file has no statement
-
- Closed
-