mirror of
https://github.com/github/codeql.git
synced 2026-01-10 05:00:29 +01:00
24 lines
518 B
Plaintext
24 lines
518 B
Plaintext
/**
|
|
* @name Average cyclomatic complexity of files
|
|
* @description The average cyclomatic complexity of the functions in a file.
|
|
* @kind treemap
|
|
* @treemap.warnOn highValues
|
|
* @metricType file
|
|
* @metricAggregate avg max
|
|
* @precision very-high
|
|
* @tags testability
|
|
* @id js/cyclomatic-complexity-per-file
|
|
*/
|
|
|
|
import javascript
|
|
|
|
from File f, float n
|
|
where
|
|
n =
|
|
avg(Function fun, int toAvg |
|
|
fun.getTopLevel().getFile() = f and toAvg = fun.getCyclomaticComplexity()
|
|
|
|
|
toAvg
|
|
)
|
|
select f, n
|