Python: Port OverlyComplexDelMethod.ql

Only trivial test changes.
This commit is contained in:
Taus
2026-02-24 16:11:56 +00:00
parent 156d2c09a0
commit 853df14468
2 changed files with 6 additions and 7 deletions

View File

@@ -12,12 +12,11 @@
*/
import python
private import LegacyPointsTo
import semmle.python.Metrics
from FunctionValue method
from FunctionMetrics method
where
exists(ClassValue c |
c.declaredAttribute("__del__") = method and
method.getScope().(FunctionMetricsWithPointsTo).getCyclomaticComplexity() > 3
)
method.getName() = "__del__" and
method.isMethod() and
method.getCyclomaticComplexity() > 3
select method, "Overly complex '__del__' method."

View File

@@ -1 +1 @@
| protocols.py:74:5:74:22 | Function MegaDel.__del__ | Overly complex '__del__' method. |
| protocols.py:74:5:74:22 | Function __del__ | Overly complex '__del__' method. |