Skip to main content

A PHP mess detector that checks for common potential problems.

# To display a list of available rulesets and formats:
phpmd

# To scan a file or directory for problems using comma-separated rulesets:
phpmd <path/to/file_or_directory> <xml|text|html> <rulesets>

# To specify the minimum priority threshold for rules:
phpmd <path/to/file_or_directory> <xml|text|html> <rulesets> --minimumpriority <priority>

# To include only the specified extensions in analysis:
phpmd <path/to/file_or_directory> <xml|text|html> <rulesets> --suffixes <extensions>

# To exclude the specified comma-separated directories:
phpmd <path/to/file_or_directory> <xml|text|html> <rulesets> --exclude <directory_patterns>

# To output the results to a file instead of stdout:
phpmd <path/to/file_or_directory> <xml|text|html> <rulesets> --reportfile <path/to/report_file>

# To ignore the use of warning-suppressive PHPDoc comments:
phpmd <path/to/file_or_directory> <xml|text|html> <rulesets> --strict