mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Swaps too_many_args globally
This commit is contained in:
@@ -18,7 +18,7 @@ import Expressions.CallArgs
|
||||
from Call call, ClassObject cls, string too, string should, int limit, FunctionObject init
|
||||
where
|
||||
(
|
||||
too_many_args(call, cls, limit) and too = "too many arguments" and should = "no more than "
|
||||
too_many_args_objectapi(call, cls, limit) and too = "too many arguments" and should = "no more than "
|
||||
or
|
||||
too_few_args_objectapi(call, cls, limit) and too = "too few arguments" and should = "no fewer than "
|
||||
) and init = get_function_or_initializer_objectapi(cls)
|
||||
|
||||
@@ -89,7 +89,7 @@ predicate too_few_args_objectapi(Call call, Object callable, int limit) {
|
||||
}
|
||||
|
||||
/**Whether there are too many arguments in the `call` to `func` where `limit` is the highest number of legal arguments */
|
||||
predicate too_many_args(Call call, Object callable, int limit) {
|
||||
predicate too_many_args_objectapi(Call call, Object callable, int limit) {
|
||||
// Exclude cases where an incorrect name is used as that is covered by 'Wrong name for an argument in a call'
|
||||
not illegally_named_parameter_objectapi(call, callable, _) and
|
||||
exists(FunctionObject func |
|
||||
@@ -110,7 +110,7 @@ predicate too_many_args(Call call, Object callable, int limit) {
|
||||
predicate wrong_args(Call call, FunctionObject func, int limit, string too) {
|
||||
too_few_args_objectapi(call, func, limit) and too = "too few"
|
||||
or
|
||||
too_many_args(call, func, limit) and too = "too many"
|
||||
too_many_args_objectapi(call, func, limit) and too = "too many"
|
||||
}
|
||||
|
||||
/** Holds if `call` has correct number of arguments for `func`.
|
||||
|
||||
@@ -17,7 +17,7 @@ import CallArgs
|
||||
from Call call, FunctionObject func, string too, string should, int limit
|
||||
where
|
||||
(
|
||||
too_many_args(call, func, limit) and too = "too many arguments" and should = "no more than "
|
||||
too_many_args_objectapi(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 "
|
||||
) and
|
||||
|
||||
Reference in New Issue
Block a user