<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 03:28:17 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[QaFoo.com Blog: Howto write a Rule for PHPMD]]></title>
      <guid>http://www.phpdeveloper.org/news/16072</guid>
      <link>http://www.phpdeveloper.org/news/16072</link>
      <description><![CDATA[<p>
On the QaFoo blog today <i>Manuel Pichler</i> has written up a guide to help you <a href="http://qafoo.com/blog/019_howto_write_custom_rules_for_phpmd.html">write a custom rule</a> to use with the PHP Mess Detector (PHPMD) as extended from some of the current rules (it's always easier to start from examples).
</p>
<blockquote>
Let us start with some architecture basics behind PHPMD. All rules in PHPMD must at least implement the <a href="https://github.com/phpmd/phpmd/blob/master/src/main/php/PHP/PMD/Rule.php">PHP_PMD_Rule</a> interface. You can also extend the abstract rule base class <a href="https://github.com/phpmd/phpmd/blob/master/src/main/php/PHP/PMD/AbstractRule.php">PHP_PMD_AbstractRule</a> which already provides an implementation of all required infrastructure methods and application logic, so that the only task which is left to you is the implementation of the concrete validation code of your rule. 
</blockquote>
<p>
He walks you through some sample code and talks about some of the common interfaces that are available to your testing. He takes one of them, IFunctionAware, and looks at it specifically, showing how to use it to detect and add violations for the validation. He includes an example of writing a rule based on an existing software metric (in this case, the number of public methods). There's also  bit at the end showing how to write a rule based on the "abstract syntax tree" to be able to check just about anything in the code you're looking to test.
</p>]]></description>
      <pubDate>Mon, 21 Mar 2011 09:16:57 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Francesco Montefoschi's Blog: PHPADD: abandoned docblocks detector]]></title>
      <guid>http://www.phpdeveloper.org/news/15578</guid>
      <link>http://www.phpdeveloper.org/news/15578</link>
      <description><![CDATA[<p>
<i>Francesco Montefoschi</i> has a <a href="http://blog.webmatters.it/2010/12/phpadd-abandoned-docblocks-detector/">recent post to his blog</a> looking at a tool you could use to ensure the quality of your code comments - <a href="https://github.com/fmntf/phpadd">PHPADD</a>, the abandoned docblock detector.
</p>
<blockquote>
PHPADD can analyze a directory with PHP source code and detect (for each file, for each class, for each method) if the parameters in the function declaration are compatible with the parameters found in the docblock, reporting the outdated ones. This can be easily integrated in your build script and the result can be published in build result. Using Hudson, you just need HTML Publisher plugin.
</blockquote>
<p>
The include the (super simple) installation instructions for pulling it in via the PEAR installer and running it on your codebase. There's even some <a href="http://acme.webmatters.it/misc/phpadd-output.html">sample output</a> included. If you're interested in the source, check out (or fork) <a href="https://github.com/fmntf/phpadd">the latest code on github</a>.
</p>]]></description>
      <pubDate>Tue, 14 Dec 2010 13:34:34 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Detecting duplicate code in PHP files]]></title>
      <guid>http://www.phpdeveloper.org/news/12300</guid>
      <link>http://www.phpdeveloper.org/news/12300</link>
      <description><![CDATA[<p>
On his blog today <i>Sameer</i> looks at <a href="http://www.codediesel.com/tools/detecting-duplicate-code-in-php-files/">a method for finding duplicate code</a> in your applications with the help of <a href="http://github.com/sebastianbergmann/phpcpd/tree/master">PHPCPD</a>.
</p>
<blockquote>
Duplicated code in projects is a frequent thing and also the one ripe for factoring out in a new class or function. Cut/Paste coding is a common development practice among programmers, a lot of which can lead to code size increase and maintenance nightmares. <a href="http://github.com/sebastianbergmann/phpcpd/tree/master">PHPCPD</a> (php copy paste detector) is a PEAR tool that makes it easier to detect duplicate code in php projects. Below is a short tutorial on the PHPCPD package.
</blockquote>
<p>
You can either install the tool via a PEAR channel or directly from the github site. Once its downloaded and extracted you can immediately run it on the subdirectory of your choice. He also includes a more extended example - a search on a minimum of 5 lines of 70 tokens found to trip the filter in finding cloned functionality.
</p>]]></description>
      <pubDate>Wed, 08 Apr 2009 11:16:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: Copy & Paste Detection in PHPUnit 3.2]]></title>
      <guid>http://www.phpdeveloper.org/news/8508</guid>
      <link>http://www.phpdeveloper.org/news/8508</link>
      <description><![CDATA[<p>
<i>Sebastian Bergmann</i> <a href="http://sebastian-bergmann.de/archives/693-Copy-Paste-Detection-in-PHPUnit-3.2.html">spotlights another feature</a> of the upcoming <a href="http://www.phpunit.de/">PHPUnit</a> version 3.2 - the inclusion of a <a href="http://sebastian-bergmann.de/archives/690-PHPUnit-as-a-Project-Mess-Detector.html">Project Mess Detector</a>'s ability to help find duplicate code.
</p>
<blockquote>
Duplicate code can be hard to find, especially in a large project. Johann-Peter Hartmann of <a href="http://www.mayflower.de/">MAYFLOWER GmbH</a> recently implemented <a href="http://pmd.sourceforge.net/cpd.html">Copy & Paste Detection</a> for PHPUnit's growing set of features that extends its usage scenarios beyond "just unit testing" to a one-stop solution for quality assurance in PHP-based projects.
</blockquote>
<p>
In <a href="http://sebastian-bergmann.de/archives/693-Copy-Paste-Detection-in-PHPUnit-3.2.html">his example</a>, <i>Sebastian</i> shows what the response will look like when the tests find duplicate code - giving details like the files involved and the code fragment that was duplicated.
</p>
<p>
Check out <a href="http://sebastian-bergmann.de/archives/689-PHPUnit-and-Software-Metrics.html">this list</a> in another post on <i>Sebastian</i>'s blog for more of the metrics that will be included in the upcoming version.
</p>]]></description>
      <pubDate>Wed, 22 Aug 2007 09:31:00 -0500</pubDate>
    </item>
  </channel>
</rss>
