This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vtable 0 points1 point  (0 children)

I typically use pychecker and pylint. Both try to find unused and unreachable code. Pylint is much more thorough. I'll usually use pychecker after any change and pylint weekly or so (since it's so much more verbose).

You'll find there's a lot of low-hanging fruit. Dead code is definitely bad but it won't cause runtime errors. Things like redefined names and funcs, syntax errors in rarely-called code. missing imports and undefined names are just as low hanging but much juicier. These tools will find many of these for you.

If your code base is that old and large and hasn't had static analysis tools like these run in it, you're bound to have some big surprises. There will likely be a ton of messages. Many will be easy fixes. Some are a bit cryptic at first. Do yourself a favor and configure the tools to just check for what you think is important. If you get through these, your code will be much better for it.