Python: Test for parameters without nodes.

This commit is contained in:
Rasmus Lerchedahl Petersen
2021-01-26 11:28:31 +01:00
parent 7b9ca7171a
commit 2c58643fd1
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1 @@
| test.py:239:27:239:27 | Parameter | There is no `ParameterNode` associated with this parameter. |

View File

@@ -0,0 +1,7 @@
import python
import semmle.python.dataflow.new.DataFlow
query predicate parameterWithoutNode(Parameter p, string msg) {
not exists(DataFlow::ParameterNode node | p = node.getParameter()) and
msg = "There is no `ParameterNode` associated with this parameter."
}