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.
This commit is contained in:
Taus
2026-02-18 16:41:57 +00:00
parent 20fea3955e
commit e8de8433f4
28 changed files with 7 additions and 28 deletions

View File

@@ -18,6 +18,6 @@ from FunctionValue method
where
exists(ClassValue c |
c.declaredAttribute("__del__") = method and
method.getScope().(FunctionMetrics).getCyclomaticComplexity() > 3
method.getScope().(FunctionMetricsWithPointsTo).getCyclomaticComplexity() > 3
)
select method, "Overly complex '__del__' method."

View File

@@ -10,7 +10,6 @@
*/
import python
private import LegacyPointsTo
from FunctionMetrics f
select f, f.getNumberOfLinesOfCode() as n order by n desc

View File

@@ -13,5 +13,5 @@
import python
private import LegacyPointsTo
from ClassMetrics cls
from ClassMetricsWithPointsTo cls
select cls, cls.getAfferentCoupling() as n order by n desc

View File

@@ -13,5 +13,5 @@
import python
private import LegacyPointsTo
from ClassMetrics cls
from ClassMetricsWithPointsTo cls
select cls, cls.getEfferentCoupling() as n order by n desc

View File

@@ -12,7 +12,6 @@
*/
import python
private import LegacyPointsTo
from ModuleMetrics mm
where mm.getNumberOfLines() > 0

View File

@@ -15,6 +15,6 @@
import python
private import LegacyPointsTo
from FunctionMetrics func, int complexity
from FunctionMetricsWithPointsTo func, int complexity
where complexity = func.getCyclomaticComplexity()
select func, complexity order by complexity desc

View File

@@ -11,7 +11,6 @@
*/
import python
private import LegacyPointsTo
from ModuleMetrics mm
where mm.getNumberOfLines() > 0

View File

@@ -9,7 +9,6 @@
*/
import python
private import LegacyPointsTo
from ModuleMetrics m, int n
where n = m.getNumberOfLines()

View File

@@ -11,7 +11,6 @@
*/
import python
private import LegacyPointsTo
from ModuleMetrics m, int n
where n = m.getNumberOfLinesOfCode()

View File

@@ -10,7 +10,6 @@
*/
import python
private import LegacyPointsTo
from ModuleMetrics m, int n
where n = m.getNumberOfLinesOfComments() + m.getNumberOfLinesOfDocStrings()

View File

@@ -9,7 +9,6 @@
*/
import python
private import LegacyPointsTo
from FunctionMetrics func
select func, func.getNumberOfCalls() as n order by n desc

View File

@@ -11,7 +11,6 @@
*/
import python
private import LegacyPointsTo
from FunctionMetrics func
select func, func.getStatementNestingDepth() as n order by n desc

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
from ModuleMetrics m, int n
where

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
from ModuleMetrics m, int n
where

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
from ModuleMetrics m, int n
where

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
from ModuleMetrics m
where exists(m.getNumberOfLinesOfCode())

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
int committedFiles(Commit commit) { result = count(commit.getAnAffectedFile()) }

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
predicate inRange(Commit first, Commit second) {
first.getAnAffectedFile() = second.getAnAffectedFile() and

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
from ModuleMetrics m
where exists(m.getNumberOfLinesOfCode())

View File

@@ -10,7 +10,6 @@
import python
import external.VCS
private import LegacyPointsTo
from ModuleMetrics m
where

View File

@@ -9,7 +9,6 @@
*/
import python
private import LegacyPointsTo
from ClassMetrics cls
select cls, cls.getLackOfCohesionCK() as n order by n desc

View File

@@ -9,7 +9,6 @@
*/
import python
private import LegacyPointsTo
from ClassMetrics cls
select cls, cls.getLackOfCohesionHM() as n order by n desc

View File

@@ -13,5 +13,5 @@
import python
private import LegacyPointsTo
from ModuleMetrics m
from ModuleMetricsWithPointsTo m
select m, m.getAfferentCoupling() as n order by n desc

View File

@@ -13,5 +13,5 @@
import python
private import LegacyPointsTo
from ModuleMetrics m
from ModuleMetricsWithPointsTo m
select m, m.getEfferentCoupling() as n order by n desc

View File

@@ -11,7 +11,6 @@
*/
import python
private import LegacyPointsTo
from FunctionMetrics func
select func, func.getNumberOfParametersWithoutDefault() as n order by n desc

View File

@@ -10,6 +10,5 @@
*/
import python
private import LegacyPointsTo
select sum(ModuleMetrics m | | m.getNumberOfLinesOfCode())

View File

@@ -14,7 +14,6 @@
import python
import semmle.python.filters.GeneratedCode
private import LegacyPointsTo
select sum(ModuleMetrics m |
exists(m.getFile().getRelativePath()) and

View File

@@ -1,5 +1,5 @@
import python
private import LegacyPointsTo
from FunctionMetrics func
from FunctionMetricsWithPointsTo func
select func.toString(), func.getCyclomaticComplexity()