LinuxCommandLibrary

phpmd

TLDR

Check for issues

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

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.
phpmd finds PHP problems.

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.

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)

Copied to clipboard