cyclomatic-complexity

Limiting a number without a conditional

Limiting a number without a conditional Question: Consider the following function: def absolute_value(some_number): if some_number < 0: return -some_number return some_number and this one: def absolute_value(some_number): return (some_number**2)**0.5 We can say that (in a naive manner) these two more or less achieve the same result (ignoring the performance issues) but the latter one has less …

Total answers: 2

How can I analyze Python code to identify problematic areas?

How can I analyze Python code to identify problematic areas? Question: I have a large source repository split across multiple projects. I would like to produce a report about the health of the source code, identifying problem areas that need to be addressed. Specifically, I’d like to call out routines with a high cyclomatic complexity, …

Total answers: 8