Skip to content

Commit 38a9c71

Browse files
erik-kroghasgerf
andcommitted
Apply suggestions from code review
Co-authored-by: Asger F <[email protected]>
1 parent b2d6982 commit 38a9c71

File tree

1 file changed

+8
-8
lines changed
  • javascript/ql/src/semmle/javascript/frameworks

1 file changed

+8
-8
lines changed

javascript/ql/src/semmle/javascript/frameworks/Koa.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ module Koa {
7272
}
7373

7474
/**
75-
* Gets the dataflow node that is given to a `RouteSetup` to register the handler.
75+
* Gets a dataflow node that can be given to a `RouteSetup` to register the handler.
7676
*/
77-
abstract DataFlow::SourceNode getRouteHandlerRegistration();
77+
abstract DataFlow::SourceNode getARouteHandlerRegistrationObject();
7878
}
7979

8080
/**
@@ -91,7 +91,7 @@ module Koa {
9191
private class StandardRouteHandler extends RouteHandler {
9292
StandardRouteHandler() { any(RouteSetup setup).getARouteHandler() = this }
9393

94-
override DataFlow::SourceNode getRouteHandlerRegistration() { result = this }
94+
override DataFlow::SourceNode getARouteHandlerRegistrationObject() { result = this }
9595
}
9696

9797
/**
@@ -136,7 +136,7 @@ module Koa {
136136
* app.use(router.routes());
137137
* ```
138138
*/
139-
private class RoutedRouteHandler extends RouteHandler, DataFlow::SourceNode {
139+
private class RoutedRouteHandler extends RouteHandler {
140140
DataFlow::InvokeNode router;
141141
DataFlow::MethodCallNode call;
142142

@@ -151,7 +151,7 @@ module Koa {
151151
this.flowsTo(call.getArgument(any(int i | i >= 1)))
152152
}
153153

154-
override DataFlow::SourceNode getRouteHandlerRegistration() {
154+
override DataFlow::SourceNode getARouteHandlerRegistrationObject() {
155155
result = call
156156
or
157157
result = router.getAMethodCall("routes")
@@ -171,7 +171,7 @@ module Koa {
171171
* // route handler stuff
172172
* }));
173173
*/
174-
class KoaRouteHandler extends RouteHandler, DataFlow::SourceNode {
174+
class KoaRouteHandler extends RouteHandler {
175175
DataFlow::CallNode call;
176176

177177
KoaRouteHandler() {
@@ -190,7 +190,7 @@ module Koa {
190190
result = call.getABoundCallbackParameter(1, any(int i | i >= 1))
191191
}
192192

193-
override DataFlow::SourceNode getRouteHandlerRegistration() { result = call }
193+
override DataFlow::SourceNode getARouteHandlerRegistrationObject() { result = call }
194194
}
195195

196196
/**
@@ -390,7 +390,7 @@ module Koa {
390390
result.flowsToExpr(getArgument(0))
391391
or
392392
// For the route-handlers that does not depend on this predicate in their charpred.
393-
result.(RouteHandler).getRouteHandlerRegistration().flowsToExpr(getArgument(0))
393+
result.(RouteHandler).getARouteHandlerRegistrationObject().flowsToExpr(getArgument(0))
394394
}
395395

396396
override Expr getServer() { result = server }

0 commit comments

Comments
 (0)