Finding unused code

Graham Ashton graham at effectif.com
Tue Apr 29 23:07:45 CEST 2003


I'm involved in maintaining a rather large Python project at work, and am
curious about how many of the classes, methods and functions that are
defined aren't actually used. There's been a fair amount of refactoring
over the last couple of years, so I wouldn't be surprised if there's
rather a lot of it.

I'd like to write a script to analyse the source code and tell me which
bits haven't been used, but I'm at a bit of a loss for where to start.

Any ideas? Or has somebody else already written such a tool?

--
Graham Ashton




More information about the Python-list mailing list