Grunt plugin for running PHP Copy/Paste Detector (PHPCPD).
npm install grunt-phpcpd> Grunt plugin for running PHP Copy/Paste Detector (PHPCPD).
_This plugin is developed for Grunt 0.4.0 and is not tested for backward compatibility with Grunt 0.3.x._
1. Install this grunt plugin with the follwing command:
``shell`
npm install grunt-phpcpd --save-dev
3. Add this to your project's Gruntfile.js:
`js`
grunt.loadNpmTasks('grunt-phpcpd');
_Run this task with the grunt phpcpd command._
_This task is a [multi task][] so any targets, files and options should be specified according to the [multi task][] documentation._
[multi task]: https://github.com/gruntjs/grunt/wiki/Configuring-tasks
`js`
phpcpd: {
application: {
dir: 'application'
}
options: {
quiet: true
}
}
#### dir
Type: String
The file or directory where phpmd should search for files.
Default: 'phpcpd'The binary name if it is in your PATH or the full path if not.
#### reportFile
Type:
String
Default: falseSet a path and filename here to write to a file, otherwise it will write to stdout.
#### exclude
Type:
String
Default: falseExclude
from code analysis. Also supports Array syntax for excluding multiple directories.#### minLines
Type:
Number
Default: 5Minimum number of identical lines.
#### minTokens
Type:
Number
Default: 70Minimum number of identical tokens.
#### fuzzy
Type:
Boolean
Default: falseUse fuzz variable names.
#### names
Type:
String
Default: '*.php'A comma-separated list of file names to check.
#### quiet
Type:
Boolean
Default: trueOnly print the final summary.
#### verbose
Type:
Boolean
Default: falsePrint duplicated code.
#### resultFile
Type:
String
Default: falseWrite report in PMD-CPD XML format to .
#### maxBuffer
Type:
Number
Default: 200*1024Override the maxBuffer-Size of nodejs's exec() function if you expect a long output on stdout.
#### ignoreExitCode
Type:
Boolean
Default: false`Ignore the exit code if you don't want the task to fail (e.g. CI-Server).