PHPDeveloper.orghttp://www.phpdeveloper.org
Up-to-the Minute PHP News, views and communityen-usTue, 03 Mar 2015 16:53:46 -060030http://www.phpdeveloper.org/news/12300http://www.phpdeveloper.org/news/12300
On his blog today Sameer looks at a method for finding duplicate code in your applications with the help of PHPCPD.

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. PHPCPD (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.

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.

]]>Wed, 08 Apr 2009 11:16:17 -0500http://www.phpdeveloper.org/news/12153http://www.phpdeveloper.org/news/12153
Sebastian Bergmann has a new post that lists a few quality assurance testing tools you can use to ensure that you and your code are safe to make the jump to production.

He's laid out a map of the tools that can all interact to create a more robust environment for automatically building and testing your code. Here's his list: