Skip to content

Commit 9f01ea6

Browse files
committed
Python: Add type-tracking consistency query
For now I'm only ignoring stdlib nodes, so it's easy for reviewer to see why we need to have more excludes :)
1 parent 664dac6 commit 9f01ea6

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
private import python
2+
private import semmle.python.dataflow.new.DataFlow
3+
private import semmle.python.dataflow.new.internal.DataFlowPrivate as DataFlowPrivate
4+
private import semmle.python.dataflow.new.internal.TypeTrackingImpl
5+
6+
private module ConsistencyChecksInput implements ConsistencyChecksInputSig {
7+
predicate unreachableNodeExclude(DataFlow::Node n) {
8+
not exists(n.getLocation().getFile().getRelativePath())
9+
}
10+
}
11+
12+
import ConsistencyChecks<ConsistencyChecksInput>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
unreachableNode
2+
| attribute_tests.py:6:5:6:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
3+
| attribute_tests.py:12:9:12:9 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
4+
| attribute_tests.py:13:5:13:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
5+
| attribute_tests.py:28:5:28:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
6+
| attribute_tests.py:29:17:29:17 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
7+
| attribute_tests.py:30:5:30:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
8+
| attribute_tests.py:39:13:39:13 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
9+
| attribute_tests.py:45:5:45:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
10+
| attribute_tests.py:77:10:77:16 | [post] ControlFlowNode for MyClass | Unreachable node in step of kind simpleLocalSmallStep. |
11+
| attribute_tests.py:89:13:89:13 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
12+
| attribute_tests.py:95:5:95:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
13+
| attribute_tests.py:102:13:102:13 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
14+
| attribute_tests.py:109:5:109:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
15+
| attribute_tests.py:117:5:117:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
16+
| attribute_tests.py:123:5:123:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
17+
| attribute_tests.py:130:5:130:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
18+
| attribute_tests.py:137:5:137:5 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
19+
| attribute_tests.py:150:18:150:21 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
20+
| attribute_tests.py:153:19:153:22 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
21+
| attribute_tests.py:156:34:156:37 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
22+
| attribute_tests.py:159:12:159:21 | [pre] ControlFlowNode for MyClass2() | Unreachable node in step of kind call. |
23+
| attribute_tests.py:160:7:160:14 | [post] ControlFlowNode for instance | Unreachable node in step of kind simpleLocalSmallStep. |
24+
| attribute_tests.py:167:20:167:23 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
25+
| attribute_tests.py:170:19:170:22 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
26+
| attribute_tests.py:173:34:173:37 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
27+
| attribute_tests.py:177:1:177:8 | [post] ControlFlowNode for instance | Unreachable node in step of kind simpleLocalSmallStep. |
28+
| attribute_tests.py:178:1:178:8 | [post] ControlFlowNode for instance | Unreachable node in step of kind simpleLocalSmallStep. |
29+
| test.py:54:5:54:12 | [post] ControlFlowNode for mymodule | Unreachable node in step of kind simpleLocalSmallStep. |
30+
| test.py:55:9:55:16 | [post] ControlFlowNode for mymodule | Unreachable node in step of kind simpleLocalSmallStep. |
31+
| test.py:72:15:72:15 | [post] ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
32+
| test.py:74:13:74:17 | [post] ControlFlowNode for print | Unreachable node in step of kind simpleLocalSmallStep. |
33+
| test.py:92:9:92:13 | [post] ControlFlowNode for print | Unreachable node in step of kind simpleLocalSmallStep. |
34+
| test.py:98:2:98:13 | [post] ControlFlowNode for my_decorator | Unreachable node in step of kind simpleLocalSmallStep. |
35+
| test.py:130:15:130:18 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
36+
| test.py:133:15:133:18 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
37+
| test.py:136:15:136:18 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
38+
| test.py:142:15:142:18 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
39+
| test.py:145:15:145:18 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
40+
| test.py:148:15:148:18 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
41+
| test.py:151:20:151:23 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
42+
| test.py:152:9:152:12 | [post] ControlFlowNode for self | Unreachable node in step of kind simpleLocalSmallStep. |
43+
| test.py:153:9:153:13 | [post] ControlFlowNode for super | Unreachable node in step of kind simpleLocalSmallStep. |
44+
| test.py:162:5:162:7 | [post] ControlFlowNode for foo | Unreachable node in step of kind simpleLocalSmallStep. |
45+
| test.py:163:9:163:11 | [post] ControlFlowNode for foo | Unreachable node in step of kind simpleLocalSmallStep. |
46+
| test.py:179:14:179:24 | [post] ControlFlowNode for get_tracked | Unreachable node in step of kind simpleLocalSmallStep. |
47+
| test.py:181:1:181:5 | [post] ControlFlowNode for print | Unreachable node in step of kind simpleLocalSmallStep. |
48+
| test.py:188:9:188:13 | [post] ControlFlowNode for print | Unreachable node in step of kind simpleLocalSmallStep. |
49+
| test.py:192:9:192:13 | [post] ControlFlowNode for print | Unreachable node in step of kind simpleLocalSmallStep. |
50+
| test.py:208:14:208:30 | [post] ControlFlowNode for yielding_function | Unreachable node in step of kind simpleLocalSmallStep. |

0 commit comments

Comments
 (0)