File tree Expand file tree Collapse file tree 7 files changed +20
-16
lines changed
python/ql/lib/semmle/python/frameworks Expand file tree Collapse file tree 7 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,9 @@ module AiohttpWebModel {
243243
244244 /** A class that has a super-type which is an aiohttp.web View class. */
245245 class AiohttpViewClassFromSuperClass extends AiohttpViewClass {
246- AiohttpViewClassFromSuperClass ( ) { this .getABase ( ) = View:: subclassRef ( ) .getAUse ( ) .asExpr ( ) }
246+ AiohttpViewClassFromSuperClass ( ) {
247+ this .getParent ( ) = View:: subclassRef ( ) .getAnImmediateUse ( ) .asExpr ( )
248+ }
247249 }
248250
249251 /** A class that is used in a route-setup, therefore being considered an aiohttp.web View class. */
Original file line number Diff line number Diff line change @@ -829,7 +829,7 @@ module PrivateDjango {
829829
830830 /** Gets the (AST) class of the Django model class `modelClass`. */
831831 Class getModelClassClass ( API:: Node modelClass ) {
832- result .getParent ( ) = modelClass .getAUse ( ) .asExpr ( ) . ( ClassExpr ) and
832+ result .getParent ( ) = modelClass .getAnImmediateUse ( ) .asExpr ( ) and
833833 modelClass = Model:: subclassRef ( )
834834 }
835835
@@ -2162,7 +2162,9 @@ module PrivateDjango {
21622162 * thereby handling user input.
21632163 */
21642164 class DjangoFormClass extends Class , SelfRefMixin {
2165- DjangoFormClass ( ) { this .getABase ( ) = Django:: Forms:: Form:: subclassRef ( ) .getAUse ( ) .asExpr ( ) }
2165+ DjangoFormClass ( ) {
2166+ this .getParent ( ) = Django:: Forms:: Form:: subclassRef ( ) .getAnImmediateUse ( ) .asExpr ( )
2167+ }
21662168 }
21672169
21682170 /**
@@ -2195,7 +2197,7 @@ module PrivateDjango {
21952197 */
21962198 class DjangoFormFieldClass extends Class {
21972199 DjangoFormFieldClass ( ) {
2198- this .getABase ( ) = Django:: Forms:: Field:: subclassRef ( ) .getAUse ( ) .asExpr ( )
2200+ this .getParent ( ) = Django:: Forms:: Field:: subclassRef ( ) .getAnImmediateUse ( ) .asExpr ( )
21992201 }
22002202 }
22012203
@@ -2298,7 +2300,7 @@ module PrivateDjango {
22982300 */
22992301 class DjangoViewClassFromSuperClass extends DjangoViewClass {
23002302 DjangoViewClassFromSuperClass ( ) {
2301- this .getABase ( ) = Django:: Views:: View:: subclassRef ( ) .getAUse ( ) .asExpr ( )
2303+ this .getParent ( ) = Django:: Views:: View:: subclassRef ( ) .getAnImmediateUse ( ) .asExpr ( )
23022304 }
23032305 }
23042306
Original file line number Diff line number Diff line change @@ -194,8 +194,8 @@ module Flask {
194194 API:: Node api_node ;
195195
196196 FlaskViewClass ( ) {
197- this . getABase ( ) = Views:: View:: subclassRef ( ) . getAUse ( ) . 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 . getABase ( ) = Views:: MethodView:: subclassRef ( ) . getAUse ( ) . 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 ( ) {
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ private module RestFramework {
115115 */
116116 class RestFrameworkApiViewClass extends PrivateDjango:: DjangoViewClassFromSuperClass {
117117 RestFrameworkApiViewClass ( ) {
118- this .getABase ( ) = any ( ModeledApiViewClasses c ) .getASubclass * ( ) .getAUse ( ) .asExpr ( )
118+ this .getParent ( ) = any ( ModeledApiViewClasses c ) .getASubclass * ( ) .getAnImmediateUse ( ) .asExpr ( )
119119 }
120120
121121 override Function getARequestHandler ( ) {
Original file line number Diff line number Diff line change @@ -1934,7 +1934,7 @@ private module StdlibPrivate {
19341934
19351935 /** A HttpRequestHandler class definition (most likely in project code). */
19361936 class HttpRequestHandlerClassDef extends Class {
1937- HttpRequestHandlerClassDef ( ) { this .getParent ( ) = subclassRef ( ) .getAUse ( ) .asExpr ( ) }
1937+ HttpRequestHandlerClassDef ( ) { this .getParent ( ) = subclassRef ( ) .getAnImmediateUse ( ) .asExpr ( ) }
19381938 }
19391939
19401940 /** DEPRECATED: Alias for HttpRequestHandlerClassDef */
@@ -2027,12 +2027,12 @@ private module StdlibPrivate {
20272027 private module WsgirefSimpleServer {
20282028 class WsgiServerSubclass extends Class , SelfRefMixin {
20292029 WsgiServerSubclass ( ) {
2030- this .getABase ( ) =
2030+ this .getParent ( ) =
20312031 API:: moduleImport ( "wsgiref" )
20322032 .getMember ( "simple_server" )
20332033 .getMember ( "WSGIServer" )
20342034 .getASubclass * ( )
2035- .getAUse ( )
2035+ .getAnImmediateUse ( )
20362036 .asExpr ( )
20372037 }
20382038 }
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ private module Tornado {
9292
9393 /** A RequestHandler class (most likely in project code). */
9494 class RequestHandlerClass extends Class {
95- RequestHandlerClass ( ) { this .getParent ( ) = subclassRef ( ) .getAUse ( ) .asExpr ( ) }
95+ RequestHandlerClass ( ) { this .getParent ( ) = subclassRef ( ) .getAnImmediateUse ( ) .asExpr ( ) }
9696
9797 /** Gets a function that could handle incoming requests, if any. */
9898 Function getARequestHandler ( ) {
Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ private module Twisted {
2727 */
2828 class TwistedResourceSubclass extends Class {
2929 TwistedResourceSubclass ( ) {
30- this .getABase ( ) =
30+ this .getParent ( ) =
3131 API:: moduleImport ( "twisted" )
3232 .getMember ( "web" )
3333 .getMember ( "resource" )
3434 .getMember ( "Resource" )
3535 .getASubclass * ( )
36- .getAUse ( )
36+ .getAnImmediateUse ( )
3737 .asExpr ( )
3838 }
3939
You can’t perform that action at this time.
0 commit comments