Performing static analysis with Pyflakes
We will perform static analysis of a part of the NumPy codebase. In order to do this, we will check out the code using Git. We will then run
static analysis on part of the code using pyflakes
.
How to do it...
Check out the code.
To check out the NumPy code, we will need Git. Installing Git is outside the scope of this book. The Git command to retrieve the code is as follows:
git clone git://github.com/numpy/numpy.git numpy
Alternatively, we can download a zip archive from https://github.com/numpy/numpy .
Analyze the code.
The previous step should have created a
numpy
directory with all the NumPy code. Go to this directory, and within it run the following command:$ pyflakes *.py pavement.py:71: redefinition of unused 'md5' from line 69 pavement.py:88: redefinition of unused 'GIT_REVISION' from line 86 pavement.py:314: 'virtualenv' imported but unused pavement.py:315: local variable 'e' is assigned to but never used pavement.py:380: local variable 'sdir...