mirror of
https://github.com/github/codeql.git
synced 2026-02-24 19:03:50 +01:00
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.
21 lines
618 B
Plaintext
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
|