PHP Coverage - uncovered new line at end of file

SonarCloud code coverage is reporting new lines at the end of files as uncovered with reports generated by the latest version of PHPUnit.

Newer XML reports include the new line at end of file, e.g.:
<line num="32" type="stmt" count="0"/>

I initially thought this was problem with the XML report we upload, but the issue I raised relating to this has been closed by the maintainer:

Please can you advise how we resolve this?

Hello @davidgrayston and welcome to the community,

Thanks for reaching us.
We are looking into it and will get back to you soon.

Best,
Nils

1 Like

This is how a file (that used to have 100% coverage) displays on SonarCloud:
sonarcloud_coverage

With 1 “Uncovered Lines on New Code”

1 Like

I’ve replied to the closed issue https://github.com/sebastianbergmann/php-code-coverage/issues/799#issuecomment-678280989 as it appears the line is covered when processUncoveredFiles=“false”

I don’t think they will reply to the closed issue, so I might need to open a new one, but I won’t do so until you confirm where you think this needs to be resolved.

https://github.com/sebastianbergmann/php-code-coverage/issues/799 has been reopened, which means the XML report will likely be fixed and resolve this issue

1 Like

Hi @davidgrayston,

thanks for keeping us up to date.
If the problem persists on our site, just contact us again,
otherwise, I would ask you to mark this thread as resolved.

Best,
Nils

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.