PHPackages                             df/php-coverfish - 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. df/php-coverfish

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

df/php-coverfish
================

lightweight static code analysis tool for class coverage check of PHPUnit's CodeCoverage

1.0.1(10y ago)234.9k1[1 issues](https://github.com/dunkelfrosch/phpcoverfish/issues)1MITPHPPHP &gt;=5.5.9

Since Aug 8Pushed 8y ago3 watchersCompare

[ Source](https://github.com/dunkelfrosch/phpcoverfish)[ Packagist](https://packagist.org/packages/df/php-coverfish)[ RSS](/packages/df-php-coverfish/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (13)Used By (1)

PHPCoverFish
============

[](#phpcoverfish)

phpCoverFish (coverfish) is an open source php cli static code validator used for code coverage pre-processing. coverFish will analyze all of your @covers annotations inside your test files before the big code coverage train will run through all of your tests and may collide with bad coverage annotations scattered along the rails. Coverfish is using plugin base validators and is easy to extend / fulfill changes or extension in code coverage annotations.

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Software version](https://camo.githubusercontent.com/b11d48a2868798b81169f053967d1af21fd82a698ad214583a5aba77f1a1f8ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e322d677265656e2e737667)](VERSION)[![Build Status](https://camo.githubusercontent.com/ff8fe23bc617cbd9c5cfa8be02ccbb6cc598c89fa1f55bcff5bd8972823bdff0/68747470733a2f2f7472617669732d63692e6f72672f64756e6b656c66726f7363682f706870636f766572666973682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dunkelfrosch/phpcoverfish)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8b723811b2938a3929fe9c533e89a253b07189c494586ff2bb7cc3018bb82b45/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64756e6b656c66726f7363682f706870636f766572666973682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dunkelfrosch/phpcoverfish/?branch=master)[![Code Climate](https://camo.githubusercontent.com/be7695eb382ac5ff1091ea06a4e70a01974dce15a9435748246fe148f7af3d08/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f64756e6b656c66726f7363682f706870636f766572666973682f6261646765732f6770612e737667)](https://codeclimate.com/github/dunkelfrosch/phpcoverfish)[![Code Coverage](https://camo.githubusercontent.com/9c02489c345c31d12757dda0e4d4bb5423c8fdcc57cc5eec992cdbb03e117202/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64756e6b656c66726f7363682f706870636f766572666973682f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dunkelfrosch/phpcoverfish/?branch=master)[![Project Status](https://camo.githubusercontent.com/b693d8d2e038849e2e20fa61d35286ed62db7e4ec670ebf750ab057767bb9b6d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f6a6563742532307374617475732d696e6163746976652d6f72616e67652e737667)](STATUS)

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

[](#installation)

If you use Composer to manage the dependencies of your project, edit your projects composer.json file and add a dependency on df/phpcoverfish. Below you can find find a minimal example of a composer.json file that just defines a *dev-time* dependency on PHPCoverFish (stable strain):

```
...
{
    "require-dev": {
        "df/php-coverfish": "~1.0"
}
...

```

You can also execute the following composer command in your console:

```
composer require df/php-coverfish

```

In order to use upcoming PHPCoverFish beta releases you will need to take down the minimum-stability key in your composer.json file (set "beta"). Simply place this line above your "extra" property key:

```
...
"minimum-stability": "beta",
"extra": {
...

```

Afterwards, just call *composer install "df/phpcoverfish=~1.0"* or use *composer update* and create a symbolic link from *vendor/df/coverfish/bin/coverfish.php* to your web application tool directory (this step is optional).

```
composer install "df/php-coverfish=~1.0"

```

To provide coverfish system-wide just type the following command:

```
composer global require "df/php-coverfish=~1.0"

```

Don't forget to make sure you've got your composers vendor binary path available in your global shell path:

```
PATH=$PATH:~/.composer/vendor/bin/

```

As soon as coverfish will reach it's stable state we will not only provide an additional phar file but also a corresponding download link / installer for **wget** related installation of PHPCoverFish.

Usage
-----

[](#usage)

To call coverfish from your shell after installation use the following two modes: *if you bound coverfish in your symfony application, composer will be create a symbolic link inside your bin/ directory so you can call this tool like others (phpunit, ...) from this path directly.*

**PHPUnit-Mode** scan (the recommended scan mode), using existing phpunit.xml instead of "raw" parameter for scan-path, exclude-path and autoload-file:

```
php ./bin/coverfish scan tests/phpunit.xml \
        --phpunit-config-suite "PHPCoverFish Suite" \
        --output-level 1 \
        --no-ansi

```

for example (using phpunit.xml without any test suite name will take first test suite configuration for this scan) :

```
php ./bin/coverfish scan tests/phpunit.xml --output-level 1 --no-ansi

```

or (using phpunit test suite name "PHPCoverFish Suite" ):

```
php ./bin/coverfish scan tests/phpunit.xml --phpunit-config-suite "PHPCoverFish Suite" --output-level 1 --no-ansi

```

the screen result for code with and without called test suite should be the same:

[![phpunit mode result](https://camo.githubusercontent.com/c90974b8fc536cbd7c2447be129de3c2d6e1a5e6db0d256be344d74cfc11473e/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f6e7977647879637171666f6f3878382f63665f636c695f7261776d6f64655f31323830783332352e706e67)](https://camo.githubusercontent.com/c90974b8fc536cbd7c2447be129de3c2d6e1a5e6db0d256be344d74cfc11473e/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f6e7977647879637171666f6f3878382f63665f636c695f7261776d6f64655f31323830783332352e706e67)

**RAW-Mode** scan (alternative scan mode), using additional parameters for required scan-path, autoload-file (exclude path will be used optional here)

```
php bin/coverfish.php *scan* \
        --raw-scan-path "" \
        --raw-autoload-file "" \
        --raw-exclude-path ""

```

for example:

```
php ./bin/coverfish scan --raw-scan-path tests/ --raw-autoload-file "vendor/autoload.php" --raw-exclude-path "tests/data" --output-level 1 --no-ansi

```

the result should looking like: [![raw mode result](https://camo.githubusercontent.com/800c4d6aee98ac1e3eeaac41472e55c3c0e62d0c7920b2f652f4bd8194932333/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f647574627a706e687862676e726b632f63665f636c695f706870756e69746d6f64655f31323830783332352e706e67)](https://camo.githubusercontent.com/800c4d6aee98ac1e3eeaac41472e55c3c0e62d0c7920b2f652f4bd8194932333/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f647574627a706e687862676e726b632f63665f636c695f706870756e69746d6f64655f31323830783332352e706e67)

PHPCoverfish arguments and parameter
------------------------------------

[](#phpcoverfish-arguments-and-parameter)

To call the PHPCoverFish help page use:

```
php bin/coverfish.php help scan

```

### Arguments

[](#arguments)

```
scan                     scan/analyze command (currently the only available mode of coverfish)
phpunit-config           path to your project phpunit.xml config file (e.g. tests/phpunit.xml)
                         this argument override all raw-parameters (raw-scan-path, raw-autoload-path ...)

```

### Parameters (optional)

[](#parameters-optional)

```
raw-scan-path            path to your target php unit class test files or a single test file
raw-exclude-path         exclude a specific path from your planned scan
raw-autoload-file        your application used autoload file (psr-0/psr-4 standard)
                         will be replaced by phpunit.xml file in our upcoming beta version
-f | --output-format     json, text (default) - rendering of scan result output format (json or text)
-l | --output-level      detail of scan result output (0=minimal, 1=normal(default), 2=detailed)
-n | --no-interaction    not necessary, no virtual interaction planned yet
-v | --verbose           will be handled by option '--output-level '
-q | --quiet             if you fetch results in json format, you can hide direct output and analyse results as as a json object directly

--no-ansi                prevent colorful output of rendering results (default: false | 0)
--stop-on-error          stop on first application error | exception (default: false | 0)
--stop-on-failure        stop on first detected coverFish scan failure (default: false | 0)

```

Missing features, annoying bugs and project thoughts
----------------------------------------------------

[](#missing-features-annoying-bugs-and-project-thoughts)

Feel free to contact us for missing features, discovered bugs or nice ideas around this project :)

*We are currently working on*:

- File/IO scan mode, currently php reflection ability is used to identify code coverage errors - in future versions a raw scan mode to scan files outside the autoload context will be provided
- coverage warnings implementation, identify coverage problems or misconfiguration issues in use of phpunit code coverage
- optimization of coverFish's output module; this module is just "bad"
- refactoring of color output module, using symfony outputFormatter
- mastering coverfish documentation and build up a useful wiki
- include @use statement check
- improve scanner/analyzer speed

Some screenshots of result screens
----------------------------------

[](#some-screenshots-of-result-screens)

Depending on the chosen *--output-level* option coverfish will provide different output of test results

using minimal output level (—ouput-level 0), no errors in code coverage found [![Level 0, test validated](https://camo.githubusercontent.com/8886af013b607f8baa81f8e440660c63e72840705a091854b12cf24821468b96/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f7373376e79767279656b6c347a68752f63665f636c695f6f75747075745f6c6576656c5f305f616e73695f31323830783133302e706e67)](https://camo.githubusercontent.com/8886af013b607f8baa81f8e440660c63e72840705a091854b12cf24821468b96/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f7373376e79767279656b6c347a68752f63665f636c695f6f75747075745f6c6576656c5f305f616e73695f31323830783133302e706e67)same mode, errors in code coverage identified [![Level 0, test failed](https://camo.githubusercontent.com/129771b158b32f4892bd3c8b9b5203e878d259ba8fbb6ba31daf838166132943/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f3479756166647735723130787776322f63665f636c695f6f75747075745f6c6576656c5f305f616e73695f746573746661696c5f31323830783136302e706e67)](https://camo.githubusercontent.com/129771b158b32f4892bd3c8b9b5203e878d259ba8fbb6ba31daf838166132943/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f3479756166647735723130787776322f63665f636c695f6f75747075745f6c6576656c5f305f616e73695f746573746661696c5f31323830783136302e706e67)

using moderate (default) output level (—ouput-level **1**) [![Level 1, test validated](https://camo.githubusercontent.com/0daa1d307ebc4ad1f1c321ab8bb71612ebb6c819d95d2509fc31867b42d4704f/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f676737737530306566333279336c782f63665f636c695f6f75747075745f6c6576656c5f315f616e73695f31323830783638312e706e67)](https://camo.githubusercontent.com/0daa1d307ebc4ad1f1c321ab8bb71612ebb6c819d95d2509fc31867b42d4704f/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f676737737530306566333279336c782f63665f636c695f6f75747075745f6c6576656c5f315f616e73695f31323830783638312e706e67)same mode, errors in code coverage identified and shown detailed [![Level 1, test failed](https://camo.githubusercontent.com/52fad37a2b7fb78602989e4756164ea424e91a25861ea52017c67af0bcf06302/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f316d30747333753279616561656b752f63665f636c695f6f75747075745f6c6576656c5f315f616e73695f746573746661696c5f31323830783533352e706e67)](https://camo.githubusercontent.com/52fad37a2b7fb78602989e4756164ea424e91a25861ea52017c67af0bcf06302/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f316d30747333753279616561656b752f63665f636c695f6f75747075745f6c6576656c5f315f616e73695f746573746661696c5f31323830783533352e706e67)

and using maximum output level, showing partial output of large screen result (—ouput-level **2**) [![Level 2, test validated](https://camo.githubusercontent.com/5aacd07bf11fa03adf9b76a6b59b5bbdb416e8c74bcbd0c598a5a768ed6637f3/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f397a35766b7771766f74646d7663382f63665f636c695f6f75747075745f6c6576656c5f325f616e73695f31323830783535372e706e67)](https://camo.githubusercontent.com/5aacd07bf11fa03adf9b76a6b59b5bbdb416e8c74bcbd0c598a5a768ed6637f3/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f397a35766b7771766f74646d7663382f63665f636c695f6f75747075745f6c6576656c5f325f616e73695f31323830783535372e706e67)same mode, errors in code coverage identified and shown more detailed [![Level 2, test failed](https://camo.githubusercontent.com/d6f33db4204344a7d318a3094cb283048f831ce95fe05c1a3d7b7ee7d9593c9e/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f6670666978616d3431727a793872622f63665f636c695f6f75747075745f6c6576656c5f325f616e73695f746573746661696c5f31323830783639392e706e67)](https://camo.githubusercontent.com/d6f33db4204344a7d318a3094cb283048f831ce95fe05c1a3d7b7ee7d9593c9e/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f6670666978616d3431727a793872622f63665f636c695f6f75747075745f6c6576656c5f325f616e73695f746573746661696c5f31323830783639392e706e67)

Version and compatibility
-------------------------

[](#version-and-compatibility)

Please use our latest stable version **1.0.2** of phpCoverFish for your productive static code analyzing process. This Documentation was last updated on **2018-05-15** (*internal version 1.0.2*)

phpCoverFish (&gt;= 1.0.2) works fine with **php7.0**, **php7.1** and **php7.2**phpCoverFish (&lt;= 1.0.1) is compatible with **php5.5**, **php5.6** and **php7.n**

Contribute
----------

[](#contribute)

PHPCoverFish is still under development and contributors are always welcome! Feel free to join our coverFish distributor team. Please refer to [CONTRIBUTING.md](https://github.com/dunkelfrosch/phpcoverfish/blob/master/CONTRIBUTING.md)to find out how to contribute to the PHPCoverFish Project.

License
-------

[](#license)

Copyright (c) 2015 - 2018 Patrick Paechnatz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 97.3% 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 ~0 days

Total

11

Last Release

3937d ago

Major Versions

0.9.9-beta3 → 1.0.02015-08-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/50fea1047b66e6cca8938b40395dab356660c1284a64cc0871951dd1c897497e?d=identicon)[dunkelfrosch](/maintainers/dunkelfrosch)

---

Top Contributors

[![paterik](https://avatars.githubusercontent.com/u/2572857?v=4)](https://github.com/paterik "paterik (292 commits)")[![rp3chessio](https://avatars.githubusercontent.com/u/46067049?v=4)](https://github.com/rp3chessio "rp3chessio (8 commits)")

---

Tags

phpphpunitsymfonycoveragesilexphpcc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/df-php-coverfish/health.svg)

```
[![Health](https://phpackages.com/badges/df-php-coverfish/health.svg)](https://phpackages.com/packages/df-php-coverfish)
```

###  Alternatives

[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[nimut/phpunit-merger

Merge multiple PHPUnit reports into one file

501.7M7](/packages/nimut-phpunit-merger)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

1783.0k34](/packages/robiningelbrecht-phpunit-coverage-tools)[sci3ma/symfony-grumphp

Configured GrumPHP with bunch of tools for static code analysis Symfony Framework

196.7k](/packages/sci3ma-symfony-grumphp)[ockcyp/covers-validator

Validates @covers tags in PHPUnit tests

21198.0k82](/packages/ockcyp-covers-validator)

PHPackages © 2026

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