sebastian/phpcpd

Copy/Paste Detector (CPD) for PHP code.

Installs: 16 152 401

Dependents: 2 170

Suggesters: 22

Security: 0

Stars: 1 926

Watchers: 67

Forks: 160

Open Issues: 7

5.0.2 2020-02-22 06:03 UTC

README

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

Installation

The recommended way to use this tool is a PHP Archive (PHAR):

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

$ php phpcpd.phar --version

Furthermore, it is recommended to use Phive for installing and updating the tool dependencies of your project.

Alternatively, you may use Composer to download and install this tool as well as its dependencies. This is not recommended, though.

Usage Example

$ php phpcpd.phar --fuzzy wordpress-4.9.8
phpcpd 5.0.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