Python: ObjectAPI to ValueAPI: OverlyComplexDelMethod: Adds preliminary modernization

This commit is contained in:
Rebecca Valentine
2020-04-07 21:31:35 -07:00
parent a0992aac93
commit c2443f2342
2 changed files with 4 additions and 4 deletions

View File

@@ -15,10 +15,10 @@
import python
from FunctionObject method
from FunctionValue method
where
exists(ClassObject c |
exists(ClassValue c |
c.declaredAttribute("__del__") = method and
method.getFunction().getMetrics().getCyclomaticComplexity() > 3
method.getScope().getMetrics().getCyclomaticComplexity() > 3
)
select method, "Overly complex '__del__' method."

View File

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