Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastianbergmann/phpcpd
Copy/Paste Detector (CPD) for PHP code.
https://github.com/sebastianbergmann/phpcpd
Last synced: 3 months ago
JSON representation
Copy/Paste Detector (CPD) for PHP code.
- Host: GitHub
- URL: https://github.com/sebastianbergmann/phpcpd
- Owner: sebastianbergmann
- License: bsd-3-clause
- Archived: true
- Created: 2009-01-24T16:08:32.000Z (almost 16 years ago)
- Default Branch: main
- Last Pushed: 2023-01-10T12:50:42.000Z (almost 2 years ago)
- Last Synced: 2024-09-15T21:28:22.251Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 44.3 MB
- Stars: 2,215
- Watchers: 67
- Forks: 190
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-php - PHPCPD - A library that detects copied and pasted code. (Table of Contents / Code Quality)
- awesome-php-cn - PHPCPD - 库,发现复制粘贴代码. (目录 / 代码质量 Code Quality)
- awesome-projects - PHPCPD - A library that detects copied and pasted code. (PHP / Code Quality)
- php-awesome - PHPCPD - 在代码中寻找类似模式的工具 (类库 / 未归类)
- awesome-php - PHPCPD - A library that detects copied and pasted code. (Table of Contents / Code Quality)
README
**This project is no longer maintained and its repository is only kept for archival purposes.**
# PHP Copy/Paste Detector (PHPCPD)
`phpcpd` is a Copy/Paste Detector (CPD) for PHP code.
## Installation
This tool is distributed as a [PHP Archive (PHAR)](https://php.net/phar):
```bash
$ 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:
```bash
$ 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
```
$ 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-10821.82% duplicated lines out of 446676 total lines of code.
Average size of duplication is 67 lines, largest clone has 1447 of linesTime: 00:02.980, Memory: 318.00 MB
```