PHPackages                             tomasvotruba/phpstan-bodyscan - 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. tomasvotruba/phpstan-bodyscan

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

tomasvotruba/phpstan-bodyscan
=============================

Get error count for each PHPStan level

1.1.0(1mo ago)13592.7k↓46%111MITPHPPHP &gt;=8.2CI passing

Since May 2Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/TomasVotruba/phpstan-bodyscan)[ Packagist](https://packagist.org/packages/tomasvotruba/phpstan-bodyscan)[ GitHub Sponsors](https://github.com/tomasvotruba)[ RSS](/packages/tomasvotruba-phpstan-bodyscan/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (13)Versions (24)Used By (1)

PHPStan Bodyscan
================

[](#phpstan-bodyscan)

[![Downloads total](https://camo.githubusercontent.com/5bff2261f2cf76e33641a415bf86503e83627635b5d43250ec57a3846414a2ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6d6173766f74727562612f7068707374616e2d626f64797363616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tomasvotruba/phpstan-bodyscan/stats)

- Do you want to get quick glimpse of new project code quality?
- Do you want to know, what PHPStan level is the best for your project?
- Do you want to know, how much errors you're facing per level to see how hard it will be to reach them?

Get error count for each PHPStan level!

How does it work?
-----------------

[](#how-does-it-work)

First, we look into the project root for `phpstan.neon` file.

- If found, we reuse it.
- If not, we look for defaults source code paths like `/src`, `/app`, `/tests`, etc.

Then we run PHPStan for each level from 0 to 8. We count errors and display them in a table.

Install
-------

[](#install)

```
composer require tomasvotruba/phpstan-bodyscan --dev
```

Usage
-----

[](#usage)

Run tool in your project. It will take some time, as it will run full PHPStan analysis for each level.

```
vendor/bin/phpstan-bodyscan
```

↓

To get errors count per level:

```
+-------+-------------+-----------+
| Level | Error count | Increment |
+-------+-------------+-----------+
|     0 |           0 |         - |
|     1 |          35 |      + 35 |
|     2 |          59 |      + 24 |
|     3 |          59 |         - |
|     4 |         120 |      + 61 |
|     5 |         120 |         - |
|     6 |         253 |     + 133 |
|     7 |         350 |      + 97 |
|     8 |         359 |       + 9 |
+-------+-------------+-----------;
```

Do you want to run levels without extensions?
---------------------------------------------

[](#do-you-want-to-run-levels-without-extensions)

```
vendor/bin/phpstan-bodyscan --bare
```

Do you need a JSON format?
--------------------------

[](#do-you-need-a-json-format)

We got you covered:

```
vendor/bin/phpstan-bodyscan --json
```

↓

```
[
    {
        "level": 0,
        "error_count": 0,
        "increment_count": 0
    },
    {
        "level": 1,
        "error_count": 5,
        "increment_count": 5
    },
    {
        "level": 2,
        "error_count": 25,
        "increment_count": 20
    }
]
```

### Limit level count

[](#limit-level-count)

Are you interested only in a few levels? You can limit ranges by the options:

```
vendor/bin/phpstan-bodyscan run --min-level 0 --max-level 3
```

### Load env file

[](#load-env-file)

Some projects need to load `.env` file to run PHPStan. You can do it like this:

```
vendor/bin/phpstan-bodyscan run --env-file some-parameters.env
```

### Debugging

[](#debugging)

Running PHPStan on a new project you don't know might crash. To save data from finished levels, we dump them to the `bodyscan-log.txt` file.

If the run crashes for any reason, the PHPStan error output is also dumped to the same file.

Happy coding!

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance92

Actively maintained with recent releases

Popularity48

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 94% 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 ~36 days

Recently: every ~181 days

Total

22

Last Release

38d ago

Major Versions

0.2.5 → 1.0.02025-01-16

PHP version history (2 changes)0.1.0PHP &gt;=8.2

0.1.3PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (47 commits)")[![jdreesen](https://avatars.githubusercontent.com/u/424602?v=4)](https://github.com/jdreesen "jdreesen (1 commits)")[![npo-mmenke](https://avatars.githubusercontent.com/u/116382818?v=4)](https://github.com/npo-mmenke "npo-mmenke (1 commits)")[![tomasnorre](https://avatars.githubusercontent.com/u/1212481?v=4)](https://github.com/tomasnorre "tomasnorre (1 commits)")

---

Tags

phpphpstanstatic-analysis

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tomasvotruba-phpstan-bodyscan/health.svg)

```
[![Health](https://phpackages.com/badges/tomasvotruba-phpstan-bodyscan/health.svg)](https://phpackages.com/packages/tomasvotruba-phpstan-bodyscan)
```

###  Alternatives

[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k28.9M2.4k](/packages/infection-infection)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)

PHPackages © 2026

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