Skip to content

Lines with 0 executions should be marked as "Non covered" #1060

Closed
@gufoe

Description

@gufoe
Q A
php-code-coverage version 11.0.8
PHP version 8.3.11
Driver Xdebug
Xdebug version (if used) v3.2.0
Installation Method Composer
Usage Method other

I am new to this library which seems fantastic, but I have found a weird behaviour.
Files that have some lines tested are shown as 100% tested, even if they contain some functions that have never been executed.

I have made a very minimal and self contained example here, you can just run it with php -d xdebug.mode=coverage index.php and you'll find the report in report/index.html.

The report will show the file as 100% coverage (3/3 lines).
But the file does not have 3 lines: it has 41 lines, so i was expecting 3/41 tested (~7% coverage).

Am I getting something wrong or is there a bug in the library?

image
image

Thank you very much for the effort you put into this library, it really helps.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions