PHPUnit as a Project Mess Detector

Sebastian Bergmann » 09 August 2007 » in New Features » 4 Comments

PMD, also known as Project Mess Detector, is a popular tool in the Java world that scans Java source code and looks for potential problems. It is well integrated with other tools such as Eclipse or CruiseControl, making the collected information available at multiple points throughout the development process.

Why am I blogging about this? Well. As of version 3.2, PHPUnit will not only be able to calculate and collect a variety of software metrics. It will also be able to report violations of rules that are based on these metrics in PMD's XML format. This information can then be fed to any tool that integrates with PMD.

For starters I implemented the code size rules that take, among other information, the Lines of Executable Code (ELOC), Cyclomatic Complexity, and NPath Complexity metrics into account.
Defined tags for this entry: , , ,

Trackback specific URI for this entry

4 Comments to "PHPUnit as a Project Mess Detector"

Display comments as (Linear | Threaded)
  1. Keith Casey
    09/08/2007 at 22:18 Permalink
    You're my hero. I've been looking for a PHP equivalent to PMD since I discovered it a couple years ago - http://caseysoftware.com/pmdapplied .

    On that note, any chance that the XSL representations of the PMD rules are compatible with your implementation?

    Reply

  2. Sebastian Bergmann
    10/08/2007 at 07:11 Permalink
    Those XSLT stylesheets should work as the XML should look just like PMD's.

    Reply

  3. Raphael Stolt
    11/08/2007 at 08:16 Permalink
    Will the source code inspection/scan process be independent from the testing process or are the possible found violations a 'side-product' from the ran tests?

    Anyway, like Keith Casey said hero-like news.

    Reply

  4. Sebastian Bergmann
    11/08/2007 at 08:19 Permalink
    For now the metrics and their possible violations are a byproduct of the test run.

    Reply

6 Trackbacks to "PHPUnit as a Project Mess Detector"

  1. Sebastian Bergmann 22/08/2007 at 09:25
    Version 3.2 of PHPUnit is shaping up nicely. In this blog posting I want to highlight another aspect of PHPUnit's new Project Mess Detector feature set.Duplicate code can be hard to find, especially in a large project. Johann-Peter Hartmann of MAYFLOWER G
  2. Sebastian Bergmann 28/10/2007 at 18:29
    I have just released a first release candidate for PHPUnit 3.2, the next major version of the xUnit testing framework for PHP. Highlights of this new release include software metrics, project mess detection, copy-and-paste detection, improvements to Se
  3. Sebastian Bergmann 12/11/2007 at 10:21
    I have just released a second release candidate for PHPUnit 3.2, the next major version of the xUnit testing framework for PHP. Highlights of this new release include software metrics, project mess detection, copy-and-paste detection, improvements to S
  4. Sebastian Bergmann 19/11/2007 at 12:06
    Sebastian Bergmann and his contributors are proud to announce the immediate availability of PHPUnit 3.2. This release is a major improvement to the popular open source testing solution for PHP applications. It includes new features and bug fixes. High
  5. Sebastian Bergmann 06/02/2008 at 19:26
    Manuel Pichler's recent blog entry on PHP_Depend propmpted me to write about my opinion on the future of software metrics and project mess detection in PHPUnit. When I started to work on these projects, there was no other place for me then to develop t
  6. techportal.ibuildings.com 26/08/2010 at 13:03

Add Comment


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Submitted comments will be subject to moderation before being displayed.