Forrest logo
back to the phpmd tool

phpmd:tldr:033b7

phpmd: Exclude the specified comma-separated directories.
$ phpmd ${filename_or_directory} ${xml|text|html} ${rulesets} --exclude ${directory_patterns}
try on your machine

This command runs the PHP Mess Detector (phpmd) tool on the specified filename or directory. The output format can be specified as xml, text, or html. The command also allows for specifying the rulesets to be used for analyzing the code, which determines what rules or standards will be checked.

The "--exclude" option can be used to exclude specific directory patterns from the analysis. This is useful for ignoring certain directories that you do not want to be inspected by phpmd.

Here's a breakdown of the command:

  • "phpmd": The command to run the PHP Mess Detector tool.
  • "${filename_or_directory}": This argument specifies the name of the file or directory to be analyzed by phpmd.
  • "${xml|text|html}": This argument determines the format of the output generated by phpmd. You can choose either xml, text, or html.
  • "${rulesets}": You can specify the rulesets to be used by phpmd for analyzing the code. Rulesets define the coding standards or rules that will be checked. Multiple rulesets can be separated by commas.
  • "--exclude ${directory_patterns}": This option allows you to exclude specific directory patterns from the analysis. The "${directory_patterns}" argument specifies the patterns of directories that should be excluded.

Replacing the variables with their respective values, a sample command might look like this:

phpmd my_directory/ xml cleancode,codesize --exclude vendor/*

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the phpmd tool