Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwstubbs committed Oct 29, 2024
1 parent 02a6643 commit 0483b80
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions python/ql/lib/semmle/python/frameworks/Bottle.qll
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ module Bottle {
* Provides models for Bottle applications.
*/
module App {
/** Gets class `bottle.Bottle`) */
API::Node cls() { result = API::moduleImport("bottle").getMember("Bottle") }

/** Gets a reference to a Bottle application (an instance of `bottle.Bottle`) */
API::Node instance() { result = cls().getReturn() }
API::Node instance() { result = bottle().getMember("Bottle").getReturn() }

/** Gets a reference to a Bottle application (an instance of `bottle.app`) */
API::Node app() { result = bottle().getMember("app").getReturn() }
Expand All @@ -45,15 +42,15 @@ module Bottle {
ViewCallable() { this = any(BottleRouteSetup rs).getARequestHandler() }
}

string routeMethods() { result = ["route", "get", "post", "put", "delete", "patch"] }

Check warning on line 45 in python/ql/lib/semmle/python/frameworks/Bottle.qll

View workflow job for this annotation

GitHub Actions / qldoc

Missing QLdoc for classless-predicate Bottle::Bottle::BottleModule::View::routeMethods/0

private class BottleRouteSetup extends Http::Server::RouteSetup::Range, DataFlow::CallCfgNode {
BottleRouteSetup() {
this =
[
App::instance()
.getMember(["route", "get", "post", "put", "delete", "patch"])
.getACall(),
App::app().getMember(["route", "get", "post", "put", "delete", "patch"]).getACall(),
bottle().getMember(["route", "get", "post", "put", "delete", "patch"]).getACall()
App::instance().getMember(routeMethods()).getACall(),
App::app().getMember(routeMethods()).getACall(),
bottle().getMember(routeMethods()).getACall()
]
}

Expand Down

0 comments on commit 0483b80

Please sign in to comment.