Skip to content

Commit 47421a6

Browse files
committed
Python: Port import metrics queries
1 parent 603d37c commit 47421a6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

python/ql/src/Metrics/DirectImports.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
*/
1212

1313
import python
14-
private import LegacyPointsTo
14+
private import semmle.python.dataflow.new.internal.ImportResolution
1515

16-
from ModuleValue m, int n
17-
where n = count(ModuleValue imp | imp = m.getAnImportedModule())
18-
select m.getScope(), n
16+
from Module m, int n
17+
where n = count(Module imp | ImportResolution::imports(m, imp))
18+
select m, n

python/ql/src/Metrics/TransitiveImports.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
*/
1212

1313
import python
14-
private import LegacyPointsTo
14+
private import semmle.python.dataflow.new.internal.ImportResolution
1515

16-
from ModuleValue m, int n
17-
where n = count(ModuleValue imp | imp = m.getAnImportedModule+() and imp != m)
18-
select m.getScope(), n
16+
from Module m, int n
17+
where n = count(Module imp | ImportResolution::imports+(m, imp) and imp != m)
18+
select m, n

0 commit comments

Comments
 (0)