Install Phpcpd On A Debian, Ubuntu, Kali, Fedora And Raspbian

Install Phpcpd On A Debian, Ubuntu, Kali, Fedora And Raspbian

phpcpd

A copy and paste detector for PHP code.

Maintainer: Debian PHP PEAR Maintainers



Section: php

Install phpcpd

  • Debian apt-get install phpcpd Click to copy
  • Ubuntu apt-get install phpcpd Click to copy
  • Kali Linux apt-get install phpcpd Click to copy
  • Fedora dnf install phpcpd Click to copy
  • Raspbian apt-get install phpcpd Click to copy

A copy and paste detector for PHP code.

How to use phpcpd?

Below are few example commands for phpcpd that you can use in the terminal.

Analyse duplicated code for a specific file or directory:
phpcpd path/to/file_or_directoryClick to copy
Analyse using fuzzy matching for variable names:
phpcpd --fuzzy path/to/file_or_directoryClick to copy
Specify a minimum number of identical lines (defaults to 5):
phpcpd --min-lines number_of_lines path/to/file_or_directoryClick to copy
Specify a minimum number of identical tokens (defaults to 70):
phpcpd --min-tokens number_of_tokens path/to/file_or_directoryClick to copy
Exclude a directory from analysis (must be relative to the source):
phpcpd --exclude path/to/excluded_directory path/to/file_or_directoryClick to copy
Output the results to a PHP-CPD XML file:
phpcpd --log-pmd path/to/log_file path/to/file_or_directoryClick to copy
To install the latest version of phpcpd in your favorite operating system just copy the phpcpd installation command from above and paste it into terminal. It will download and install the latest version of phpcpd 2026 package in your OS.