mirror of
https://github.com/github/codeql.git
synced 2026-05-14 19:29:28 +02:00
Python: Port OverlyComplexDelMethod.ql
Only trivial test changes.
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -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. |
|
||||
|
||||
Reference in New Issue
Block a user