Is there any monitoring, analysis tools that would facilitate the cleaning up of dead files , variables , functions and refactoring of a large , relatively messy php project/framework?
Facebook's HipHop also has a very fast static code analyzer which will help. Etsy's Nick Galbreath gives a nice presentation on this at http://www.slideshare.net/nickgsuperstar/static-analysis-for-php
If the problem is cleaning up dead code, first you have find dead code.
You can use test coverage tools (my company offers one of these) to find out what code is likely to be dead. Exercise lots of functionality either via unit tests or by simply running the application for a day; no coverage of method X means X is probably dead.
Dead variables are harder; you need data access coverage information. I don't know of any such tools for PHP.
I don't know of any static analyzers that will reliably tell you if code/variables are dead. (HipHop, mentioned in another answer, might be able to do this for some methods, and especially for local variables, but eval can cause any function to be called or any variable to be referenced so it is hard to get this right in PHP).
Then you can decide if you want to remove the dead code, or retain it to improve future evolution.
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With