PHPackages                             reaperman/reaperman - 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. [CLI &amp; Console](/categories/cli)
4. /
5. reaperman/reaperman

ActiveLibrary[CLI &amp; Console](/categories/cli)

reaperman/reaperman
===================

CLI to find dead code in PHP projects.

0.0.2(7mo ago)02MITPHPPHP ^8.1CI passing

Since Nov 14Pushed 7mo agoCompare

[ Source](https://github.com/alexwoollam/reaperman)[ Packagist](https://packagist.org/packages/reaperman/reaperman)[ RSS](/packages/reaperman-reaperman/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

[![Reaperman](docs/reaperman.svg)](docs/reaperman.svg)

Reaperman
=========

[](#reaperman)

Reaperman is a Composer-installed CLI that scans PHP projects to find likely dead code (unused private methods and global functions). It uses nikic/php-parser to build a lightweight call map and reports findings in table or JSON formats.

Features
--------

[](#features)

- Detects unused private methods and global functions
- Fast filesystem scan with directory ignores
- Table and JSON output, non-zero exit for CI

Requirements
------------

[](#requirements)

- PHP 8.1+
- Composer

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

[](#installation)

- Global (recommended):
    - `composer global require reaperman/reaperman`
    - Ensure Composer's global bin is on PATH:
        - Linux: add `~/.config/composer/vendor/bin` to PATH
        - macOS: add `~/.composer/vendor/bin` to PATH
- Per-project (dev):
    - `composer require --dev reaperman/reaperman`
    - Run via `./vendor/bin/reaperman`

Quickstart
----------

[](#quickstart)

- Global, from a project root: `reaperman` (scans current directory by default)
- Global, explicit path: `reaperman --path=. --format=table`
- Per-project: `./vendor/bin/reaperman --path=. -v`
- JSON output: add `--format=json`
- Fail CI on findings: add `--exit-nonzero-on-findings`
- Show scanned files: add `-v`

Options
-------

[](#options)

- `--path=DIR` Root directory to scan (default: current directory)
- `--ignore=LIST` Comma-separated directory basenames to skip (default: `vendor,node_modules,storage,cache`)
- `--format=table|json` Output format (default: `table`)
- `--exit-nonzero-on-findings` Exit code 1 if any findings

Limitations
-----------

[](#limitations)

- Heuristic analysis: dynamic calls, reflection, DI containers, or string-based invocations may not be tracked and can cause false positives/negatives.
- Magic methods (`__construct`, `__invoke`, etc.) are never flagged.

Development
-----------

[](#development)

- Install deps: `composer install`
- Run checks: `composer check` (lint + phpstan + tests)
- Run CLI from source: `./bin/reaperman --path=./src -v`

Local Development (Path Repo)
-----------------------------

[](#local-development-path-repo)

- Per-project:
    - In your project `composer.json` add:
        - `"repositories": [{"type": "path", "url": "/var/www/reaperman", "options": {"symlink": true}}]`
        - `"require-dev": {"reaperman/reaperman": "dev-main"}` and ensure `"minimum-stability": "dev", "prefer-stable": true`.
    - Run: `composer update reaperman/reaperman -W`
    - Use: `./vendor/bin/reaperman --path=. --format=table`
- Global:
    - `composer global config repositories.reaperman path /var/www/reaperman`
    - `composer global config repositories.reaperman options.symlink true`
    - `composer global require reaperman/reaperman:dev-main`
    - Use: `reaperman --path=/your/project`
- Direct run (no Composer): `./bin/reaperman --path=/your/project`
- Tip: If Composer needs a version for local testing, either init Git or set `"version": "0.1.x-dev"` temporarily.

Testing
-------

[](#testing)

- PHPUnit config: `phpunit.xml.dist`
- Run tests: `composer test`

Contributing
------------

[](#contributing)

- See `AGENTS.md` for repository structure, coding style (PSR-12), commit/PR conventions, and tooling.

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance62

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

2

Last Release

231d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d416fe8f9619a7f92c9af9a9ec7c291257a4932175833f119aea9be9d0c951e5?d=identicon)[alexwoollam](/maintainers/alexwoollam)

---

Top Contributors

[![alexwoollam](https://avatars.githubusercontent.com/u/20298508?v=4)](https://github.com/alexwoollam "alexwoollam (8 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k582.3M821](/packages/psy-psysh)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54743.1k4](/packages/jolicode-castor)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[laraveldaily/filacheck

Static analysis for Filament projects - detect deprecated patterns and code issues

11975.6k](/packages/laraveldaily-filacheck)[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)
