Re: Inverting a dependency list
| From: | Eric Butera | Date: | Thu, 16 Jul 2009 16:51:54 +0000 |
| Subject: | Re: Inverting a dependency list | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295482@lists.php.net to get a copy of this message | ||
On Thu, Jul 16, 2009 at 12:09 PM, Bob McConnell<rvm@cbord.com> wrote:
> I recall, years ago, having a set of utilities that would build a call
> tree from application code written in C. This was useful for figuring
> out dependencies in code that someone else had written. I would like to
> do something similar with a large PHP application I am now maintaining,
> but with a slightly different emphasis.
>
> This application includes several library files which contain more than
> 400 function declarations. I need to determine how many of those
> functions are actually used by the application and which can be culled
> from the code base. Is there an easy way to determine which of them are
> called somewhere and then work through the call tree to identify the
> orphans?
>
> Bob McConnell
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
PHPUnit + Xdebug has a really nice code coverage generation. Perhaps
you could use the way phpunit hooks into xdebug to figure out likes
that get hit in the code base. I don't know of a simple, ready-made
solution off the top of my head though.
--
http://www.ericbutera.us/