Skip to content

Commit 83389be

Browse files
committed
Python: Add some missing QLDocs
1 parent 5c2734c commit 83389be

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ module PrivateDjango {
546546
/** Gets a reference to the `django.db.connection` object. */
547547
API::Node connection() { result = db().getMember("connection") }
548548

549+
/** A `django.db.connection` is a PEP249 compliant DB connection. */
549550
class DjangoDbConnection extends PEP249::Connection::InstanceSource {
550551
DjangoDbConnection() { this = connection().getAUse() }
551552
}
@@ -742,6 +743,7 @@ module PrivateDjango {
742743

743744
/** Provides models for the `django.conf` module */
744745
module conf {
746+
/** Provides models for the `django.conf.urls` module */
745747
module conf_urls {
746748
// -------------------------------------------------------------------------
747749
// django.conf.urls
@@ -940,14 +942,15 @@ module PrivateDjango {
940942
* See https://docs.djangoproject.com/en/3.1/ref/request-response/#django.http.HttpResponse.
941943
*/
942944
module HttpResponse {
945+
/** Gets a reference to the `django.http.response.HttpResponse` class. */
943946
API::Node baseClassRef() {
944947
result = response().getMember("HttpResponse")
945948
or
946949
// Handle `django.http.HttpResponse` alias
947950
result = http().getMember("HttpResponse")
948951
}
949952

950-
/** Gets a reference to the `django.http.response.HttpResponse` class. */
953+
/** Gets a reference to the `django.http.response.HttpResponse` class or any subclass. */
951954
API::Node classRef() { result = baseClassRef().getASubclass*() }
952955

953956
/**
@@ -1943,6 +1946,9 @@ module PrivateDjango {
19431946
* with the django framework.
19441947
*
19451948
* Most functions take a django HttpRequest as a parameter (but not all).
1949+
*
1950+
* Extend this class to refine existing API models. If you want to model new APIs,
1951+
* extend `DjangoRouteHandler::Range` instead.
19461952
*/
19471953
class DjangoRouteHandler extends Function instanceof DjangoRouteHandler::Range {
19481954
/**
@@ -1964,10 +1970,16 @@ module PrivateDjango {
19641970
Parameter getRequestParam() { result = this.getArg(this.getRequestParamIndex()) }
19651971
}
19661972

1973+
/** Provides a class for modeling new django route handlers. */
19671974
module DjangoRouteHandler {
1975+
/**
1976+
* Extend this class to model new APIs. If you want to refine existing API models,
1977+
* extend `DjangoRouteHandler` instead.
1978+
*/
19681979
abstract class Range extends Function { }
19691980

1970-
class StandardDjangoRouteHandlers extends Range {
1981+
/** Route handlers from normal usage of django. */
1982+
private class StandardDjangoRouteHandlers extends Range {
19711983
StandardDjangoRouteHandlers() {
19721984
exists(DjangoRouteSetup route | route.getViewArg() = poorMansFunctionTracker(this))
19731985
or

0 commit comments

Comments
 (0)