To start using PHPMD, enable it in repository setting.
To customize the analysis, configure by using
When you have own ruleset.xml for your project, you can use the file to setup rule set. Specify the path to
rule option in
PHPMD does not run fast, and sometimes analysis sessions time out.
To mitigate the difficulty, Sider deletes files that are not changed in the pull request. This is automatically done (and you cannot disable that).
If it still times out, you can limit the target of PHPMD analysis by using
linter:phpmd:target:- index.php- wp-content
target option controls the PHPMD command line that is used in analysis.
When you leave
rule option undefined in
sideci.yml, Sider runs PHPMD with our recommended setting. The recommended setting is available in our GitHub repository.
Here is an example settings for PHPMD under
linter:phpmd:target:- index.php- wp-contentoptions:rule: codesize,unusedcodeminimumpriority: 3suffixes: php,phtmlexclude: app/Vendor/strict: true
This option controls target paths to inspect. This is an optional setting and you do not need to specify this if you don't have any performance issue.
This option controls command line options that are given to phpmd.
This option controls
--rule command line option that are given to
phpmd. You can specify a comma separated rule names or an array of rule name.
The valid rule names are the following:
You can also specify a rule set file name.
If you need the detail of rules or how to customize ruleset, see PHPMD - PHP Mess Detector: Documentation#Rules.
This option controls the rule priority threshold. The lower priority rules you declare will not be used.
This option controls valid filename extensions. Write comma-separated in order to inspect multiple extensions files. e.g.
This option controls directories to exclude from analysis objects. Write comma-separated in order to inspect plural directories. e.g.
This option controls whether to report nodes with
@SuppressWarnings annotation. Default value is false. In order to learn more about the details of
@SuppressWarnings, see PHPMD Suppressing Warnings.