[TIP] McCabe Cyclomatic complexity

Stefano Masini stefano.masini at pragma2000.com
Mon Apr 28 02:07:12 PDT 2008


Hi,

it seams almost impossible that the only thing out there that
calculates the McCabe cyclomatic complexity of Python code is this
hacky Perl script!
http://www.journyx.com/curt/complexity.html

Then someone wrote a python wrapper for taking the hack a bit further:
http://gdub.wordpress.com/2006/07/09/cyclomatic-complexity-for-python-code/

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.

Cheers
Stefano



More information about the testing-in-python mailing list