Files
codeql/python/ql/src/Metrics/FNumberOfTests.ql
2021-03-25 15:06:47 +01:00

17 lines
394 B
Plaintext

/**
* @name Number of tests
* @description The number of test methods defined in a module
* @kind treemap
* @treemap.warnOn lowValues
* @metricType file
* @metricAggregate avg sum max
* @id py/tests-in-files
*/
import python
import semmle.python.filters.Tests
from Module m, int n
where n = strictcount(Test test | test.getEnclosingModule() = m)
select m.getFile(), n order by n desc