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

Skip to content

Commit 141e266

Browse files
committed
Python: Align ViewClass naming with django
Just as part of tyding up
1 parent 19b7ea8 commit 141e266

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ private module FlaskModel {
164164
// routing modeling
165165
// ---------------------------------------------------------------------------
166166
/** A flask View class defined in project code. */
167-
class FlaskViewClassDef extends Class {
167+
class FlaskViewClass extends Class {
168168
API::Node api_node;
169169

170-
FlaskViewClassDef() {
170+
FlaskViewClass() {
171171
this.getABase() = Views::View::subclassRef().getAUse().asExpr() and
172172
api_node.getAnImmediateUse().asExpr().(ClassExpr) = this.getParent()
173173
}
@@ -184,8 +184,8 @@ private module FlaskModel {
184184
API::Node asViewResult() { result = api_node.getMember("as_view").getReturn() }
185185
}
186186

187-
class FlaskMethodViewClassDef extends FlaskViewClassDef {
188-
FlaskMethodViewClassDef() {
187+
class FlaskMethodViewClass extends FlaskViewClass {
188+
FlaskMethodViewClass() {
189189
this.getABase() = Views::MethodView::subclassRef().getAUse().asExpr() and
190190
api_node.getAnImmediateUse().asExpr().(ClassExpr) = this.getParent()
191191
}
@@ -271,7 +271,7 @@ private module FlaskModel {
271271
func_src.asExpr().(CallableExpr) = result.getDefinition()
272272
)
273273
or
274-
exists(FlaskViewClassDef vc |
274+
exists(FlaskViewClass vc |
275275
getViewArg() = vc.asViewResult().getAUse() and
276276
result = vc.getARequestHandler()
277277
)
@@ -281,7 +281,7 @@ private module FlaskModel {
281281
/** A request handler defined in a django view class, that has no known route. */
282282
private class FlaskViewClassHandlerWithoutKnownRoute extends HTTP::Server::RequestHandler::Range {
283283
FlaskViewClassHandlerWithoutKnownRoute() {
284-
exists(FlaskViewClassDef vc | vc.getARequestHandler() = this) and
284+
exists(FlaskViewClass vc | vc.getARequestHandler() = this) and
285285
not exists(FlaskRouteSetup setup | setup.getARequestHandler() = this)
286286
}
287287

0 commit comments

Comments
 (0)