Files
codeql/python/ql/src/Metrics/FunctionStatementNestingDepth.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

18 lines
441 B
Plaintext

/**
* @name Statement nesting depth
* @description The maximum nesting depth of statements in a function.
* @kind treemap
* @id py/statement-nesting-depth-per-function
* @treemap.warnOn highValues
* @metricType callable
* @metricAggregate avg max
* @tags maintainability
* complexity
*/
import python
private import LegacyPointsTo
from FunctionMetrics func
select func, func.getStatementNestingDepth() as n order by n desc