Static analysis tools in Python

PyChecker

PyChecker is a tool for finding bugs in python source code. It finds problems that are typically caught by a compiler for less dynamic languages, like C and C++. Because of the dynamic nature of python , some warnings may be incorrect; however, spurious warnings should be fairly infrequent. PyChecker works in a combination of ways. First, it imports each module. If there is an import error , the module cannot be processed. The import provides some basic information about the module. The code for each function, class, and method is checked for possible problems.

How to use PyChecker?

You can use it directly in your code. All you have to do is import PyChecker at the top of your module, like this:
import pychecker.checker
This will make PyChecker check all the following imported modules, although it won’t do the main module.

Commandline

To use PyChecker , pass options and the python source files (or packages) you want to check on the command line:
pychecker [options] file1.py file2.py ...
Know more about...... PyChecker

Pylint

Pylint is a tool that checks for errors in Python code, tries to enforce a coding standard and looks for code smells. It can also look for certain type errors, it can recommend suggestions about how particular blocks can be refactored and can offer you details about the code's complexity. It is a useful tool to improve code quality and to ensure that it complies with PEP-8 style guidelines. Pylint will display a number of messages as it analyzes the code and it can also be used for displaying some statistics about the number of warnings and errors found in different files. The messages are classified under various categories such as errors and warnings. Know more about..... PyLint