Files
codeql/python/ql/src/Metrics/CyclomaticComplexity.ql
Taus e8de8433f4 Python: Update all metrics-dependant queries
The ones that no longer require points-to no longer import
`LegacyPointsTo`. The ones that do use the specific
`...MetricsWithPointsTo` classes that are applicable.
2026-02-19 12:32:27 +00:00

21 lines
630 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 FunctionMetricsWithPointsTo func, int complexity
where complexity = func.getCyclomaticComplexity()
select func, complexity order by complexity desc