Python Forum

Full Version: How to calculate the mccabe complexity in module falke8?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Right now, i am working on a assignment for a class, which is to calculate the mccabe complexity like it does in module flake8.
And I found that, if a function name appears more than one time, the flake8 module only output once, the last one. Does this reasonable? I think, it should output all of them. So, i want to know why it does not? can anybody explain that?
I've not used flake8, however it does make sense since in McCabe (Cyclomatic) complexity there is only one result, based on one entry node and one exit node.  If there are multiple 'functions', they are to be broken down to a point of one entry and exit node, then recombined so you end up with one combined function with one entry and exit node.