krakjoe / pcov

PCOV - CodeCoverage compatible driver for PHP
Other
703 stars 28 forks source link

Reporting method curly braces ( `{` and `}`) as not covered, but method content as covered #56

Open fleuryc opened 4 years ago

fleuryc commented 4 years ago

Hi !

Very weird : since a few weeks/months, method curly braces ( { and }) are reported as not covered , even if the method declaration and content are reported as covered (and they are actually covered).

Command used :

php \
            -d pcov.enabled=1 \
            -d pcov.directory=src \
            -d pcov.initial.files=2048  \
            -d memory_limit=-1 \
            bin/phpunit --log-junit junit.xml --coverage-clover clover.xml -c phpunit.xml.dist

The coverage is then sent to SonarCloud, and the uncovered lines break our Quality Gate.

Fro example, this DTO :

image

What's going on ? How can I fix this ? Is it a configuration issue or a bug ?

Thanks for your help !

gitnchez commented 3 years ago

Hi Check your newlines, this happens when you have windows-style line separators- CLRF (\r\n) instead of linux (\n)

nymo commented 1 year ago

We have the same issue. Our line separators are linux style. Are there any other ideas where the problem comes from?