PHP Mess Detector (PHPMD) is a tool for finding potential problems in your PHP code base. The tool outputs a detailed HTML report, which highlights the file name, line number, and a description of the potential problem detected.

Some examples of the kinds of problems the tool can find are:

  • Overly complex or long classes and methods.
  • Unused parameters in methods.
  • Unused variables or private methods.

You can find a full list of all of the rules applied by PHPMD during analysis on the PHPMD home site here:

Current Rulesets

Like all code analysis tools, PHPMD is no silver bullet but it will provide you with lots of hints on where you should be looking in your code for potential problems, particularly if you care about writing maintainable code.

John Collins

I have been writing about web technology and software development since 2001. I am the developer of the Alpha Framework for PHP. I love open source, technology, and economics. You can follow updates from this blog on Twitter.

Progress to date on V.5

Alpha Framework 2.0 Beta