Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

sebastianbergmann/phpcpd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7724245 · Jan 10, 2023
Mar 31, 2022
Dec 24, 2022
Feb 23, 2022
Mar 31, 2022
Sep 2, 2022
Aug 16, 2021
Dec 24, 2022
May 19, 2021
May 19, 2021
Aug 30, 2021
Mar 31, 2022
Jan 2, 2023
Jan 10, 2023
Aug 16, 2021
Apr 11, 2022
Mar 31, 2022
May 19, 2021

Repository files navigation

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):

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

$ php phpcpd.phar --version

Using Phive 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.

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