Page 1 of 1

PHP Tool: Dead Code Detection?

Posted: Wed Mar 17, 2010 10:54 am
by jeff00seattle
Hi

I have a project with a lot of PHP code, and I want to run a tool that will detect if it has any dead code (not called) and lists them so that I can remove.

Is there such a PHP tool?

Thanks

Jeff in Seattle

Re: PHP Tool: Dead Code Detection?

Posted: Wed Mar 17, 2010 12:14 pm
by Sofw_Arch_Dev
A "profiler" would probably do the trick. I haven't used one for PHP, but they generally analyze your code and give statistics on your code files such as the amount of usage it gets, amount of memory it consumes, amount of time spent etcetera. This may do what you want.

Do a web search for PHP profiler. There are several available.

Re: PHP Tool: Dead Code Detection?

Posted: Wed Mar 17, 2010 3:04 pm
by Weirdan
More specifically you need code coverage analysis tool. Xdebug can gather code coverage data, for example.