File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
test/query-tests/Expressions/super Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 13
13
*/
14
14
15
15
import python
16
+ import semmle.python.dataflow.new.DataFlow
16
17
17
- from CallNode call_to_super , string name
18
+ from DataFlow :: CallCfgNode call_to_super , string name
18
19
where
19
- exists ( GlobalVariable gv , ControlFlowNode cn |
20
- call_to_super = ClassValue:: super_ ( ) .getACall ( ) and
21
- gv .getId ( ) = "super" and
22
- cn = call_to_super .getArg ( 0 ) and
23
- name = call_to_super .getScope ( ) .getScope ( ) .( Class ) .getName ( ) and
24
- exists ( ClassValue other |
25
- cn .pointsTo ( other ) and
26
- not other .getScope ( ) .getName ( ) = name
27
- )
20
+ call_to_super .getFunction ( ) .getALocalSource ( ) .asExpr ( ) .( Name ) .getId ( ) = "super" and
21
+ name = call_to_super .getScope ( ) .getScope ( ) .( Class ) .getName ( ) and
22
+ exists ( DataFlow:: Node arg |
23
+ arg = call_to_super .getArg ( 0 ) and
24
+ not arg .getALocalSource ( ) .asExpr ( ) .( Name ) .getId ( ) = name
28
25
)
29
26
select call_to_super .getNode ( ) , "First argument to super() should be " + name + "."
Original file line number Diff line number Diff line change 1
- | test.py:10:9:10:27 | super() | First argument to super() should be NotMyDict. |
1
+ | test.py:10:9:10:27 | ControlFlowNode for super() | First argument to super() should be NotMyDict. |
You can’t perform that action at this time.
0 commit comments