phpmd

PHP Mess Detector

TLDR

Check for issues
$ phpmd [src/] text [cleancode,codesize]
Generate HTML report
$ phpmd [src/] html [rulesets] --reportfile [report.html]
Use ruleset file
$ phpmd [src/] text [phpmd.xml]
Exclude directory
$ phpmd [src/] text [rulesets] --exclude [vendor]

SYNOPSIS

phpmd source format rulesets [options]

DESCRIPTION

phpmd is PHP Mess Detector. Finds potential problems in code.The tool detects code smells. Complexity and design issues.

PARAMETERS

SOURCE

Source files or directory.
FORMAT
Output format (text, xml, html).
RULESETS
Rules to apply.
--reportfile FILE
Output file.
--exclude PATTERN
Exclude pattern.
--help
Display help.

INSTALL

brew install phpmd

CAVEATS

Configurable rules. Can produce false positives.

HISTORY

PHPMD was created for detecting PHP code issues and maintainability problems.

SEE ALSO

phpcs(1), phan(1), phpstan(1)