Files
codeql/python/ql/src/Metrics/CyclomaticComplexity.ql
Taus 24a29f46be Python: Fix all metrics-related compilation failures
In hindsight, having a `.getMetrics()` method that just returns `this`
is somewhat weird. It's possible that it predates the existence of the
inline cast, however.
2025-11-26 21:28:51 +00:00

21 lines
618 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
private import LegacyPointsTo
from FunctionMetrics func, int complexity
where complexity = func.getCyclomaticComplexity()
select func, complexity order by complexity desc