Files
codeql/python/ql/src/Metrics/CyclomaticComplexity.ql
2020-03-30 11:59:10 +02:00

20 lines
594 B
Plaintext

/**
* @name Cyclomatic complexity of functions
* @description The cyclomatic complexity per function (an indication of how many tests are necessary,
* based on the number of branching statements).
* @kind treemap
* @id py/cyclomatic-complexity-per-function
* @treemap.warnOn highValues
* @metricType callable
* @metricAggregate avg max sum
* @tags testability
* complexity
* maintainability
*/
import python
from Function func, int complexity
where complexity = func.getMetrics().getCyclomaticComplexity()
select func, complexity order by complexity desc