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

Skip to content

Commit 582ef6c

Browse files
committed
Python: Restructure logic in Twisted.qll
1 parent 9942c3f commit 582ef6c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

python/ql/src/semmle/python/web/twisted/Twisted.qll

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,16 @@ predicate isTwistedRequestInstance(NameNode node) {
3535
* class, and the appropriate arguments of known request handler methods.
3636
*/
3737

38-
exists(Function func | func = node.getScope() |
38+
exists(Function func |
39+
func = node.getScope() and
3940
func.getEnclosingScope() = aTwistedRequestHandlerClass().getScope()
40-
) and
41-
(
41+
|
4242
/* Any parameter called `request` */
4343
node.getId() = "request" and
4444
node.isParameter()
4545
or
4646
/* Any request parameter of a known request handler method */
47-
exists(Function func | node.getScope() = func |
48-
isKnownRequestHandlerMethodName(func.getName()) and
49-
node.getNode() = func.getArg(1)
50-
)
47+
isKnownRequestHandlerMethodName(func.getName()) and
48+
node.getNode() = func.getArg(1)
5149
)
5250
}

0 commit comments

Comments
 (0)