Skip to content

Commit c52e453

Browse files
committed
Python: Minor rewrite
1 parent b7b9120 commit c52e453

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,8 @@ private module FastApi {
161161
or
162162
// user-defined subclasses
163163
exists(Class cls, API::Node base |
164+
base = getModeledResponseClass(_).getASubclass*() and
164165
cls.getABase() = base.getAUse().asExpr() and
165-
// since we _know_ that the base has an API Node, that means there is a subclass
166-
// edge leading to the `ClassExpr` for the class.
167166
responseClass.getAnImmediateUse().asExpr().(ClassExpr) = cls.getParent()
168167
|
169168
exists(Assign assign | assign = cls.getAStmt() |

0 commit comments

Comments
 (0)