Skip to content

Commit 2c58643

Browse files
committed
Python: Test for parameters without nodes.
1 parent 7b9ca71 commit 2c58643

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| test.py:239:27:239:27 | Parameter | There is no `ParameterNode` associated with this parameter. |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import python
2+
import semmle.python.dataflow.new.DataFlow
3+
4+
query predicate parameterWithoutNode(Parameter p, string msg) {
5+
not exists(DataFlow::ParameterNode node | p = node.getParameter()) and
6+
msg = "There is no `ParameterNode` associated with this parameter."
7+
}

0 commit comments

Comments
 (0)