PHPackages                             sebastian/phpdcd - 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. sebastian/phpdcd

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

sebastian/phpdcd
================

Dead Code Detector (DCD) for PHP code.

1.0.2(12y ago)4141.0M—8.3%4620BSD-3-ClausePHPPHP &gt;=5.3.3

Since Jan 31Pushed 10y ago23 watchersCompare

[ Source](https://github.com/sebastianbergmann/phpdcd)[ Packagist](https://packagist.org/packages/sebastian/phpdcd)[ Docs](https://github.com/sebastianbergmann/phpdcd)[ RSS](/packages/sebastian-phpdcd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (20)

**This project is no longer maintained and its repository is only kept for archival purposes.**

[![Latest Stable Version](https://camo.githubusercontent.com/d4f5a9bab748d7f5767b7d525b03f6fe14fd3eeaa9d59fd4d480a2f74fac3616/68747470733a2f2f706f7365722e707567782e6f72672f73656261737469616e2f7068706463642f762f737461626c652e706e67)](https://packagist.org/packages/sebastian/phpdcd)[![Build Status](https://camo.githubusercontent.com/e66e892530dc9be4835eece2993da62ec184cd5ac26ad26c0583f19c60655d8c/68747470733a2f2f7472617669732d63692e6f72672f73656261737469616e626572676d616e6e2f7068706463642e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/sebastianbergmann/phpdcd)

PHP Dead Code Detector (PHPDCD)
===============================

[](#php-dead-code-detector-phpdcd)

**phpdcd** is a Dead Code Detector (DCD) for PHP code. It scans a PHP project for all declared functions and methods and reports those as being "dead code" that are not called at least once.

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

[](#limitations)

As PHP is a very dynamic programming language, the static analysis performed by **phpdcd** does not recognize function or method calls that are performed using one of the following language features:

- Reflection API
- `call_user_func()` and `call_user_func_array()`
- Usage of the `new` operator with variable class names
- Variable class names for static method calls such as `$class::method()`
- Variable function or method names such as `$function()` or `$object->$method()`
- Automatic calls to methods such as `__toString()` or `Iterator::*()`

Also note that infering the type of a variable is limited to type-hinted arguments (`function foo(Bar $bar) {}`) and direct object creation (`$object = new Clazz`)

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

[](#installation)

### PHP Archive (PHAR)

[](#php-archive-phar)

The easiest way to obtain PHPDCD is to download a [PHP Archive (PHAR)](http://php.net/phar) that has all required dependencies of PHPDCD bundled in a single file:

```
wget https://phar.phpunit.de/phpdcd.phar
chmod +x phpdcd.phar
mv phpdcd.phar /usr/local/bin/phpdcd

```

You can also immediately use the PHAR after you have downloaded it, of course:

```
wget https://phar.phpunit.de/phpdcd.phar
php phpdcd.phar

```

### Composer

[](#composer)

Simply add a dependency on `sebastian/phpdcd` to your project's `composer.json` file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project. Here is a minimal example of a `composer.json` file that just defines a development-time dependency on PHPDCD:

```
{
    "require-dev": {
        "sebastian/phpdcd": "*"
    }
}

```

For a system-wide installation via Composer, you can run:

```
composer global require 'sebastian/phpdcd=*'

```

Make sure you have `~/.composer/vendor/bin/` in your path.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity57

Moderate usage in the ecosystem

Community36

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.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 ~42 days

Total

3

Last Release

4405d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1089?v=4)[Sebastian Probst Eide](/maintainers/sebastian)[@sebastian](https://github.com/sebastian)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (90 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (4 commits)")[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (1 commits)")[![keradus](https://avatars.githubusercontent.com/u/2716794?v=4)](https://github.com/keradus "keradus (1 commits)")[![kukulich](https://avatars.githubusercontent.com/u/260445?v=4)](https://github.com/kukulich "kukulich (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[codeception/codeception

All-in-one PHP Testing Framework

4.9k86.2M2.9k](/packages/codeception-codeception)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)

PHPackages © 2026

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