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.0.1(1y ago)13478.6k—2.3%11[1 issues](https://github.com/TomasVotruba/phpstan-bodyscan/issues)1MITPHPPHP &gt;=7.2CI passing

Since May 2Pushed 1y 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 1mo ago

READMEChangelog (2)Dependencies (1)Versions (23)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

41

—

FairBetter than 89% of packages

Maintenance42

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% 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 ~13 days

Recently: every ~58 days

Total

21

Last Release

487d 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 (45 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

### 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

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[proget-hq/phpstan-yii2

Yii2 extension for PHPStan

51575.1k7](/packages/proget-hq-phpstan-yii2)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

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