Skip to content

Commit 3b0be46

Browse files
committed
Swaps too_few_args globally
1 parent 2c32a85 commit 3b0be46

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

python/ql/src/Classes/WrongNumberArgumentsInClassInstantiation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ where
2020
(
2121
too_many_args(call, cls, limit) and too = "too many arguments" and should = "no more than "
2222
or
23-
too_few_args(call, cls, limit) and too = "too few arguments" and should = "no fewer than "
23+
too_few_args_objectapi(call, cls, limit) and too = "too few arguments" and should = "no fewer than "
2424
) and init = get_function_or_initializer_objectapi(cls)
2525
select call, "Call to $@ with " + too + "; should be " + should + limit.toString() + ".", init, init.getQualifiedName()

python/ql/src/Expressions/CallArgs.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ predicate illegally_named_parameter_objectapi(Call call, Object func, string nam
6868
}
6969

7070
/**Whether there are too few arguments in the `call` to `callable` where `limit` is the lowest number of legal arguments */
71-
predicate too_few_args(Call call, Object callable, int limit) {
71+
predicate too_few_args_objectapi(Call call, Object callable, int limit) {
7272
// Exclude cases where an incorrect name is used as that is covered by 'Wrong name for an argument in a call'
7373
not illegally_named_parameter_objectapi(call, callable, _) and
7474
not exists(call.getStarargs()) and not exists(call.getKwargs()) and
@@ -108,7 +108,7 @@ predicate too_many_args(Call call, Object callable, int limit) {
108108

109109
/** Holds if `call` has too many or too few arguments for `func` */
110110
predicate wrong_args(Call call, FunctionObject func, int limit, string too) {
111-
too_few_args(call, func, limit) and too = "too few"
111+
too_few_args_objectapi(call, func, limit) and too = "too few"
112112
or
113113
too_many_args(call, func, limit) and too = "too many"
114114
}

python/ql/src/Expressions/WrongNumberArgumentsInCall.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ where
1919
(
2020
too_many_args(call, func, limit) and too = "too many arguments" and should = "no more than "
2121
or
22-
too_few_args(call, func, limit) and too = "too few arguments" and should = "no fewer than "
22+
too_few_args_objectapi(call, func, limit) and too = "too few arguments" and should = "no fewer than "
2323
) and
2424
not func.isAbstract() and
2525
not exists(FunctionObject overridden | func.overrides(overridden) and correct_args_if_called_as_method(call, overridden))

0 commit comments

Comments
 (0)