From 63a09fccdd6764fb5f0fd8b8cdbaae5ddf443bca Mon Sep 17 00:00:00 2001 From: Rasmus Wriedt Larsen Date: Wed, 17 Feb 2021 14:43:48 +0100 Subject: [PATCH] Python: Use this = <...>.getACall() for DataFlow::CallCfgNode I think this reads a bit cleaner --- python/ql/src/semmle/python/frameworks/Flask.qll | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/ql/src/semmle/python/frameworks/Flask.qll b/python/ql/src/semmle/python/frameworks/Flask.qll index 3c271c3f913..fefceace56d 100644 --- a/python/ql/src/semmle/python/frameworks/Flask.qll +++ b/python/ql/src/semmle/python/frameworks/Flask.qll @@ -254,9 +254,9 @@ private module FlaskModel { */ private class FlaskAppRouteCall extends FlaskRouteSetup, DataFlow::CallCfgNode { FlaskAppRouteCall() { - this.getFunction() = flask::Flask::route().getAUse() + this = flask::Flask::route().getACall() or - this.getFunction() = flask::Blueprint::route().getAUse() + this = flask::Blueprint::route().getACall() } override DataFlow::Node getUrlPatternArg() { @@ -273,9 +273,9 @@ private module FlaskModel { */ private class FlaskAppAddUrlRuleCall extends FlaskRouteSetup, DataFlow::CallCfgNode { FlaskAppAddUrlRuleCall() { - this.getFunction() = flask::Flask::add_url_rule().getAUse() + this = flask::Flask::add_url_rule().getACall() or - this.getFunction() = flask::Blueprint::add_url_rule().getAUse() + this = flask::Blueprint::add_url_rule().getACall() } override DataFlow::Node getUrlPatternArg() { @@ -428,9 +428,9 @@ private module FlaskModel { private class FlaskMakeResponseCall extends HTTP::Server::HttpResponse::Range, DataFlow::CallCfgNode { FlaskMakeResponseCall() { - this.getFunction() = flask::make_response().getAUse() + this = flask::make_response().getACall() or - this.getFunction() = flask::Flask::make_response_().getAUse() + this = flask::Flask::make_response_().getACall() } override DataFlow::Node getBody() { result = this.getArg(0) } @@ -462,7 +462,7 @@ private module FlaskModel { */ private class FlaskRedirectCall extends HTTP::Server::HttpRedirectResponse::Range, DataFlow::CallCfgNode { - FlaskRedirectCall() { this.getFunction() = flask_attr("redirect").getAUse() } + FlaskRedirectCall() { this = flask_attr("redirect").getACall() } override DataFlow::Node getRedirectLocation() { result in [this.getArg(0), this.getArgByName("location")]