sebastianbergmann / sebastianbergmann/php-code-coverage

Refactor how filtering works

Open
#386 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/refactoring
Dominant language
PHP
Stars
8.9k
Forks
385
Avg merge
12h 25m
Merged PRs (30d)
31

Description

Right now, File_Iterator is used to crawl the filesystem for files that match the criteria specified in the (PHPUnit) configuration resulting in a list (array) of files that are to be included in the code coverage report. This crawling is responsible for a slowdown in the startup of PHPUnit.

It would be better to store the information ("all *.php files in directory src) instead and match the filenames against that instead of a list generated through crawling.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading File_Iterator and the PHPUnit configuration filtering path to understand how criteria become the crawled file list. Compare that flow with storing directory and pattern information and matching filenames later. Done means preserving the selected files in coverage reports while reducing PHPUnit startup slowdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.