mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Python: Allow same function name in call-graph tests
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
failures
|
||||
debug_callableNotUnique
|
||||
| code/class_properties.py:10:5:10:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
| code/class_properties.py:15:5:15:25 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
| code/class_properties.py:20:5:20:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
pointsTo_found_typeTracker_notFound
|
||||
| code/class_attr_assign.py:10:9:10:27 | ControlFlowNode for Attribute() | my_func |
|
||||
| code/class_attr_assign.py:11:9:11:25 | ControlFlowNode for Attribute() | my_func |
|
||||
|
||||
@@ -76,7 +76,13 @@ bindingset[func]
|
||||
string betterQualName(Function func) {
|
||||
// note: `target.getQualifiedName` for Lambdas is just "lambda", so is not very useful :|
|
||||
not func.isLambda() and
|
||||
result = func.getQualifiedName()
|
||||
if
|
||||
strictcount(Function f |
|
||||
f.getEnclosingModule() = func.getEnclosingModule() and
|
||||
f.getQualifiedName() = func.getQualifiedName()
|
||||
) = 1
|
||||
then result = func.getQualifiedName()
|
||||
else result = func.getLocation().getStartLine() + ":" + func.getQualifiedName()
|
||||
or
|
||||
func.isLambda() and
|
||||
result =
|
||||
@@ -88,7 +94,7 @@ query predicate debug_callableNotUnique(Function callable, string message) {
|
||||
exists(callable.getLocation().getFile().getRelativePath()) and
|
||||
exists(Function f |
|
||||
f != callable and
|
||||
f.getQualifiedName() = callable.getQualifiedName() and
|
||||
betterQualName(f) = betterQualName(callable) and
|
||||
f.getLocation().getFile() = callable.getLocation().getFile()
|
||||
) and
|
||||
message =
|
||||
|
||||
Reference in New Issue
Block a user