Skip to content

Commit 040512e

Browse files
committed
Python: Update all metrics-dependant queries
The ones that no longer require points-to no longer import `LegacyPointsTo`. The ones that do use the specific `...MetricsWithPointsTo` classes that are applicable.
1 parent 38ab4fd commit 040512e

28 files changed

+7
-28
lines changed

python/ql/src/Functions/OverlyComplexDelMethod.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ from FunctionValue method
1818
where
1919
exists(ClassValue c |
2020
c.declaredAttribute("__del__") = method and
21-
method.getScope().(FunctionMetrics).getCyclomaticComplexity() > 3
21+
method.getScope().(FunctionMetricsWithPointsTo).getCyclomaticComplexity() > 3
2222
)
2323
select method, "Overly complex '__del__' method."

python/ql/src/Metrics/CLinesOfCode.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111

1212
import python
13-
private import LegacyPointsTo
1413

1514
from FunctionMetrics f
1615
select f, f.getNumberOfLinesOfCode() as n order by n desc

python/ql/src/Metrics/ClassAfferentCoupling.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
import python
1414
private import LegacyPointsTo
1515

16-
from ClassMetrics cls
16+
from ClassMetricsWithPointsTo cls
1717
select cls, cls.getAfferentCoupling() as n order by n desc

python/ql/src/Metrics/ClassEfferentCoupling.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
import python
1414
private import LegacyPointsTo
1515

16-
from ClassMetrics cls
16+
from ClassMetricsWithPointsTo cls
1717
select cls, cls.getEfferentCoupling() as n order by n desc

python/ql/src/Metrics/CommentRatio.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
import python
15-
private import LegacyPointsTo
1615

1716
from ModuleMetrics mm
1817
where mm.getNumberOfLines() > 0

python/ql/src/Metrics/CyclomaticComplexity.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
import python
1616
private import LegacyPointsTo
1717

18-
from FunctionMetrics func, int complexity
18+
from FunctionMetricsWithPointsTo func, int complexity
1919
where complexity = func.getCyclomaticComplexity()
2020
select func, complexity order by complexity desc

python/ql/src/Metrics/DocStringRatio.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212

1313
import python
14-
private import LegacyPointsTo
1514

1615
from ModuleMetrics mm
1716
where mm.getNumberOfLines() > 0

python/ql/src/Metrics/FLines.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010

1111
import python
12-
private import LegacyPointsTo
1312

1413
from ModuleMetrics m, int n
1514
where n = m.getNumberOfLines()

python/ql/src/Metrics/FLinesOfCode.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212

1313
import python
14-
private import LegacyPointsTo
1514

1615
from ModuleMetrics m, int n
1716
where n = m.getNumberOfLinesOfCode()

python/ql/src/Metrics/FLinesOfComments.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111

1212
import python
13-
private import LegacyPointsTo
1413

1514
from ModuleMetrics m, int n
1615
where n = m.getNumberOfLinesOfComments() + m.getNumberOfLinesOfDocStrings()

0 commit comments

Comments
 (0)