I’m trying to clean up some tangled legacy code in django. Vulture looks like a good bet, but it doesn’t seem to know how to find view functions referenced from urls.py. This isn’t too surprising, since most of the functions are included as strings:
...
url(r'^some-url/$', 'my_app.views.some_url_view'),
...
Is there a simple way to make vulture aware of the view functions?
One thing I’ve got going for me: I’ve written fairly extensive tests for the code. Currently, vulture misses these tests, but if there were some way to make vulture aware of these tests, I think all the views would be included as well.
Try Ned’s Batchelder
coverageby itself or use it withnose.Just run through the testcases, and
coverage htmlwill get you a beautiful reporting showing your code line by line, with detailed coverage information. Trim down/remove unused/untested code afterwards.