php-censor/docs/en/plugins/php_mess_detector.md

40 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2016-07-19 11:12:28 +02:00
Plugin PHP Mess Detector
2017-01-04 13:22:20 +01:00
========================
2016-07-19 11:12:28 +02:00
2016-07-17 16:20:35 +02:00
Runs PHP Mess Detector against your build. Records some key metrics, and also reports errors and warnings.
2016-07-19 11:12:28 +02:00
Configuration
2017-01-04 13:22:20 +01:00
-------------
2016-07-19 11:12:28 +02:00
2016-07-17 16:20:35 +02:00
### Options
2016-07-19 11:12:28 +02:00
2017-07-18 15:54:24 +02:00
- **allowed_warnings** [int, optional] - The warning limit for a successful build (default: 0). -1 disables warnings.
Setting allowed_warnings in conjunction with zero_config will override zero_config.
2016-07-17 16:20:35 +02:00
- **suffixes** [array, optional] - An array of file extensions to check (default: 'php')
- **ignore** [array, optional] - An array of files/paths to ignore (default: build_settings > ignore)
- **path** [string, optional] - Directory in which PHPMD should run (default: build root)
2017-07-18 15:54:24 +02:00
- **rules** [array, optional] - Array of rulesets that PHPMD should use when checking your build or a string containing
at least one slash, will be treated as path to PHPMD ruleset. See http://phpmd.org/rules/index.html for complete
details on the rules. (default: ['codesize', 'unusedcode', 'naming']).
2016-07-17 16:20:35 +02:00
- **zero_config** [bool, optional] - Suppresses build failure on errors and warnings if set to true. (default: false).
2016-07-19 11:12:28 +02:00
### Examples
2016-07-17 16:20:35 +02:00
```yml
test:
php_mess_detector:
path: 'app'
ignore:
- 'vendor'
allowed_warnings: -1
rules:
- "cleancode"
- "controversial"
- "codesize"
- "design"
- "naming"
- "unusedcode"
- "somedir/customruleset.xml"
zero_config: true
```