Flake8 is a project that combines 3 great tools in one package:
Pep8 that checks if the code style respects the standard adopted by the community described in Python Enhancement Proposal 8.
PyFlakes that statically analyzes your code by detecting numerous anti-patterns and logical errors such as imported modules that are not used, use of undeclared variables, among many other things.
Codepaths that performs the analysis of the mechatronic complexity of code based on McCabe metrics.
Install flake8