[Lxr-general] Finding unreferenced functions
Brought to you by:
ajlittoz
|
From: Michael O'C. <moc...@ya...> - 2005-01-06 15:25:57
|
Hi, Apologies if this has been asked before. I'm wondering if anyone's tried using lxr on a codebase to find unreferenced / unused functions. I tried this on a C / C++ codebase I've been working in and found it very useful as part of a clean-up exercise. It depends on relational database storage of the lxr data (mysql in my case). A query counting the number of instances of each symbol in the indexes table can be compared with an equivalent query on the useages table, where the latter count is <= the former the symbol can be considered unreferenced (i.e. not used). It's not foolproof, depends on indexing of all dependent code, and won't find all instances (due to the regex nature of lxr's symbol finding / storage), nonetheless I've found it an easy an quick way of finding unused code. I guess there are better ways of achieving the same result, I'd like to hear what people think. Thanks, Michael __________________________________ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 |