mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
Python: Fix all metrics-related compilation failures
In hindsight, having a `.getMetrics()` method that just returns `this` is somewhat weird. It's possible that it predates the existence of the inline cast, however.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Module m, int n
|
||||
where n = m.getMetrics().getNumberOfLinesOfComments()
|
||||
from ModuleMetrics m, int n
|
||||
where n = m.getNumberOfLinesOfComments()
|
||||
select m.toString(), n
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Function func
|
||||
select func.toString(), func.getMetrics().getCyclomaticComplexity()
|
||||
from FunctionMetrics func
|
||||
select func.toString(), func.getCyclomaticComplexity()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Scope s, int n
|
||||
where
|
||||
exists(Function f | f = s | n = f.getMetrics().getNumberOfLines())
|
||||
exists(FunctionMetrics f | f = s | n = f.getNumberOfLines())
|
||||
or
|
||||
exists(Module m | m = s | n = m.getMetrics().getNumberOfLines())
|
||||
exists(ModuleMetrics m | m = s | n = m.getNumberOfLines())
|
||||
select s.toString(), n
|
||||
|
||||
Reference in New Issue
Block a user