mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Adds preliminary modernization
This will overlapp with/depend on changes to CallArgs and ObjectAPI that are already in the WrongNamedArgumentInCall PR
This commit is contained in:
@@ -14,15 +14,15 @@
|
||||
import python
|
||||
import CallArgs
|
||||
|
||||
from Call call, FunctionObject func, string too, string should, int limit
|
||||
from Call call, FunctionValue func, string too, string should, int limit
|
||||
where
|
||||
(
|
||||
too_many_args_objectapi(call, func, limit) and too = "too many arguments" and should = "no more than "
|
||||
too_many_args(call, func, limit) and too = "too many arguments" and should = "no more than "
|
||||
or
|
||||
too_few_args_objectapi(call, func, limit) and too = "too few arguments" and should = "no fewer than "
|
||||
too_few_args(call, func, limit) and too = "too few arguments" and should = "no fewer than "
|
||||
) and
|
||||
not func.isAbstract() and
|
||||
not exists(FunctionObject overridden | func.overrides(overridden) and correct_args_if_called_as_method_objectapi(call, overridden))
|
||||
not exists(FunctionValue overridden | func.overrides(overridden) and correct_args_if_called_as_method(call, overridden))
|
||||
/* The semantics of `__new__` can be a bit subtle, so we simply exclude `__new__` methods */
|
||||
and not func.getName() = "__new__"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user