Grunt plugin for running PHP Mess Detector.
npm install grunt-phpmd> Grunt plugin for running PHP Mess Detector.
_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-phpmd --save-dev
3. Add this to your project's Gruntfile.js:
`js`
grunt.loadNpmTasks('grunt-phpmd');
_Run this task with the grunt phpmd 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`
phpmd: {
application: {
dir: 'application'
},
options: {
rulesets: 'codesize'
}
}
#### dir
Type: String
The file or directory where phpmd should search for files.
Default: 'phpmd'The binary name if it is in your PATH or the full path if not.
#### reportFormat
Type:
String
Default: 'xml'The type of report to generate. PHPMD supports
xml, text and html.#### reportFile
Type:
String
Default: falseSet a path and filename here to write to a file, otherwise it will write to stdout.
#### suffixes
Type:
String
Default: falseSet a comma-separated string of valid source code filename extensions.
#### exclude
Type:
String
Default: falseSet a comma-separated string of patterns that are used to ignore directories.
#### minimumPriority
Type:
Number
Default: falseRule priority threshold: rules with lower priority than this will not be used.
#### strict
Type:
Boolean
Default: falseAlso report those nodes with a @SuppressWarnings annotation.
#### rulesets
Type:
String
Default: 'codesize,unusedcode,naming'A ruleset filename or a comma-separated string of rulesetfilenames. Make sure to have no spaces between the items!
#### maxBuffer
Type:
Number
Default: 200*1024Override the maxBuffer-Size of nodejs's exec() function if you expect a long output on stdout.
#### ignoreErrorCode
Type:
Boolean
Default: falseOption to ignore error code 2 from phpmd and don't treat it as grunt fatal
#### ignoreWarningCode
Type:
Boolean
Default: true`Option to ignore warning code 1 from phpmd and don't treat it as grunt warn