Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e8de843

Browse filesBrowse 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 20fea39 commit e8de843
Copy full SHA for e8de843

28 files changed

+7-28Lines changed: 7 additions & 28 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎python/ql/src/Functions/OverlyComplexDelMethod.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Functions/OverlyComplexDelMethod.ql
+1-1Lines 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."
Collapse file

‎python/ql/src/Metrics/CLinesOfCode.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/CLinesOfCode.ql
-1Lines 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
Collapse file

‎python/ql/src/Metrics/ClassAfferentCoupling.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/ClassAfferentCoupling.ql
+1-1Lines 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
Collapse file

‎python/ql/src/Metrics/ClassEfferentCoupling.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/ClassEfferentCoupling.ql
+1-1Lines 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
Collapse file

‎python/ql/src/Metrics/CommentRatio.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/CommentRatio.ql
-1Lines 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
Collapse file

‎python/ql/src/Metrics/CyclomaticComplexity.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/CyclomaticComplexity.ql
+1-1Lines 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
Collapse file

‎python/ql/src/Metrics/DocStringRatio.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/DocStringRatio.ql
-1Lines 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
Collapse file

‎python/ql/src/Metrics/FLines.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/FLines.ql
-1Lines 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()
Collapse file

‎python/ql/src/Metrics/FLinesOfCode.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/FLinesOfCode.ql
-1Lines 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()
Collapse file

‎python/ql/src/Metrics/FLinesOfComments.ql‎

Copy file name to clipboardExpand all lines: python/ql/src/Metrics/FLinesOfComments.ql
-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.