зеркало из https://github.com/github/codeql.git
Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
This commit is contained in:
Родитель
91198524cd
Коммит
d804acdef7
|
@ -17,10 +17,10 @@ import semmle.python.dataflow.new.DataFlow
|
|||
|
||||
from DataFlow::CallCfgNode call_to_super, string name
|
||||
where
|
||||
call_to_super.getFunction().getALocalSource().asExpr().(Name).getId() = "super" and
|
||||
call_to_super = API::builtin("super").getACall() and
|
||||
name = call_to_super.getScope().getScope().(Class).getName() and
|
||||
exists(DataFlow::Node arg |
|
||||
arg = call_to_super.getArg(0) and
|
||||
not arg.getALocalSource().asExpr().(Name).getId() = name
|
||||
arg.getALocalSource().asExpr().(Name).getId() != name
|
||||
)
|
||||
select call_to_super.getNode(), "First argument to super() should be " + name + "."
|
||||
|
|
Загрузка…
Ссылка в новой задаче