Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

How do I test the Cyclomatic complexity of my function?

Luigi Pizza (6120 points)
14 20 65
in Programming in Python by (6.1k points)
recategorized by
Is there a way to calculate our function cyclomatic complexity without submitting it?
546 views
closed

4 Answers

Best answer
ruben.ciranni (4650 points)
8 14 31
by (4.7k points)
selected by

After installing the radon library (conda install -c conda-forge radon) use the following command inside  the directory of the program you want to analyse:

radon cc -a -s --show-closures program.py

B
BesMorgan (3290 points)
1 2 17
by (3.3k points)
Sure you’ll find all the information here. Link below.

https://radon.readthedocs.io/en/latest/intro.html#cyclomatic-complexity

Good luck !
KilianS (3590 points)
7 10 27
by (3.6k points)
thanks, appreciate that
andrea.sterbini (207920 points)
750 1267 2373
by (208k points)
We compute the maximum cyclomatic complexity of the submitted functions

Use radon
christian.gennarelli (1130 points)
1 2 7
by (1.1k points)

You can find the right command here: https://q2a.di.uniroma1.it/21928/software-and-required-libraries?show=21928#q21928&course=advices/programming-ay21-22 under "Other useful commands" at the line "To compute the code intricacy (maximum cyclomatic complexity)".