PHPMD configuration

PHPMD requires configuration via a codesize.xml configuration file as detailed in PHPMD's documentation.

If you don't specify your custom configuration file we use our default below. We suggest to add your own configuration file into your repository root directory to be able to specify your coding and quality standards.


<ruleset name="phpmd"
    <description>PHPMD Rules</description>

    <rule ref="rulesets/unusedcode.xml" />
    <rule ref="rulesets/naming.xml" />
    <rule ref="rulesets/codesize.xml" />
    <rule ref="rulesets/design.xml" />
    <rule ref="rulesets/controversial.xml" />

Ignoring files

Storing generated or third party code in your repository is in general not a good idea. However, sometimes you really need to do this and CodeFlow got you covered. Usually you don't want to analyze those files so you can place .codesizeignore file to the root folder of your repository. This file can contain regular expressions that are matched with paths in your project and excluded from the analysis. The syntax is identical with popular gitignore format.

Take a look on this simple example with Composer and Protocol Buffers:


# 3rd party libraries

# Protocol Buffers

If you are dealing with any special type of project structure, please, let us know. We are happy to help you.