Grunt plugin for running PHP Dead Code Detector.
This plugin is developed for Grunt 0.4.0
and is not tested for backward compatibility with Grunt 0.3.x
.
- Install this grunt plugin with the follwing command:
npm install grunt-phpdcd --save-dev
-
Add this to your project's
Gruntfile.js
:
grunt.loadNpmTasks('grunt-phpdcd');
Run this task with the grunt phpdcd
command.
This task is a multi task so any targets, files and options should be specified according to the multi task documentation.
phpdcd: {
application: {
dir: ['application']
},
options: {
namesExclude: 'config.php,settings.php'
}
}
Type: Array
The files or directories where phpdcd should search for files.
Type: String
Default: 'phpdcd'
The binary name if it is in your PATH or the full path if not.
Type: String
Default: false
A comma-separated list of file names to check (default: ["*.php"
]).
Type: String
Default: false
A comma-separated list of file names to exclude.
Type: Array
Default: false
A list of directories where phpdcd should not search for files.
Type: Boolean
Default: false
Report code as dead if it is only called by dead code.
Type: Boolean
Default: false
Do not output any message.
Type: Number [1-3]
Default: false
Increase the verbosity of messages.
- 1 for normal output
- 2 for more verbose output
- 3 for debug
Type: String
Default: undefined
Write result to file instead of stdout.
Type: Number
Default: 200*1024
Override the maxBuffer-Size of nodejs's exec() function if you expect a long output on stdout.
Inspired by grunt-phpmd