Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63a09fc

Browse files
committed
Python: Use this = <...>.getACall() for DataFlow::CallCfgNode
I think this reads a bit cleaner
1 parent ce1d8de commit 63a09fc

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • python/ql/src/semmle/python/frameworks

python/ql/src/semmle/python/frameworks/Flask.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ private module FlaskModel {
254254
*/
255255
private class FlaskAppRouteCall extends FlaskRouteSetup, DataFlow::CallCfgNode {
256256
FlaskAppRouteCall() {
257-
this.getFunction() = flask::Flask::route().getAUse()
257+
this = flask::Flask::route().getACall()
258258
or
259-
this.getFunction() = flask::Blueprint::route().getAUse()
259+
this = flask::Blueprint::route().getACall()
260260
}
261261

262262
override DataFlow::Node getUrlPatternArg() {
@@ -273,9 +273,9 @@ private module FlaskModel {
273273
*/
274274
private class FlaskAppAddUrlRuleCall extends FlaskRouteSetup, DataFlow::CallCfgNode {
275275
FlaskAppAddUrlRuleCall() {
276-
this.getFunction() = flask::Flask::add_url_rule().getAUse()
276+
this = flask::Flask::add_url_rule().getACall()
277277
or
278-
this.getFunction() = flask::Blueprint::add_url_rule().getAUse()
278+
this = flask::Blueprint::add_url_rule().getACall()
279279
}
280280

281281
override DataFlow::Node getUrlPatternArg() {
@@ -428,9 +428,9 @@ private module FlaskModel {
428428
private class FlaskMakeResponseCall extends HTTP::Server::HttpResponse::Range,
429429
DataFlow::CallCfgNode {
430430
FlaskMakeResponseCall() {
431-
this.getFunction() = flask::make_response().getAUse()
431+
this = flask::make_response().getACall()
432432
or
433-
this.getFunction() = flask::Flask::make_response_().getAUse()
433+
this = flask::Flask::make_response_().getACall()
434434
}
435435

436436
override DataFlow::Node getBody() { result = this.getArg(0) }
@@ -462,7 +462,7 @@ private module FlaskModel {
462462
*/
463463
private class FlaskRedirectCall extends HTTP::Server::HttpRedirectResponse::Range,
464464
DataFlow::CallCfgNode {
465-
FlaskRedirectCall() { this.getFunction() = flask_attr("redirect").getAUse() }
465+
FlaskRedirectCall() { this = flask_attr("redirect").getACall() }
466466

467467
override DataFlow::Node getRedirectLocation() {
468468
result in [this.getArg(0), this.getArgByName("location")]

0 commit comments

Comments
 (0)