Skip to content

Commit f8f4142

Browse files
committed
Python: Minor refactor for FlaskViewClass
1 parent 1c2323e commit f8f4142

File tree

1 file changed

+4
-4
lines changed
  • python/ql/lib/semmle/python/frameworks

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ module Flask {
194194
API::Node api_node;
195195

196196
FlaskViewClass() {
197-
this.getParent() = Views::View::subclassRef().getAnImmediateUse().asExpr() and
198-
api_node.getAnImmediateUse().asExpr() = this.getParent()
197+
api_node = Views::View::subclassRef() and
198+
this.getParent() = api_node.getAnImmediateUse().asExpr()
199199
}
200200

201201
/** Gets a function that could handle incoming requests, if any. */
@@ -219,8 +219,8 @@ module Flask {
219219
*/
220220
class FlaskMethodViewClass extends FlaskViewClass {
221221
FlaskMethodViewClass() {
222-
this.getParent() = Views::MethodView::subclassRef().getAnImmediateUse().asExpr() and
223-
api_node.getAnImmediateUse().asExpr() = this.getParent()
222+
api_node = Views::MethodView::subclassRef() and
223+
this.getParent() = api_node.getAnImmediateUse().asExpr()
224224
}
225225

226226
override Function getARequestHandler() {

0 commit comments

Comments
 (0)