PHPackages                             johnatas-x/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. [Testing &amp; Quality](/categories/testing)
4. /
5. johnatas-x/phpcpd

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

johnatas-x/phpcpd
=================

Copy/Paste Detector (CPD) for PHP code.

6.0.5(1y ago)110.0k↓30.3%1BSD-3-ClausePHPPHP &gt;=8.1

Since Apr 4Pushed 1y agoCompare

[ Source](https://github.com/johnatas-x/phpcpd)[ Packagist](https://packagist.org/packages/johnatas-x/phpcpd)[ Docs](https://github.com/johnatas-x/phpcpd)[ GitHub Sponsors](https://github.com/sebastianbergmann)[ RSS](/packages/johnatas-x-phpcpd/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (26)Used By (1)

**This project is a fixed drop-in replacement for [sebastianbergmann/phpcpd](https://github.com/sebastianbergmann/phpcpd)**

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

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

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

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

[](#installation)

This tool is distributed as a [PHP Archive (PHAR)](https://php.net/phar):

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

$ php phpcpd.phar --version
```

Using [Phive](https://phar.io/) is the recommended way for managing the tool dependencies of your project:

```
$ phive install phpcpd

$ ./tools/phpcpd --version
```

**[It is not recommended to use Composer to download and install this tool.](https://twitter.com/s_bergmann/status/999635212723212288)**

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

[](#usage-example)

```
$ php phpcpd.phar --fuzzy wordpress-5.5
phpcpd 6.0.0 by Sebastian Bergmann.

Found 121 clones with 8137 duplicated lines in 69 files:

  - /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core/Curve25519/H.php:19-1466 (1447 lines)
    /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519/H.php:19-1466
.
.
.
  - /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519.php:879-889 (10 lines)
    /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519.php:1072-1082

1.82% duplicated lines out of 446676 total lines of code.
Average size of duplication is 67 lines, largest clone has 1447 of lines

Time: 00:02.980, Memory: 318.00 MB

```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance45

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 81.9% 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 ~182 days

Recently: every ~420 days

Total

25

Last Release

423d 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

4.1.0 → 5.0.02020-02-20

5.0.2 → 6.0.02020-08-13

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

3.0.0PHP ^5.6|^7.0

4.0.0PHP ^7.1

5.0.0PHP ^7.3

6.0.3PHP &gt;=7.3

6.0.4PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb82429ffeb7556ffee9014525e0ba5d3a32cf3a525d6a5e48135ccd50626925?d=identicon)[johnatas-x](/maintainers/johnatas-x)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (416 commits)")[![olleharstedt](https://avatars.githubusercontent.com/u/607341?v=4)](https://github.com/olleharstedt "olleharstedt (29 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)")[![edorian](https://avatars.githubusercontent.com/u/247397?v=4)](https://github.com/edorian "edorian (4 commits)")[![johnatas-x](https://avatars.githubusercontent.com/u/34005481?v=4)](https://github.com/johnatas-x "johnatas-x (3 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)")[![globin](https://avatars.githubusercontent.com/u/1447245?v=4)](https://github.com/globin "globin (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)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (1 commits)")[![lsv](https://avatars.githubusercontent.com/u/20708?v=4)](https://github.com/lsv "lsv (1 commits)")[![ajardin](https://avatars.githubusercontent.com/u/3305232?v=4)](https://github.com/ajardin "ajardin (1 commits)")[![oallain](https://avatars.githubusercontent.com/u/6593252?v=4)](https://github.com/oallain "oallain (1 commits)")[![gooh](https://avatars.githubusercontent.com/u/370948?v=4)](https://github.com/gooh "gooh (1 commits)")

### Embed Badge

![Health badge](/badges/johnatas-x-phpcpd/health.svg)

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

###  Alternatives

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k910.7M134.8k](/packages/phpunit-phpunit)[phpunit/php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.

8.9k892.4M1.5k](/packages/phpunit-php-code-coverage)[brianium/paratest

Parallel testing for PHP

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

CLI frontend for php-code-coverage

23721.1M583](/packages/phpunit-phpcov)[moodlehq/moodle-plugin-ci

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

612.6M](/packages/moodlehq-moodle-plugin-ci)[innmind/black-box

Test library

44178.7k93](/packages/innmind-black-box)

PHPackages © 2026

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