View Issue Details

IDProjectCategoryView StatusLast Update
0001144XdebugFeature/Change requestpublic2016-12-13 21:32
ReportersebastianAssigned Toderick 
Status resolvedResolutionduplicate 
PlatformIrrelevantOSIrrelevantOS VersionIrrelevant
Product Version2.3.2 
Target VersionFixed in Version 
Summary0001144: Add support for filtering of files for code coverage
DescriptionAt the moment, Xdebug returns code coverage for all files from which code is executed between xdebug_start_code_coverage() and xdebug_end_code_coverage().

PHP_CodeCoverage takes the raw data that is returned from xdebug_get_code_coverage() and filters it, ie. removes non-whitelisted files when a whilelist is configured or removes blacklisted files when a blacklist is used.

The analysis that is performed by Xdebug when XDEBUG_CC_BRANCH_CHECK is set is an expensive operation that is uselessly performed for code that a user of PHPUnit / PHP_CodeCoverage is not interested in (the code of PHPUnit and its dependencies, for instance).

It would be beneficial for performance reasons to move the blacklist / whitelist filtering from PHP_CodeCoverage to Xdebug.
TagsNo tags attached.
Operating SystemIrrelevant
PHP Version5.6.5-5.6.9



2015-04-16 06:48

reporter   ~0003071

By the way: I do not think that it would be a good idea to pass the list of whitelisted or blacklisted files to Xdebug with every call to xdebug_start_code_coverage().

There should be two new functions, xdebug_set_code_coverage_blacklist() and xdebug_set_code_coverage_whitelist(), that can be used to configure the filter. This way the data needs to be passed from userland to Xdebug only once.


2015-06-25 12:38

developer   ~0003130

Is there any plan to work on this ? This would be a huge help when collecting coverage for a functional testsuite.
Slowing down Symfony, Doctrine and all my other deps to collect code coverage on them while PHPunit will then filter all this data out is just a waste of time (and I'm talking about going from a few minutes without coverage to a few hours with coverage enabled on Xdebug 2.3)


2015-06-25 13:33

administrator   ~0003131

Most definitely. Probably on a plane or something. However, I want to have PHP 7 support sort of working first!


2015-06-25 13:41

developer   ~0003136

Well, to be honest, I'm more interested in getting a usable code coverage reporting on my PHP 5.6 setup (i.e. not taking hours to run my tests with code coverage) than having support for PHP 7 yet (even though it will also be great) :)

If I knew C (and had more time as my own OSS projects are already missing attention currently), I would even consider contributing to this. But my C knowledge is approximately equivalent to building a HelloWorld displayed in STDOUT, so I fear it won't be enough...


2016-05-12 16:25

developer   ~0003602

is there any plan to implement this now that PHP 7 support is out ?

On a side note, PHPUnit only needs whitelisting support now rather than blacklisting, as PHPUnit 5 removed the blacklisting


2016-11-28 21:39

reporter   ~0003834

Derick: Is this still on your TODO?


2016-11-28 23:36

administrator   ~0003839

Yes, most definitely!


2016-12-13 21:32

administrator   ~0004049

Duplicate of 0001059, which was requested first.

Issue History

Date Modified Username Field Change
2015-04-16 06:42 sebastian New Issue
2015-04-16 06:48 sebastian Note Added: 0003071
2015-06-25 12:38 stof Note Added: 0003130
2015-06-25 13:33 derick Note Added: 0003131
2015-06-25 13:41 stof Note Added: 0003136
2015-11-22 09:02 derick Target Version => 2.5.0dev
2016-05-12 16:25 stof Note Added: 0003602
2016-11-28 21:39 sebastian Note Added: 0003834
2016-11-28 23:36 derick Note Added: 0003839
2016-11-28 23:36 derick Assigned To => derick
2016-11-28 23:36 derick Status new => confirmed
2016-12-04 18:34 derick Target Version 2.5.0dev =>
2016-12-13 21:32 derick Note Added: 0004049
2016-12-13 21:32 derick Status confirmed => resolved
2016-12-13 21:32 derick Resolution open => duplicate