mirror of
https://github.com/github/codeql.git
synced 2026-03-29 11:48:16 +02:00
23 lines
514 B
Plaintext
23 lines
514 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
|