File tree Expand file tree Collapse file tree
test/query-tests/Expressions/super Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 */
1414
1515import python
16+ import semmle.python.dataflow.new.DataFlow
1617
17- from CallNode call_to_super , string name
18+ from DataFlow :: CallCfgNode call_to_super , string name
1819where
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
2825 )
2926select 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