Skip to main content
PHPMD (PHP Mess Detector) is a static analysis tool for PHP that detects potential problems in your code such as possible bugs, suboptimal code, overcomplicated expressions, and unused parameters, variables, methods, and classes. CodeRabbit runs PHPMD v3.0.0.

Files

PHPMD will run on files with the following extensions:
  • .php

Features

PHPMD can detect various code quality issues including:
  • Clean Code Rules: Detects code smells and violations of clean code principles
  • Controversial Rules: Identifies potentially problematic code patterns
  • Design Rules: Finds design-related issues and architectural problems
  • Naming Rules: Checks for naming convention violations
  • Unused Code Rules: Detects unused variables, parameters, methods, and classes
  • Size Rules: Identifies overly complex methods and classes

Configuration

boolean
default:true
Enable PHPMD
.coderabbit.yaml
CodeRabbit uses only the built-in PHPMD rule sets. Custom XML rule sets and repository-provided PHP rule classes are not loaded.

When we skip PHPMD

CodeRabbit will skip running PHPMD when:
  • PHPMD is already running in GitHub Actions, GitLab CI, CircleCI, or Azure Pipelines.

Profile behavior

CodeRabbit’s review profile affects which PHPMD rules are applied:
  • Chill Mode: Only checks for unused code (unusedcode rule set)
  • Assertive Mode: Checks all rule sets including clean code, code size, controversial rules, design issues, naming conventions, and unused code (cleancode,codesize,controversial,design,naming,unusedcode)
CodeRabbit suppresses CamelCaseVariableName findings in both profiles.