change getNumArgument to only count positional arguments

This commit is contained in:
Erik Krogh Kristensen
2022-05-19 21:03:59 +02:00
parent a5b11e88b4
commit 204e01fc24
3 changed files with 5 additions and 4 deletions

View File

@@ -356,7 +356,7 @@ module API {
}
/** Gets the number of arguments of this call. Both positional and named arguments are counted. */
int getNumArgument() { result = count([this.getArg(_), this.getArgByName(_)]) }
int getNumArgument() { result = count(this.getArg(_)) }
}
/**

View File

@@ -47,7 +47,8 @@ isSink
| test.py:86:8:86:60 | ControlFlowNode for Attribute() | test-sink |
| test.py:87:8:87:67 | ControlFlowNode for Attribute() | test-sink |
| test.py:89:21:89:23 | ControlFlowNode for one | test-sink |
| test.py:90:25:90:27 | ControlFlowNode for one | test-sink |
| test.py:91:21:91:23 | ControlFlowNode for one | test-sink |
| test.py:91:30:91:32 | ControlFlowNode for two | test-sink |
| test.py:98:6:98:9 | ControlFlowNode for baz2 | test-sink |
isSource
| test.py:3:5:3:15 | ControlFlowNode for getSource() | test-source |

View File

@@ -87,8 +87,8 @@ mySink(Steps.preserveAllButFirstArgument("foo", getSource())) # FLOW
mySink(Steps.preserveAllButFirstArgument("foo", "bar", getSource())) # FLOW
CallFilter.arityOne(one) # match
CallFilter.arityOne(one=one) # match
CallFilter.arityOne(one, two=two) # NO match
CallFilter.arityOne(one=one) # NO match
CallFilter.arityOne(one, two=two) # match - on both the named and positional arguments
CallFilter.arityOne(one=one, two=two) # NO match
from foo1.bar import baz1