Files
codeql/python/ql/src/Metrics/DirectImports.ql
Taus 5b63b4957c Python: Fix query tests
Mostly just adding `private import LegacyPointsTo`. Sometimes getting
rid of other imports that are superceded by that module.
2025-11-26 12:30:30 +00:00

19 lines
445 B
Plaintext

/**
* @name Direct imports per file
* @description The number of modules directly imported by this file.
* @kind treemap
* @id py/direct-imports-per-file
* @treemap.warnOn highValues
* @metricType file
* @metricAggregate avg max
* @tags modularity
* maintainability
*/
import python
private import LegacyPointsTo
from ModuleValue m, int n
where n = count(ModuleValue imp | imp = m.getAnImportedModule())
select m.getScope(), n