« Home | javascript functions. » | Create tunnel via the ssh command in linux. » | Find tables which are empty in database. » | Svn branching strategies. » | Excellent tutorial on linux usermanagement and sud... » | Using Grep to search in files » | Android implicit intents various intents creation ... » | Find the unused selectors in a webpage. » | Installing missing dependencies redhat / fedora / ... » | Query to delete rows with duplicate columns. » 

Friday, August 26, 2011 

Detecting php duplicate and unused code.

One of the project that I had to work on recently was huge and written over by developers who were working intermittently on it with very short deadlines. Hence the code had duplicate code, dead functions which were never used. It needed re-factoring badly. 

I found the below tool which helped us a lot in identifying duplicate and dead code. 

phpcpd - for identifying and detecting duplicate code. (php copy paste detector)
phpdcd for identifying and detecting dead code. (php dead code detector)