Skip to content

Commit 8a44405

Browse files
authored
Merge pull request #4827 from RasmusWL/reword-qldoc-for-type-tracking-classes
Python: Reword QLDoc for class modeling with type-tracking
2 parents 45893ab + 8df1861 commit 8a44405

File tree

7 files changed

+88
-88
lines changed

7 files changed

+88
-88
lines changed

python/.vscode/ql.code-snippets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@
321321
" DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }",
322322
"",
323323
" /**",
324-
" * A source of an instance of `$1.$2`.",
324+
" * A source of instances of `$1.$2`, extend this class to model new instances.",
325325
" *",
326-
" * This can include instantiation of the class, return value from function",
327-
" * calls, or a special parameter that will be set when functions are call by external",
326+
" * This can include instantiations of the class, return values from function",
327+
" * calls, or a special parameter that will be set when functions are called by an external",
328328
" * library.",
329329
" *",
330-
" * Use `$2::instance()` predicate to get references to instances of `$1.$2`.",
330+
" * Use the predicate `$2::instance()` to get references to instances of `$1.$2`.",
331331
" */",
332332
" abstract class InstanceSource extends DataFlow::Node { }",
333333
"",

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

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ private module Django {
540540
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
541541

542542
/**
543-
* A source of an instance of `django.http.request.HttpRequest`.
543+
* A source of instances of `django.http.request.HttpRequest`, extend this class to model new instances.
544544
*
545-
* This can include instantiation of the class, return value from function
545+
* This can include instantiations of the class, return values from function
546546
* calls, or a special parameter that will be set when functions are called by an external
547547
* library.
548548
*
@@ -646,13 +646,13 @@ private module Django {
646646
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
647647

648648
/**
649-
* A source of an instance of `django.http.response.HttpResponse`.
649+
* A source of instances of `django.http.response.HttpResponse`, extend this class to model new instances.
650650
*
651-
* This can include instantiation of the class, return value from function
652-
* calls, or a special parameter that will be set when functions are call by external
651+
* This can include instantiations of the class, return values from function
652+
* calls, or a special parameter that will be set when functions are called by an external
653653
* library.
654654
*
655-
* Use `HttpResponse::instance()` predicate to get references to instances of `django.http.response.HttpResponse`.
655+
* Use the predicate `HttpResponse::instance()` to get references to instances of `django.http.response.HttpResponse`.
656656
*/
657657
abstract class InstanceSource extends HTTP::Server::HttpResponse::Range, DataFlow::Node {
658658
}
@@ -716,13 +716,13 @@ private module Django {
716716
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
717717

718718
/**
719-
* A source of an instance of `django.http.response.HttpResponseRedirect`.
719+
* A source of instances of `django.http.response.HttpResponseRedirect`, extend this class to model new instances.
720720
*
721-
* This can include instantiation of the class, return value from function
722-
* calls, or a special parameter that will be set when functions are call by external
721+
* This can include instantiations of the class, return values from function
722+
* calls, or a special parameter that will be set when functions are called by an external
723723
* library.
724724
*
725-
* Use `HttpResponseRedirect::instance()` predicate to get references to instances of `django.http.response.HttpResponseRedirect`.
725+
* Use the predicate `HttpResponseRedirect::instance()` to get references to instances of `django.http.response.HttpResponseRedirect`.
726726
*/
727727
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
728728

@@ -782,13 +782,13 @@ private module Django {
782782
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
783783

784784
/**
785-
* A source of an instance of `django.http.response.HttpResponsePermanentRedirect`.
785+
* A source of instances of `django.http.response.HttpResponsePermanentRedirect`, extend this class to model new instances.
786786
*
787-
* This can include instantiation of the class, return value from function
788-
* calls, or a special parameter that will be set when functions are call by external
787+
* This can include instantiations of the class, return values from function
788+
* calls, or a special parameter that will be set when functions are called by an external
789789
* library.
790790
*
791-
* Use `HttpResponsePermanentRedirect::instance()` predicate to get references to instances of `django.http.response.HttpResponsePermanentRedirect`.
791+
* Use the predicate `HttpResponsePermanentRedirect::instance()` to get references to instances of `django.http.response.HttpResponsePermanentRedirect`.
792792
*/
793793
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
794794

@@ -849,13 +849,13 @@ private module Django {
849849
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
850850

851851
/**
852-
* A source of an instance of `django.http.response.HttpResponseNotModified`.
852+
* A source of instances of `django.http.response.HttpResponseNotModified`, extend this class to model new instances.
853853
*
854-
* This can include instantiation of the class, return value from function
855-
* calls, or a special parameter that will be set when functions are call by external
854+
* This can include instantiations of the class, return values from function
855+
* calls, or a special parameter that will be set when functions are called by an external
856856
* library.
857857
*
858-
* Use `HttpResponseNotModified::instance()` predicate to get references to instances of `django.http.response.HttpResponseNotModified`.
858+
* Use the predicate `HttpResponseNotModified::instance()` to get references to instances of `django.http.response.HttpResponseNotModified`.
859859
*/
860860
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
861861

@@ -910,13 +910,13 @@ private module Django {
910910
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
911911

912912
/**
913-
* A source of an instance of `django.http.response.HttpResponseBadRequest`.
913+
* A source of instances of `django.http.response.HttpResponseBadRequest`, extend this class to model new instances.
914914
*
915-
* This can include instantiation of the class, return value from function
916-
* calls, or a special parameter that will be set when functions are call by external
915+
* This can include instantiations of the class, return values from function
916+
* calls, or a special parameter that will be set when functions are called by an external
917917
* library.
918918
*
919-
* Use `HttpResponseBadRequest::instance()` predicate to get references to instances of `django.http.response.HttpResponseBadRequest`.
919+
* Use the predicate `HttpResponseBadRequest::instance()` to get references to instances of `django.http.response.HttpResponseBadRequest`.
920920
*/
921921
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
922922

@@ -973,13 +973,13 @@ private module Django {
973973
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
974974

975975
/**
976-
* A source of an instance of `django.http.response.HttpResponseNotFound`.
976+
* A source of instances of `django.http.response.HttpResponseNotFound`, extend this class to model new instances.
977977
*
978-
* This can include instantiation of the class, return value from function
979-
* calls, or a special parameter that will be set when functions are call by external
978+
* This can include instantiations of the class, return values from function
979+
* calls, or a special parameter that will be set when functions are called by an external
980980
* library.
981981
*
982-
* Use `HttpResponseNotFound::instance()` predicate to get references to instances of `django.http.response.HttpResponseNotFound`.
982+
* Use the predicate `HttpResponseNotFound::instance()` to get references to instances of `django.http.response.HttpResponseNotFound`.
983983
*/
984984
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
985985

@@ -1036,13 +1036,13 @@ private module Django {
10361036
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
10371037

10381038
/**
1039-
* A source of an instance of `django.http.response.HttpResponseForbidden`.
1039+
* A source of instances of `django.http.response.HttpResponseForbidden`, extend this class to model new instances.
10401040
*
1041-
* This can include instantiation of the class, return value from function
1042-
* calls, or a special parameter that will be set when functions are call by external
1041+
* This can include instantiations of the class, return values from function
1042+
* calls, or a special parameter that will be set when functions are called by an external
10431043
* library.
10441044
*
1045-
* Use `HttpResponseForbidden::instance()` predicate to get references to instances of `django.http.response.HttpResponseForbidden`.
1045+
* Use the predicate `HttpResponseForbidden::instance()` to get references to instances of `django.http.response.HttpResponseForbidden`.
10461046
*/
10471047
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
10481048

@@ -1099,13 +1099,13 @@ private module Django {
10991099
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
11001100

11011101
/**
1102-
* A source of an instance of `django.http.response.HttpResponseNotAllowed`.
1102+
* A source of instances of `django.http.response.HttpResponseNotAllowed`, extend this class to model new instances.
11031103
*
1104-
* This can include instantiation of the class, return value from function
1105-
* calls, or a special parameter that will be set when functions are call by external
1104+
* This can include instantiations of the class, return values from function
1105+
* calls, or a special parameter that will be set when functions are called by an external
11061106
* library.
11071107
*
1108-
* Use `HttpResponseNotAllowed::instance()` predicate to get references to instances of `django.http.response.HttpResponseNotAllowed`.
1108+
* Use the predicate `HttpResponseNotAllowed::instance()` to get references to instances of `django.http.response.HttpResponseNotAllowed`.
11091109
*/
11101110
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
11111111

@@ -1163,13 +1163,13 @@ private module Django {
11631163
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
11641164

11651165
/**
1166-
* A source of an instance of `django.http.response.HttpResponseGone`.
1166+
* A source of instances of `django.http.response.HttpResponseGone`, extend this class to model new instances.
11671167
*
1168-
* This can include instantiation of the class, return value from function
1169-
* calls, or a special parameter that will be set when functions are call by external
1168+
* This can include instantiations of the class, return values from function
1169+
* calls, or a special parameter that will be set when functions are called by an external
11701170
* library.
11711171
*
1172-
* Use `HttpResponseGone::instance()` predicate to get references to instances of `django.http.response.HttpResponseGone`.
1172+
* Use the predicate `HttpResponseGone::instance()` to get references to instances of `django.http.response.HttpResponseGone`.
11731173
*/
11741174
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
11751175

@@ -1226,13 +1226,13 @@ private module Django {
12261226
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
12271227

12281228
/**
1229-
* A source of an instance of `django.http.response.HttpResponseServerError`.
1229+
* A source of instances of `django.http.response.HttpResponseServerError`, extend this class to model new instances.
12301230
*
1231-
* This can include instantiation of the class, return value from function
1232-
* calls, or a special parameter that will be set when functions are call by external
1231+
* This can include instantiations of the class, return values from function
1232+
* calls, or a special parameter that will be set when functions are called by an external
12331233
* library.
12341234
*
1235-
* Use `HttpResponseServerError::instance()` predicate to get references to instances of `django.http.response.HttpResponseServerError`.
1235+
* Use the predicate `HttpResponseServerError::instance()` to get references to instances of `django.http.response.HttpResponseServerError`.
12361236
*/
12371237
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
12381238

@@ -1289,13 +1289,13 @@ private module Django {
12891289
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
12901290

12911291
/**
1292-
* A source of an instance of `django.http.response.JsonResponse`.
1292+
* A source of instances of `django.http.response.JsonResponse`, extend this class to model new instances.
12931293
*
1294-
* This can include instantiation of the class, return value from function
1295-
* calls, or a special parameter that will be set when functions are call by external
1294+
* This can include instantiations of the class, return values from function
1295+
* calls, or a special parameter that will be set when functions are called by an external
12961296
* library.
12971297
*
1298-
* Use `JsonResponse::instance()` predicate to get references to instances of `django.http.response.JsonResponse`.
1298+
* Use the predicate `JsonResponse::instance()` to get references to instances of `django.http.response.JsonResponse`.
12991299
*/
13001300
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
13011301

@@ -1355,13 +1355,13 @@ private module Django {
13551355
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
13561356

13571357
/**
1358-
* A source of an instance of `django.http.response.StreamingHttpResponse`.
1358+
* A source of instances of `django.http.response.StreamingHttpResponse`, extend this class to model new instances.
13591359
*
1360-
* This can include instantiation of the class, return value from function
1361-
* calls, or a special parameter that will be set when functions are call by external
1360+
* This can include instantiations of the class, return values from function
1361+
* calls, or a special parameter that will be set when functions are called by an external
13621362
* library.
13631363
*
1364-
* Use `StreamingHttpResponse::instance()` predicate to get references to instances of `django.http.response.StreamingHttpResponse`.
1364+
* Use the predicate `StreamingHttpResponse::instance()` to get references to instances of `django.http.response.StreamingHttpResponse`.
13651365
*/
13661366
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
13671367

@@ -1418,13 +1418,13 @@ private module Django {
14181418
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
14191419

14201420
/**
1421-
* A source of an instance of `django.http.response.FileResponse`.
1421+
* A source of instances of `django.http.response.FileResponse`, extend this class to model new instances.
14221422
*
1423-
* This can include instantiation of the class, return value from function
1424-
* calls, or a special parameter that will be set when functions are call by external
1423+
* This can include instantiations of the class, return values from function
1424+
* calls, or a special parameter that will be set when functions are called by an external
14251425
* library.
14261426
*
1427-
* Use `FileResponse::instance()` predicate to get references to instances of `django.http.response.FileResponse`.
1427+
* Use the predicate `FileResponse::instance()` to get references to instances of `django.http.response.FileResponse`.
14281428
*/
14291429
abstract class InstanceSource extends HttpResponse::InstanceSource, DataFlow::Node { }
14301430

python/ql/src/semmle/python/frameworks/Fabric.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ private module FabricV2 {
281281
DataFlow::Node classRef() { result = classRef(DataFlow::TypeTracker::end()) }
282282

283283
/**
284-
* A source of an instance of `fabric.connection.Connection`.
284+
* A source of instances of `fabric.connection.Connection`, extend this class to model new instances.
285285
*
286-
* This can include instantiation of the class, return value from function
286+
* This can include instantiations of the class, return values from function
287287
* calls, or a special parameter that will be set when functions are called by an external
288288
* library.
289289
*
290-
* Use `Connection::instance()` predicate to get references to instances of `fabric.connection.Connection`.
290+
* Use the predicate `Connection::instance()` to get references to instances of `fabric.connection.Connection`.
291291
*/
292292
abstract class InstanceSource extends DataFlow::Node { }
293293

@@ -457,7 +457,7 @@ private module FabricV2 {
457457
*/
458458
module Group {
459459
/**
460-
* A source of an instance of a subclass of `fabric.group.Group`
460+
* A source of instances of a subclass of `fabric.group, extend this class to model new instances.Group`
461461
*
462462
* This can include instantiation of a class, return value from function
463463
* calls, or a special parameter that will be set when functions are called by an external

0 commit comments

Comments
 (0)