jendrikseipp / vulture

Find dead Python code
MIT License
3.48k stars 152 forks source link

Can vulture be used to detect unused code in a shared library? #254

Closed fredrikaverpil closed 3 years ago

fredrikaverpil commented 3 years ago

Hi!

I'm wondering ... if I have three Python packages installed (or in a folder);

  1. lib
  2. client1
  3. client2

...where the "client1" and "client2" packages import "lib". Can I somehow run vulture on "lib" to see if there is unused code in "lib", never called by either "client1" or "client2"?

Thanks for a great tool! 👍

RJ722 commented 3 years ago

@fredrikaverpil If all the three lib, client1 and client2 live in the same directory, then you can run Vulture on the parent directory, and inspect the output to find any dead code inside lib which isn't being used by either of the clients.

If installed as a package (via pip, or like), Vulture won't have access to lib's source code and won't be able to find any dead code inside it.

fredrikaverpil commented 3 years ago

Great, many thanks - seems to work fine! 👍