PHPackages                             vitalyspirin/codecoverage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. vitalyspirin/codecoverage

ActiveProject[Debugging &amp; Profiling](/categories/debugging)

vitalyspirin/codecoverage
=========================

Creating code coverage reports (html) by using xdebug

2.0.1(9y ago)051PHPPHP &gt;=5.3.0

Since Jun 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vitalyspirin/codecoverage)[ Packagist](https://packagist.org/packages/vitalyspirin/codecoverage)[ Docs](https://github.com/vitalyspirin/codecoverage)[ RSS](/packages/vitalyspirin-codecoverage/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

CodeCoverage
============

[](#codecoverage)

Wrapper classes around xDebug to show code coverage data as html files.

Installation
------------

[](#installation)

```
composer require vitalyspirin/codecoverage

```

To generate HTML reports and see them in a table you can put file examples/reporting.php on the same level as a directory for code coverage reports. Then in a browser navigate to reporting.php.

Inside directory for code coverage reports you can create file 'userstory' with the word "off" as a content to disable code coverage (and speed up execution).

Quick Start and Examples
------------------------

[](#quick-start-and-examples)

```
use vitalyspirin\codecoverage\CodeCoverage;

$reportDir = 'CodeCoverageReports';  // directory for report files
CodeCoverage::deleteAllReports($reportDir); // remove this if you need cumulative coverage
CodeCoverage::start();

$a = new A();

CodeCoverage::stop();
CodeCoverage::deleteTxtReports(); // remove this if you need cumulative coverage
```

```
CodeCoverage::$trackedFileList['test2'] = [];
CodeCoverage::$trackedFileList['test2'][] = realpath(dirname(__FILE__) . '/A.php');

$reportDir = 'CodeCoverageReports';  // directory for report files
CodeCoverage::start($reportDir, "test2"); // "test2" is used to indicate which files should be analyzed.

$a = new A();

CodeCoverage::stop();
```

General way to put it into main router (index.php):

```
require_once(__DIR__ . '/vendor/vitalyspirin/codecoverage/src/CodeCoverage.php');

vitalyspirin\codecoverage\CodeCoverage::start(__DIR__ . '/codecoverage');

register_shutdown_function(function() {
    vitalyspirin\codecoverage\CodeCoverage::stop();
});
```

Screenshot
----------

[](#screenshot)

[![screenshot1.png](/docs/screenshot1.png "Code Coverage screenshot")](/docs/screenshot1.png)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

3

Last Release

3640d ago

Major Versions

1.0.0 → 2.0.02016-06-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7786743?v=4)[Vitaly Spirin](/maintainers/vitalyspirin)[@vitalyspirin](https://github.com/vitalyspirin)

---

Top Contributors

[![vitalyspirin](https://avatars.githubusercontent.com/u/7786743?v=4)](https://github.com/vitalyspirin "vitalyspirin (19 commits)")

---

Tags

phpXdebugcode coverage

### Embed Badge

![Health badge](/badges/vitalyspirin-codecoverage/health.svg)

```
[![Health](https://phpackages.com/badges/vitalyspirin-codecoverage/health.svg)](https://phpackages.com/packages/vitalyspirin-codecoverage)
```

###  Alternatives

[tracy/tracy

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

1.8k25.1M1.4k](/packages/tracy-tracy)[laracraft-tech/laravel-xhprof

Easy XHProf setup to profile your laravel application!

235344.1k](/packages/laracraft-tech-laravel-xhprof)[noisebynorthwest/php-spx

A simple &amp; straight-to-the-point PHP profiling extension with its built-in web UI

2.6k1.3k](/packages/noisebynorthwest-php-spx)[koriym/xdebug-mcp

Universal PHP Xdebug MCP Server with AI-optimized debugging support

5221.3k1](/packages/koriym-xdebug-mcp)[bavix/laravel-xhprof

Quick profiling of your code for Laravel

22157.3k](/packages/bavix-laravel-xhprof)[h4cc/phpqatools

A meta composer package for PHP QA Tools.

6118.6k1](/packages/h4cc-phpqatools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
