[TIP] McCabe Cyclomatic complexity
constant.beta at gmail.com
Mon Apr 28 02:34:49 PDT 2008
On Mon, Apr 28, 2008 at 11:07 AM, Stefano Masini
<stefano.masini at pragma2000.com> wrote:
> it seams almost impossible that the only thing out there that
> calculates the McCabe cyclomatic complexity of Python code is this
> hacky Perl script!
> Then someone wrote a python wrapper for taking the hack a bit further:
> I'm wondering: am I the only one looking for cyclomatic complexity of
> python code? Or is everybody using the above perl script?
> I took a look at the perl code, and it doesn't seem hard to port it to Python.
> Anybody trying to use the interpreter parse tree? Or maybe that way
> it's too complicated.
There is a tool written in Python for calculating cyclomatic
complexity of Python code. You can find it here:
. It uses the compiler module to parse Python source code.
More information about the testing-in-python