codeclimate / codeclimate-phpmd

Code Climate PHPMD Engine
MIT License
10 stars 12 forks source link
code-quality codeclimate codeclimate-engine metrics phpmd quality static-analysis

Code Climate PHP Mess Detector (PHPMD) Engine

Code Climate

codeclimate-phpmd is a Code Climate Engine that wraps the PHP Mess Detector (PHPMD) static analysis tool.

Installation

  1. If you haven't already, install the Code Climate CLI.
  2. Run codeclimate engines:enable phpmd. This command both installs the engine and enables it in your .codeclimate.yml file.
  3. You're ready to analyze! Browse into your project's folder and run codeclimate analyze.

Config Options

Format the values for these config options per the PHPMD documentation.

Sample Config

exclude_paths:
 - "/examples/**/*"
engines:
  phpmd:
    enabled: true
    config:
      file_extensions: "php"
      rulesets: "unusedcode,codesize,naming,optional_relative_path_to_custom_ruleset.xml"
ratings:
  paths:
  - "**.php"

Need help?

For help with PHPMD, check out their documentation.

If you're running into a Code Climate issue, first look over this project's GitHub Issues, as your question may have already been covered. If not, go ahead and open a support ticket with us.