Skip to content

Commit 853df14

Browse files
committed
Python: Port OverlyComplexDelMethod.ql
Only trivial test changes.
1 parent 156d2c0 commit 853df14

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

python/ql/src/Functions/OverlyComplexDelMethod.ql

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
*/
1313

1414
import python
15-
private import LegacyPointsTo
15+
import semmle.python.Metrics
1616

17-
from FunctionValue method
17+
from FunctionMetrics method
1818
where
19-
exists(ClassValue c |
20-
c.declaredAttribute("__del__") = method and
21-
method.getScope().(FunctionMetricsWithPointsTo).getCyclomaticComplexity() > 3
22-
)
19+
method.getName() = "__del__" and
20+
method.isMethod() and
21+
method.getCyclomaticComplexity() > 3
2322
select method, "Overly complex '__del__' method."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| protocols.py:74:5:74:22 | Function MegaDel.__del__ | Overly complex '__del__' method. |
1+
| protocols.py:74:5:74:22 | Function __del__ | Overly complex '__del__' method. |

0 commit comments

Comments
 (0)