PHPMD - PHP Mess Detector


PHPMD - PHP Mess Detector

This is the project site of PHPMD. It is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly and easy to configure frontend for the raw metrics measured by PHP Depend.

What PHPMD does is: It takes a given PHP source code base and look for several potential problems within that source. These problems can be things like:

PHPMD is a mature project and provides a diverse set of pre defined rules (though may be not as many its Java brother PMD) to detect code smells and possible errors within the analyzed source code. Checkout the rules section to learn more about all implemented rules.

Recent Releases

phpmd-2.13.0 (2022/09/10)

phpmd-2.12.0 (2022/03/24)

phpmd-2.11.1 (2021/12/17)

phpmd-2.11.0 (2021/11/29)

phpmd-2.10.2 (2021/07/22)

phpmd-2.10.1 (2021/05/11)

phpmd-2.10.0 (2021/04/26)

phpmd-2.9.1 (2020/09/23)

phpmd-2.9.0 (2020/09/02)

### A potential BC change: With the clean-up in #768 we have a potential BC break in an unsupported part that we want to give attention for. > The class aliases PHP_PMD_* used for PHPMD 1.x backwards PEAR compatibility were removed. If you happen to still depend on these, please adjust your code like so: > > From PHP_PMD_[Component]_[Class]' to PHPMD\[Component]\[Class], > as in PHP_PMD_Renderer_HTMLRenderer' to PHPMD\Renderer\HTMLRenderer. See #768

phpmd-2.8.2 (2020/02/24)

phpmd-2.8.1 (2019/12/27)

phpmd-2.8.0 (2019/12/18)

phpmd-2.7.0 (2019/07/30)

This is the first minor release of the new PHPMD maintainer team. It contains all the new features, improvements and fixes from two and a half years since 2.6.0. Please take note of a backwards incompatible property renaming in the CouplingBetweenObjects rule.

phpmd-2.6.1 (2019/07/06)

This is the first release of the new maintainer team of PHPMD. It is a re-tag of 2.6.0 but with PHAR build on Travis-CI and deployment to GitHub releases.

phpmd-2.6.0 (2017/01/20)

This release incorporates several pending PRs. Beside that we have rebased PHPMD on PDepend 2.5 which should complete support for PHP 7 language features.

phpmd-2.5.0 (2016/11/23)

This release closes several minor/major issues in PHPMD itself and it bundles a new version of PDepend that also provides fixes for several bugs.

phpmd-2.4.4 (2016/11/22)

Maintenance release with new PDepend version bundled

phpmd-2.4.2 (2016/03/10)

phpmd-2.4.1 (2016/03/08)

This release fixes a method naming issue, that was introduced with 2.4.0.

phpmd-2.4.0 (2016/03/08)

This release adds a new helper method to access the full qualified name of an analyzed node.

phpmd-2.3.3 (2016/03/08)

Some minor issues fixed

phpmd-2.3.2 (2015/09/24)

With this release we make the Symfony dependency superfluous.

phpmd-2.3.1 (2015/09/22)

Bugfix release for issue #311 introduced with the 2.3.0 release.

phpmd-2.3.0 (2015/09/22)

This new release contains several contributed bugfixes and additions to PHPMD. Beside that we now have better support for language constructs in the upcoming PHP 7.

phpmd-2.2.3 (2015/05/27)

Bugfix release that closes issues and adds some improvements to phpmd.

phpmd-2.2.2 (2015/03/26)

Bugfix release that closes some issues in phpmd's core and in the project documentation.

phpmd-2.2.1 (2015/03/01)

This release integration several pull requests and closes and handful of issues.

phpmd-2.2.0 (2015/01/25)

Closes an issue with recent symfony versions

phpmd-2.1.3 (2014/09/25)

Bug fix release.

phpmd-2.1.2 (2014/09/25)

This release closes several minor issues and integrates some outstanding pull requests.

phpmd-2.1.1 (2014/09/09)

phpmd-2.1.0 (2014/09/08)

This integrates several outstanding pull requests.

phpmd-2.0.0 (2014/05/21)

This is major release of PHPMD which utilizes 2.0 engine of PDepend.

phpmd-1.5.0 (2013/07/26)

This release closes some PHP 5.4 related issues.

phpmd-1.4.1 (2012/12/14)

This release integrates several pull requests.

phpmd-1.4.0 (2012/09/07)

This release integrates some longer pending pull requests and smaller bugfixes. One major addition is support for Composer as distribution channel.

phpmd-1.3.3 (2012/02/29)

This release closes an issue introduced with the last release. It closes one more regression related to PHP's memory_limit and the Suhosin patch.

phpmd-1.3.2 (2012/02/25)

This release closes a minor issue in PHP_PMD's memory handling when it is run in a PHP environment that uses the Suhosin patch and the suhosin.memory_limit setting.

phpmd-1.3.1 (2012/02/16)

The 1.3.1 release of PHPMD closes one critical bug in PHPMD, that causes a fatal error due to the xdebug max_nesting_level setting for very deep self calls on methods.

phpmd-1.3.0 (2012/02/04)

Version 1.3.0 now depends on PHP_Depend 1.0.0 which has support for all the new language constructs introduced with PHP 5.4. Additionally this release contains some minor fixes for PHPMD's rule violation messages.

phpmd-1.2.1 (2011/10/04)

The 1.2.1 release of PHPMD closes several minor issues and bugs. Beside that we have added a contribution by Francis Besset with additions rules for PHPMD. Finally we have updated the utilized PHP_Depend version to a newer release.

phpmd-1.2.0 (2011/09/27)

Version 1.2.0 is a small feature release of PHPMD that introduces the new command line option --strict. This options forces PHPMD to apply all rules, even if a source node contains the @SuppressWarnings annotation.

phpmd-1.1.1 (2011/06/30)

Version 1.1.1 of PHPMD is a pure Bugfix release that fixes an issue in PHPMD's package manifest. This bug prevents Pyrus the PEAR2 installer from installing PHPMD.

phpmd-1.1.0 (2011/03/20)

Version 1.1.0 of PHPMD was released on March the 20th 2011. The key features for this release were two new rules. The first one utilizes the Coupling Between Objects (CBO) metric to detect strongly coupled classes. The second one detects the usage of PHP's questionable 'goto' statement. Beside that we have closed a minor bug in the LongVariable rule, where also private properties with descriptive names were reported. And finally we have replaced deprecated PHPUnit features in the PHPMD's test suite, so that PHPMD's tests should now work with PHPUnit 3.4.x and 3.5.x without deprecated warnings.

phpmd-1.0.1 (2011/02/12)

phpmd-1.0.0 (2011/02/05)

phpmd-0.2.8 (2010/11/25)

phpmd-0.2.7 (2010/09/01)

phpmd-0.2.6 (2010/07/03)

phpmd-0.2.5 (2010/04/03)

phpmd-0.2.4 (2010/03/08)

phpmd-0.2.3 (2010/03/04)

phpmd-0.2.2 (2010/01/20)

phpmd-0.2.1 (2010/01/05)

phpmd-0.2.0 (2009/12/30)

phpmd-0.1.0 (2009/12/20)

Initial release

Source | Edit