<commit_before># PHP Copy/Paste Detector (PHPCPD)

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

## Installation

There are three supported ways of installing PHPCPD.

You can use the [PEAR Installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php) or [Composer](http://getcomposer.org/) to download and install PHPUnit as well as its dependencies. You can also download a [PHP Archive (PHAR)](http://php.net/phar) of PHPUnit that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file.

### PEAR Installer

The following two commands (which you may have to run as `root`) are all that is required to install PHPCPD using the PEAR Installer:

    pear config-set auto_discover 1
    pear install pear.phpunit.de/phpcpd

### Composer

To add PHPCPD as a local, per-project dependency to your project, simply add a dependency on `sebastian/phpcpd` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a development-time dependency on PHPCPD 1.4:

    {
        "require-dev": {
            "sebastian/phpcpd": "1.4.*"
        }
    }

### PHP Archive (PHAR)

    wget http://pear.phpunit.de/get/phpcpd.phar
    chmod +x phpcpd.phar

## Usage Example

    ➜ ~ phpcpd /usr/local/src/phpunit/PHPUnit
    phpcpd 1.4.1 by <NAME>.
<commit_msg>PHPUnit -> PHPCPD in README.md<commit_after># PHP Copy/Paste Detector (PHPCPD)

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

## Installation

There are three supported ways of installing PHPCPD.

You can use the [PEAR Installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php) or [Composer](http://getcomposer.org/) to download and install PHPCPD as well as its dependencies. You can also download a [PHP Archive (PHAR)](http://php.net/phar) of PHPUnit that has all required (as well as some optional) dependencies of PHPCPD bundled in a single file.

### PEAR Installer

The following two commands (which you may have to run as `root`) are all that is required to install PHPCPD using the PEAR Installer:

    pear config-set auto_discover 1
    pear install pear.phpunit.de/phpcpd

### Composer

To add PHPCPD as a local, per-project dependency to your project, simply add a dependency on `sebastian/phpcpd` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a development-time dependency on PHPCPD 1.4:

    {
        "require-dev": {
            "sebastian/phpcpd": "1.4.*"
        }
    }

### PHP Archive (PHAR)

    wget http://pear.phpunit.de/get/phpcpd.phar
    chmod +x phpcpd.phar

## Usage Example

    ➜ ~ phpcpd /usr/local/src/phpunit/PHPUnit
    phpcpd 1.4.1 by <NAME>.

{'fraction_non_alphanumeric': 0.0995225853837679, 'fraction_numerical': 0.0058758721997796545, 'mean_word_length': 3.458265139116203, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4056022', 'n_tokens_mistral': 909, 'n_tokens_neox': 880, 'n_words': 327}