mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
Python: ObjectAPI to ValueAPI: OverlyComplexDelMethod: Adds preliminary modernization
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user