PHPackages                             damien-list/phpcpd - 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. damien-list/phpcpd

ActiveLibrary

damien-list/phpcpd
==================

Copy/Paste Detector (CPD) for PHP code.

4.1.3(6y ago)01431BSD-3-ClausePHPPHP ^7.3

Since Apr 4Pushed 6y agoCompare

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/e26395b1578c470ef7fc0e669e10ae79d1fe5a8be2e9ef27afeac7c8340d7c96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656261737469616e2f7068706370642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sebastian/phpcpd)[![Minimum PHP Version](https://camo.githubusercontent.com/dcd4b4aec2c1709157fa6a2c050f709d75cde9552a79cfff0b70a97fad7281ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/4a3427a1e415a2122caff053708db941b331de7bade0be6f9c26afc4c23d4d88/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73656261737469616e626572676d616e6e2f7068706370642f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sebastianbergmann/phpcpd)

PHP Copy/Paste Detector (PHPCPD)
================================

[](#php-copypaste-detector-phpcpd)

`phpcpd` is a Copy/Paste Detector (CPD) for PHP code.

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

[](#installation)

### PHP Archive (PHAR)

[](#php-archive-phar)

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

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

```

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

```
$ wget https://phar.phpunit.de/phpcpd.phar
$ php phpcpd.phar

```

### Composer

[](#composer)

You can add this tool as a local, per-project, development-time dependency to your project using [Composer](https://getcomposer.org/):

```
$ composer require --dev sebastian/phpcpd

```

You can then invoke it using the `vendor/bin/phpcpd` executable.

Usage Example
-------------

[](#usage-example)

```
$ phpcpd --fuzzy wordpress-4.9.8
phpcpd 4.1.0 by Sebastian Bergmann.

Found 66 clones with 3014 duplicated lines in 40 files:

  - /home/sb/wordpress-4.9.8/wp-includes/Requests/IRI.php:358-708 (350 lines)
    /home/sb/wordpress-4.9.8/wp-includes/SimplePie/IRI.php:404-754
.
.
.
  - /home/sb/wordpress-4.9.8/wp-includes/SimplePie/File.php:133-144 (11 lines)
    /home/sb/wordpress-4.9.8/wp-includes/SimplePie/File.php:215-226

0.86% duplicated lines out of 349460 total lines of code.
Average size of duplication is 45 lines, largest clone has 350 of lines

Time: 1.79 seconds, Memory: 272.00MB

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 82% 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 ~135 days

Recently: every ~165 days

Total

19

Last Release

2364d ago

Major Versions

1.4.x-dev → 2.0.0-BETA12013-08-02

2.0.x-dev → 3.0.02017-02-05

3.0.1 → 4.0.02018-02-02

PHP version history (4 changes)1.4.1PHP &gt;=5.3.3

3.0.0PHP ^5.6|^7.0

4.0.0PHP ^7.1

4.1.1PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e48253fa8cfe370a3e98b94268de76e8c8ac687a2e2b39feef881a940aeb66ac?d=identicon)[damien-list](/maintainers/damien-list)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (283 commits)")[![aboks](https://avatars.githubusercontent.com/u/815524?v=4)](https://github.com/aboks "aboks (9 commits)")[![alexshadow007](https://avatars.githubusercontent.com/u/647552?v=4)](https://github.com/alexshadow007 "alexshadow007 (7 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (6 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (6 commits)")[![damien-list](https://avatars.githubusercontent.com/u/1785580?v=4)](https://github.com/damien-list "damien-list (5 commits)")[![edorian](https://avatars.githubusercontent.com/u/247397?v=4)](https://github.com/edorian "edorian (4 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (3 commits)")[![kukulich](https://avatars.githubusercontent.com/u/260445?v=4)](https://github.com/kukulich "kukulich (2 commits)")[![mrenrcert](https://avatars.githubusercontent.com/u/65898230?v=4)](https://github.com/mrenrcert "mrenrcert (2 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (2 commits)")[![SergeyZ](https://avatars.githubusercontent.com/u/92912310?v=4)](https://github.com/SergeyZ "SergeyZ (2 commits)")[![svemir](https://avatars.githubusercontent.com/u/154453?v=4)](https://github.com/svemir "svemir (2 commits)")[![globin](https://avatars.githubusercontent.com/u/1447245?v=4)](https://github.com/globin "globin (2 commits)")[![tommygnr](https://avatars.githubusercontent.com/u/929392?v=4)](https://github.com/tommygnr "tommygnr (1 commits)")[![g-g](https://avatars.githubusercontent.com/u/765134?v=4)](https://github.com/g-g "g-g (1 commits)")[![gooh](https://avatars.githubusercontent.com/u/370948?v=4)](https://github.com/gooh "gooh (1 commits)")[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (1 commits)")[![jpetitcolas](https://avatars.githubusercontent.com/u/688373?v=4)](https://github.com/jpetitcolas "jpetitcolas (1 commits)")[![jsobiecki](https://avatars.githubusercontent.com/u/194031?v=4)](https://github.com/jsobiecki "jsobiecki (1 commits)")

### Embed Badge

![Health badge](/badges/damien-list-phpcpd/health.svg)

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

###  Alternatives

[brianium/paratest

Parallel testing for PHP

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

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[moodlehq/moodle-plugin-ci

Helps running Moodle plugins analysis checks and tests under various CI environments.

612.6M](/packages/moodlehq-moodle-plugin-ci)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

4743.5k10](/packages/phel-lang-phel-lang)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[php-soap/wsdl-reader

A WSDL reader in PHP

212.3M9](/packages/php-soap-wsdl-reader)

PHPackages © 2026

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