Skip to content

Commit b02f1c8

Browse files
authored
Merge pull request #7679 from erik-krogh/ql-doc-style
Approved by esbena
2 parents 2287b6e + 5780161 commit b02f1c8

File tree

18 files changed

+52
-52
lines changed

18 files changed

+52
-52
lines changed

javascript/ql/lib/semmle/javascript/Externs.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ class ExternalInterface extends ExternalType {
544544
}
545545

546546
/**
547-
* Externs definition for the Function object.
547+
* The externs definition for the Function object.
548548
*
549549
* Example:
550550
*
@@ -561,7 +561,7 @@ class FunctionExternal extends ExternalConstructor {
561561
}
562562

563563
/**
564-
* Externs definition for the Object object.
564+
* The externs definition for the Object object.
565565
*
566566
* Example:
567567
*
@@ -578,7 +578,7 @@ class ObjectExternal extends ExternalConstructor {
578578
}
579579

580580
/**
581-
* Externs definition for the Array object.
581+
* The externs definition for the Array object.
582582
*
583583
* Example:
584584
*

javascript/ql/lib/semmle/javascript/Promises.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ private module DynamicImportSteps {
707707
*/
708708
module Promisify {
709709
/**
710-
* Gets a call to a `promisifyAll` function.
710+
* A call to a `promisifyAll` function.
711711
* E.g. `require("bluebird").promisifyAll(...)`.
712712
*/
713713
class PromisifyAllCall extends DataFlow::CallNode {
@@ -721,7 +721,7 @@ module Promisify {
721721
}
722722

723723
/**
724-
* Gets a call to a `promisify` function.
724+
* A call to a `promisify` function.
725725
* E.g. `require("util").promisify(...)`.
726726
*/
727727
class PromisifyCall extends DataFlow::CallNode {

javascript/ql/lib/semmle/javascript/StringOps.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ module StringOps {
512512
}
513513

514514
/**
515-
* One of the operands in a string concatenation.
515+
* An operand in a string concatenation.
516516
*
517517
* Examples:
518518
* ```

javascript/ql/lib/semmle/javascript/TypeScript.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ class EnumMember extends ASTNode, @enum_member {
16441644
}
16451645

16461646
/**
1647-
* Scope induced by an interface declaration, containing the type parameters declared on the interface.
1647+
* A scope induced by an interface declaration, containing the type parameters declared on the interface.
16481648
*
16491649
* Interfaces that do not declare type parameters have no scope object.
16501650
*/
@@ -1653,7 +1653,7 @@ class InterfaceScope extends @interface_scope, Scope {
16531653
}
16541654

16551655
/**
1656-
* Scope induced by a type alias declaration, containing the type parameters declared the the alias.
1656+
* A scope induced by a type alias declaration, containing the type parameters declared the the alias.
16571657
*
16581658
* Type aliases that do not declare type parameters have no scope object.
16591659
*/
@@ -1662,14 +1662,14 @@ class TypeAliasScope extends @type_alias_scope, Scope {
16621662
}
16631663

16641664
/**
1665-
* Scope induced by a mapped type expression, containing the type parameter declared as part of the type.
1665+
* A scope induced by a mapped type expression, containing the type parameter declared as part of the type.
16661666
*/
16671667
class MappedTypeScope extends @mapped_type_scope, Scope {
16681668
override string toString() { result = "mapped type scope" }
16691669
}
16701670

16711671
/**
1672-
* Scope induced by an enum declaration, containing the names of its enum members.
1672+
* A scope induced by an enum declaration, containing the names of its enum members.
16731673
*
16741674
* Initializers of enum members are resolved in this scope since they can reference
16751675
* previously-defined enum members by their unqualified name.
@@ -2637,7 +2637,7 @@ class TypeofType extends Type, @typeof_type {
26372637
}
26382638

26392639
/**
2640-
* One of two values indicating if a signature is a function or constructor signature.
2640+
* A value indicating if a signature is a function or constructor signature.
26412641
*/
26422642
class SignatureKind extends string {
26432643
SignatureKind() { this = "function" or this = "constructor" }

javascript/ql/lib/semmle/javascript/dataflow/TypeTracking.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private import semmle.javascript.internal.CachedStages
1515
private newtype TTypeTracker = MkTypeTracker(Boolean hasCall, OptionalPropertyName prop)
1616

1717
/**
18-
* Summary of the steps needed to track a value to a given dataflow node.
18+
* A summary of the steps needed to track a value to a given dataflow node.
1919
*
2020
* This can be used to track objects that implement a certain API in order to
2121
* recognize calls to that API. Note that type-tracking does not by itself provide a
@@ -182,7 +182,7 @@ module TypeTracker {
182182
private newtype TTypeBackTracker = MkTypeBackTracker(Boolean hasReturn, OptionalPropertyName prop)
183183

184184
/**
185-
* Summary of the steps needed to back-track a use of a value to a given dataflow node.
185+
* A summary of the steps needed to back-track a use of a value to a given dataflow node.
186186
*
187187
* This can be used to track callbacks that are passed to a certain API call, and are
188188
* therefore expected to be called with a certain type of value.

javascript/ql/lib/semmle/javascript/frameworks/Babel.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module Babel {
4949
}
5050

5151
/**
52-
* Configuration object for a Babel plugin.
52+
* A configuration object for a Babel plugin.
5353
*/
5454
class Plugin extends JSONValue {
5555
Config cfg;

javascript/ql/lib/semmle/javascript/frameworks/Cheerio.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module Cheerio {
2929
DataFlow::SourceNode cheerioRef() { result = cheerioRef(DataFlow::TypeTracker::end()) }
3030

3131
/**
32-
* Creation of `cheerio` object, a collection of virtual DOM elements
32+
* A creation of `cheerio` object, a collection of virtual DOM elements
3333
* with an interface similar to that of a jQuery object.
3434
*/
3535
class CheerioObjectCreation extends DataFlow::SourceNode instanceof CheerioObjectCreation::Range {
@@ -88,7 +88,7 @@ module Cheerio {
8888
}
8989

9090
/**
91-
* Definition of a DOM attribute through `cheerio`.
91+
* A definition of a DOM attribute through `cheerio`.
9292
*/
9393
class AttributeDef extends DOM::AttributeDefinition {
9494
DataFlow::CallNode call;
@@ -105,7 +105,7 @@ module Cheerio {
105105
}
106106

107107
/**
108-
* XSS sink through `cheerio`.
108+
* An XSS sink through `cheerio`.
109109
*/
110110
class XssSink extends Xss::DomBasedXss::Sink {
111111
XssSink() {

javascript/ql/lib/semmle/javascript/frameworks/ExpressModules.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module ExpressLibraries {
1616
}
1717

1818
/**
19-
* Header produced by a route handler of the "x-frame-options" module.
19+
* A header produced by a route handler of the "x-frame-options" module.
2020
*/
2121
class XFrameOptionsRouteHandlerHeader extends HTTP::ImplicitHeaderDefinition {
2222
XFrameOptionsRouteHandlerHeader() { this instanceof XFrameOptionsRouteHandler }
@@ -29,7 +29,7 @@ module ExpressLibraries {
2929
}
3030

3131
/**
32-
* Route handler from the "x-frame-options" module.
32+
* A route handler from the "x-frame-options" module.
3333
*/
3434
class XFrameOptionsRouteHandler extends HTTP::RouteHandler {
3535
XFrameOptionsRouteHandler() {
@@ -43,7 +43,7 @@ module ExpressLibraries {
4343
}
4444

4545
/**
46-
* Header produced by a route handler of the "frameguard" module.
46+
* A header produced by a route handler of the "frameguard" module.
4747
*/
4848
class FrameGuardRouteHandlerHeader extends HTTP::ImplicitHeaderDefinition {
4949
FrameGuardRouteHandlerHeader() { this instanceof FrameGuardRouteHandler }
@@ -56,7 +56,7 @@ module ExpressLibraries {
5656
}
5757

5858
/**
59-
* Route handler from the "frameguard" module.
59+
* A route handler from the "frameguard" module.
6060
*/
6161
class FrameGuardRouteHandler extends HTTP::RouteHandler {
6262
FrameGuardRouteHandler() { this = DataFlow::moduleImport("frameguard").getAnInvocation() }
@@ -68,7 +68,7 @@ module ExpressLibraries {
6868
}
6969

7070
/**
71-
* Header produced by a route handler of the "helmet" module.
71+
* A header produced by a route handler of the "helmet" module.
7272
*/
7373
class HelmetRouteHandlerHeader extends HTTP::ImplicitHeaderDefinition {
7474
HelmetRouteHandlerHeader() { this instanceof HelmetRouteHandler }
@@ -81,7 +81,7 @@ module ExpressLibraries {
8181
}
8282

8383
/**
84-
* Route handler from the "helmet" module.
84+
* A route handler from the "helmet" module.
8585
*/
8686
class HelmetRouteHandler extends HTTP::RouteHandler {
8787
HelmetRouteHandler() {

javascript/ql/lib/semmle/javascript/frameworks/Firebase.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ module Firebase {
179179
/** Gets a data flow node holding a `RefBuilder` object. */
180180
DataFlow::SourceNode ref() { result = refBuilder(DataFlow::TypeTracker::end()) }
181181

182-
/** Gets a call that registers a listener on a `RefBuilder`, such as `ref.onCreate(...)`. */
182+
/** A call that registers a listener on a `RefBuilder`, such as `ref.onCreate(...)`. */
183183
class RefBuilderListenCall extends DataFlow::MethodCallNode {
184184
RefBuilderListenCall() {
185185
this = ref().getAMethodCall() and

javascript/ql/lib/semmle/javascript/frameworks/Next.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module NextJS {
4444
}
4545

4646
/**
47-
* User defined path parameter in `Next.js`.
47+
* A user defined path parameter in `Next.js`.
4848
*/
4949
class NextParams extends RemoteFlowSource {
5050
NextParams() {

javascript/ql/lib/semmle/javascript/frameworks/Redux.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module Redux {
5454
}
5555

5656
/**
57-
* Creation of a redux store, usually via a call to `createStore`.
57+
* A creation of a redux store, usually via a call to `createStore`.
5858
*/
5959
class StoreCreation extends DataFlow::SourceNode instanceof StoreCreation::Range {
6060
/** Gets a reference to the store. */
@@ -566,7 +566,7 @@ module Redux {
566566
}
567567

568568
/**
569-
* One of the action creators made by a call to `createActions`:
569+
* An action creator made by a call to `createActions`:
570570
* ```js
571571
* let { actionOne, actionTwo } = createActions({
572572
* ACTION_ONE: (x, y) => { x, y },
@@ -988,7 +988,7 @@ module Redux {
988988
API::Node useSelector() { result = API::moduleImport("react-redux").getMember("useSelector") }
989989

990990
/**
991-
* Step out of a `useSelector` call, such as from `state.x` to the result of `useSelector(state => state.x)`.
991+
* A step out of a `useSelector` call, such as from `state.x` to the result of `useSelector(state => state.x)`.
992992
*/
993993
class UseSelectorStep extends StateStep {
994994
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {

javascript/ql/lib/semmle/javascript/security/dataflow/StoredXssQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class FileNameSourceAsSource extends Source {
3131
FileNameSourceAsSource() { this instanceof FileNameSource }
3232
}
3333

34-
/** User-controlled torrent information, considered as a flow source for stored XSS. */
34+
/** An instance of user-controlled torrent information, considered as a flow source for stored XSS. */
3535
class UserControlledTorrentInfoAsSource extends Source {
3636
UserControlledTorrentInfoAsSource() { this instanceof ParseTorrent::UserControlledTorrentInfo }
3737
}

javascript/ql/lib/semmle/javascript/security/dataflow/UnsafeJQueryPluginCustomizations.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module UnsafeJQueryPlugin {
100100
}
101101

102102
/**
103-
* Expression of form `isElement(x)`, which sanitizes `x`.
103+
* An expression of form `isElement(x)`, which sanitizes `x`.
104104
*/
105105
class IsElementSanitizer extends TaintTracking::SanitizerGuardNode, DataFlow::CallNode {
106106
IsElementSanitizer() {
@@ -116,7 +116,7 @@ module UnsafeJQueryPlugin {
116116
}
117117

118118
/**
119-
* Expression like `typeof x.<?> !== "undefined"` or `x.<?>`, which sanitizes `x`, as it is unlikely to be a string afterwards.
119+
* An expression like `typeof x.<?> !== "undefined"` or `x.<?>`, which sanitizes `x`, as it is unlikely to be a string afterwards.
120120
*/
121121
class PropertyPresenceSanitizer extends TaintTracking::SanitizerGuardNode, DataFlow::ValueNode {
122122
DataFlow::Node input;

javascript/ql/src/Declarations/IneffectiveParameterType.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ predicate isCommonPredefinedTypeName(string name) {
2222
}
2323

2424
/**
25-
* Any local type declaration, excluding imported names that are not explicitly used as types.
25+
* A local type declaration, excluding imported names that are not explicitly used as types.
2626
*/
2727
class DefiniteTypeDecl extends TypeDecl {
2828
DefiniteTypeDecl() {

javascript/ql/src/Expressions/ImplicitOperandConversion.ql

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ abstract class ImplicitConversionWithWhitelist extends ImplicitConversion {
5656
}
5757

5858
/**
59-
* Property names in `in` expressions are converted to strings,
60-
* so they should be strings or numbers.
59+
* A property name in an `in` expression that is converted to string,
60+
* so it should be a string or number.
6161
*/
6262
class PropertyNameConversion extends ImplicitConversionWithWhitelist {
6363
PropertyNameConversion() { this.asExpr() = parent.(InExpr).getLeftOperand() }
@@ -68,8 +68,8 @@ class PropertyNameConversion extends ImplicitConversionWithWhitelist {
6868
}
6969

7070
/**
71-
* Property names in index expressions are converted to strings,
72-
* so they should be Booleans, strings or numbers.
71+
* A property name in an index expression that is converted to string,
72+
* so it should be Boolean, string or number.
7373
*/
7474
class IndexExprConversion extends ImplicitConversionWithWhitelist {
7575
IndexExprConversion() { this.asExpr() = parent.(IndexExpr).getIndex() }
@@ -82,7 +82,7 @@ class IndexExprConversion extends ImplicitConversionWithWhitelist {
8282
}
8383

8484
/**
85-
* Expressions that are interpreted as objects shouldn't be primitive values.
85+
* An expression that is interpreted as an object, and therefore shouldn't be a primitive value.
8686
*/
8787
class ObjectConversion extends ImplicitConversionWithWhitelist {
8888
ObjectConversion() {
@@ -107,8 +107,8 @@ class ConstructorConversion extends ImplicitConversionWithWhitelist {
107107
}
108108

109109
/**
110-
* Operands of relational operators are converted to strings or numbers,
111-
* and hence should be strings, numbers or Dates.
110+
* An operand of an relational comparison that is converted to string or number,
111+
* and hence should be a string, number or Date.
112112
*/
113113
class RelationalOperandConversion extends ImplicitConversionWithWhitelist {
114114
RelationalOperandConversion() { parent instanceof RelationalComparison }
@@ -121,8 +121,8 @@ class RelationalOperandConversion extends ImplicitConversionWithWhitelist {
121121
}
122122

123123
/**
124-
* Operands of arithmetic and bitwise operations are converted to numbers,
125-
* so they should be Booleans, numbers or Dates.
124+
* An operand of arithmetic and bitwise operations that is converted to a number,
125+
* so it should be a Boolean, number or Date.
126126
*/
127127
class NumericConversion extends ImplicitConversion {
128128
NumericConversion() {
@@ -156,7 +156,7 @@ abstract class NullOrUndefinedConversion extends ImplicitConversion {
156156
}
157157

158158
/**
159-
* Operands of `+` or `+=` are converted to strings or numbers, and hence
159+
* An operand of `+` or `+=` that is converted to string or number, and hence
160160
* should not be `null` or `undefined`.
161161
*/
162162
class PlusConversion extends NullOrUndefinedConversion {
@@ -186,7 +186,7 @@ class PlusConversion extends NullOrUndefinedConversion {
186186
}
187187

188188
/**
189-
* Template literal elements are converted to strings, and hence should not
189+
* A template literal element that is converted to a string, and hence should not
190190
* be `null` or `undefined`.
191191
*/
192192
class TemplateElementConversion extends NullOrUndefinedConversion {

javascript/ql/src/Security/CWE-915/PrototypePollutingFunction.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ string unsafePropName() {
193193
}
194194

195195
/**
196-
* Flow label representing an unsafe property name, or an object obtained
196+
* A flow label representing an unsafe property name, or an object obtained
197197
* by using such a property in a dynamic read.
198198
*/
199199
class UnsafePropLabel extends FlowLabel {
@@ -295,7 +295,7 @@ class PropNameTracking extends DataFlow::Configuration {
295295
}
296296

297297
/**
298-
* Sanitizer guard of form `x === "__proto__"` or `x === "constructor"`.
298+
* A sanitizer guard of form `x === "__proto__"` or `x === "constructor"`.
299299
*/
300300
class DenyListEqualityGuard extends DataFlow::LabeledBarrierGuardNode, ValueNode {
301301
override EqualityTest astNode;
@@ -355,7 +355,7 @@ class HasOwnPropertyGuard extends DataFlow::BarrierGuardNode, CallNode {
355355
}
356356

357357
/**
358-
* Sanitizer guard for `key in dst`.
358+
* A sanitizer guard for `key in dst`.
359359
*
360360
* Since `"__proto__" in obj` and `"constructor" in obj` is true for most objects,
361361
* this is seen as a sanitizer for `key` in the false outcome.
@@ -374,7 +374,7 @@ class InExprGuard extends DataFlow::BarrierGuardNode, DataFlow::ValueNode {
374374
}
375375

376376
/**
377-
* Sanitizer guard for `instanceof` expressions.
377+
* A sanitizer guard for `instanceof` expressions.
378378
*
379379
* `Object.prototype instanceof X` is never true, so this blocks the `__proto__` label.
380380
*

0 commit comments

Comments
 (0)