PHPackages                             andrey-tech/phpunit-cobertura-comparator-php - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. andrey-tech/phpunit-cobertura-comparator-php

ActiveLibrary[Testing &amp; Quality](/categories/testing)

andrey-tech/phpunit-cobertura-comparator-php
============================================

A lightweight CLI tool to track PHPUnit code coverage regressions using Cobertura reports

1.2.1(2mo ago)0268MITPHPPHP ^8.3CI passing

Since Apr 9Pushed 2mo agoCompare

[ Source](https://github.com/andrey-tech/phpunit-cobertura-comparator-php)[ Packagist](https://packagist.org/packages/andrey-tech/phpunit-cobertura-comparator-php)[ Docs](https://github.com/andrey-tech/phpunit-cobertura-comparator-php)[ RSS](/packages/andrey-tech-phpunit-cobertura-comparator-php/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (11)Versions (5)Used By (0)

PHPUnit Cobertura Comparator
============================

[](#phpunit-cobertura-comparator)

[![PHPUnit Cobertura Comparator logo](./assets/phpunit-cobertura-comparator-logo.png)](./assets/phpunit-cobertura-comparator-logo.png)

[![Latest Stable Version](https://camo.githubusercontent.com/91ceb45bb20bf709ca5c2e97752a3a7b4df29c0ee3fb8b88ad57d393afd1530f/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f706870756e69742d636f626572747572612d636f6d70617261746f722d7068702f76)](https://packagist.org/packages/andrey-tech/phpunit-cobertura-comparator-php)[![PHP workflow](https://github.com/andrey-tech/phpunit-cobertura-comparator-php/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/andrey-tech/phpunit-cobertura-comparator-php/actions/workflows/php.yml)[![Total Downloads](https://camo.githubusercontent.com/1d11ed18576e2b4253a2348fe4e85c018f780feab87927b67e395019475333f6/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f706870756e69742d636f626572747572612d636f6d70617261746f722d7068702f646f776e6c6f616473)](//packagist.org/packages/andrey-tech/phpunit-cobertura-comparator-php)[![PHP Version Require](https://camo.githubusercontent.com/68190d1860d4465197517434ddbbe487bbd54f824ea4b926f311b95dfb4bd7ae/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f706870756e69742d636f626572747572612d636f6d70617261746f722d7068702f726571756972652f706870)](https://packagist.org/packages/andrey-tech/phpunit-cobertura-comparator-php)[![License](https://camo.githubusercontent.com/1bc76ce701c9ab3c8376df1a5df6d2e9bb199e3f6fee259381922bdc339659b4/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f706870756e69742d636f626572747572612d636f6d70617261746f722d7068702f6c6963656e7365)](https://packagist.org/packages/andrey-tech/phpunit-cobertura-comparator-php)

PHPUnit Cobertura Comparator is a lightweight CLI tool to track [PHPUnit](https://docs.phpunit.de/en/12.2/code-coverage.html#software-metrics-for-code-coverage)code coverage regressions using [Cobertura](https://github.com/cobertura/cobertura) reports.

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

[](#installation)

The tool requires [PHP](https://www.php.net) version 8.3 or higher.

Install via Composer:

```
composer require --dev andrey-tech/phpunit-cobertura-comparator-php
```

Usage
-----

[](#usage)

The command line:

```
./vendor/bin/phpunit-cobertura-comparator
```

The optional command line arguments:

- `--no-colors` — disable ANSI color output;
- `--ignore-branch-rate` — ignore branch-rate in a Cobertura XML file.

An example command line:

```
./vendor/bin/phpunit-cobertura-comparator cobertura-old.xml cobertura-new.xml
```

An example of the console output:

```
Parsing Cobertura XML file 'cobertura-old.xml'...
Parsing Cobertura XML file 'cobertura-new.xml'...
Coverage comparison: 2025-09-02T11:27:55+00:00 -> 2025-09-03T06:54:35+00:00
Coverage regressions found in 1 class(es):
CLASS: App\Purchase\Fixer
+---------------------------+--------+------------------+--------------------+
| Method                    | Status | Line coverage, % | Branch coverage, % |
+---------------------------+--------+------------------+--------------------+
| CLASS                     | old    | 98.44 -> 92.58   | 92.53 -> 85.22     |
| fix                       | old    | 100.00 -> 100.00 | 100.00 -> 100.00   |
| fixPrice                  | old    | 96.11 -> 100.00  | 94.76 -> 75.33     |
| fixRate                   | new    | x -> 85.90       | x -> 95.24         |
| fixCharges                | del    | 100.00 -> x      | 100.00 -> x        |
+---------------------------+--------+------------------+--------------------+

Exit code: 2. Time: 6 ms. Memory: 1.40/2.00 MiB.

```

Columns in the table:

- `Method` — the method name;
- `Status` — the status of the method or class (`old`, `new`, `del`);
- `Line coverage, %` — the line coverage of the method or class (`old` -&gt; `new`);
- `Branch coverage, %` — the branch coverage of the method or class (`old` -&gt; `new`).

The tool shows line and branch coverage, measured by PHP Unit, in ANSI colors:

ColorLine or branch coverageStatus`red`The coverage has decreased—`yellow`—Deleted`green`The coverage has increasedNew`white`The coverage has not changedOldExit codes
----------

[](#exit-codes)

The tool defines different exit codes:

CodeDescription0Everything worked as expected and no coverage regressions found1An error/exception occurred which has interrupted tool during execution2Everything worked as expected but coverage regressions foundAuthors and Maintainers
-----------------------

[](#authors-and-maintainers)

The author and maintainer of PHPUnit Cobertura Comparator is [andrey-tech](https://github.com/andrey-tech).

License
-------

[](#license)

This tool is licensed under the [MIT license](./LICENSE).

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance86

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~1 days

Total

4

Last Release

73d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51994444?v=4)[Andrey](/maintainers/andrey-tech)[@andrey-tech](https://github.com/andrey-tech)

---

Top Contributors

[![andrey-tech](https://avatars.githubusercontent.com/u/51994444?v=4)](https://github.com/andrey-tech "andrey-tech (28 commits)")

---

Tags

coberturacoveragecoverage-reportphpunitregressionphpunitconsoletestcoverageMetricscobertura

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/andrey-tech-phpunit-cobertura-comparator-php/health.svg)

```
[![Health](https://phpackages.com/badges/andrey-tech-phpunit-cobertura-comparator-php/health.svg)](https://phpackages.com/packages/andrey-tech-phpunit-cobertura-comparator-php)
```

###  Alternatives

[php-coveralls/php-coveralls

PHP client library for Coveralls API

51514.1M3.6k](/packages/php-coveralls-php-coveralls)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

623.8M47](/packages/dvdoug-behat-code-coverage)[testo/testo

A lightweight PHP testing framework.

1923.4k32](/packages/testo-testo)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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