Skip to content

Commit c487bb7

Browse files
authored
Merge pull request #8143 from erik-krogh/pred-ql-style
QL: add ql-for-ql query for detecting bad predicate qldoc
2 parents aecc17c + 08c703f commit c487bb7

File tree

34 files changed

+103
-54
lines changed

34 files changed

+103
-54
lines changed

javascript/ql/examples/queries/dataflow/StoredXss/StoredXssTypeTracking.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import semmle.javascript.security.dataflow.StoredXssQuery
1313
import DataFlow::PathGraph
1414

1515
/**
16-
* An instance of `mysql.createConnection()`, tracked globally.
16+
* Gets an instance of `mysql.createConnection()`, tracked globally.
1717
*/
1818
DataFlow::SourceNode mysqlConnection(DataFlow::TypeTracker t) {
1919
t.start() and
@@ -23,7 +23,7 @@ DataFlow::SourceNode mysqlConnection(DataFlow::TypeTracker t) {
2323
}
2424

2525
/**
26-
* An instance of `mysql.createConnection()`, tracked globally.
26+
* Gets an instance of `mysql.createConnection()`, tracked globally.
2727
*/
2828
DataFlow::SourceNode mysqlConnection() { result = mysqlConnection(DataFlow::TypeTracker::end()) }
2929

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FunctionBodyFeatures.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int getNumCharsInFunction(Function f) {
134134
}
135135

136136
/**
137-
* The maximum number of characters a feature can be.
137+
* Gets the maximum number of characters a feature can be.
138138
* The evaluator string limit is 5395415 characters. We choose a limit lower than this.
139139
*/
140140
private int getMaxChars() { result = 1000000 }

javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractMisclassifiedEndpointFeatures.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import experimental.adaptivethreatmodeling.EndpointFeatures as EndpointFeatures
1212
import experimental.adaptivethreatmodeling.EndpointTypes
1313
import semmle.javascript.security.dataflow.NosqlInjectionCustomizations
1414

15-
/** The positive endpoint type for which you wish to find misclassified examples. */
15+
/** Gets the positive endpoint type for which you wish to find misclassified examples. */
1616
EndpointType getEndpointType() { result instanceof NosqlInjectionSinkType }
1717

1818
/** Get a positive endpoint. This will be run through the classifier to determine whether it is misclassified. */

javascript/ql/lib/semmle/javascript/Arrays.qll

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

1818
/**
19-
* A taint propagating data flow edge from `pred` to `succ` caused by a call `call` to a builtin array functions.
19+
* Holds if there is a taint propagating data flow edge from `pred` to `succ` caused by a call `call` to a builtin array functions.
2020
*/
2121
predicate arrayFunctionTaintStep(DataFlow::Node pred, DataFlow::Node succ, DataFlow::CallNode call) {
2222
// `array.map(function (elt, i, ary) { ... })`: if `array` is tainted, then so are
@@ -357,7 +357,7 @@ private module ArrayLibraries {
357357
}
358358

359359
/**
360-
* A call to a library that copies the elements of an array into another array.
360+
* Gets a call to a library that copies the elements of an array into another array.
361361
* E.g. `array-union` that creates a union of multiple arrays, or `array-uniq` that creates an array with unique elements.
362362
*/
363363
DataFlow::CallNode arrayCopyCall(DataFlow::Node array) {

javascript/ql/lib/semmle/javascript/DOM.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ module DOM {
300300
}
301301

302302
/**
303-
* A data flow node that might refer to some form.
303+
* Gets a data flow node that might refer to some form.
304304
* Either by a read like `document.forms[0]`, or a property read from `document` with some constant property-name.
305305
* E.g. if `<form name="foobar">..</form>` exists, then `document.foobar` refers to that form.
306306
*/

javascript/ql/lib/semmle/javascript/JsonSchema.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module JsonSchema {
5656

5757
/** Provides a model of the `ajv` library. */
5858
module Ajv {
59-
/** A method on `Ajv` that returns `this`. */
59+
/** Gets a method on `Ajv` that returns `this`. */
6060
private string chainedMethod() {
6161
result =
6262
["addSchema", "addMetaSchema", "removeSchema", "addFormat", "addKeyword", "removeKeyword"]
@@ -141,7 +141,7 @@ module JsonSchema {
141141

142142
/** Provides a model for working with the [`joi`](https://npmjs.org/package/joi) library. */
143143
module Joi {
144-
/** A schema created using `joi.object()` or other schemas that might refer an object schema. */
144+
/** Gets a schema created using `joi.object()` or other schemas that might refer an object schema. */
145145
private API::Node objectSchema() {
146146
// A call that creates a schema that might be an object schema.
147147
result =

javascript/ql/lib/semmle/javascript/SSA.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class SsaExplicitDefinition extends SsaDefinition, TExplicitDef {
503503
/** This SSA definition corresponds to the definition of `v` at `def`. */
504504
predicate defines(VarDef d, SsaSourceVariable v) { this = TExplicitDef(_, _, d, v) }
505505

506-
/** The variable definition wrapped by this SSA definition. */
506+
/** Gets the variable definition wrapped by this SSA definition. */
507507
VarDef getDef() { this = TExplicitDef(_, _, result, _) }
508508

509509
/** Gets the basic block to which this definition belongs. */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,16 +787,16 @@ class MemberKind extends string {
787787
}
788788

789789
module MemberKind {
790-
/** The kind of a method, such as `m() {}` */
790+
/** Gets the kind of a method, such as `m() {}` */
791791
MemberKind method() { result = "method" }
792792

793-
/** The kind of a getter accessor, such as `get f() {}`. */
793+
/** Gets the kind of a getter accessor, such as `get f() {}`. */
794794
MemberKind getter() { result = "getter" }
795795

796-
/** The kind of a setter accessor, such as `set f() {}`. */
796+
/** Gets the kind of a setter accessor, such as `set f() {}`. */
797797
MemberKind setter() { result = "setter" }
798798

799-
/** The `getter` and `setter` kinds. */
799+
/** Gets the `getter` and `setter` kinds. */
800800
MemberKind accessor() { result = getter() or result = setter() }
801801

802802
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,13 +804,13 @@ module TaintTracking {
804804
}
805805

806806
/**
807-
* A pseudo-property a `URL` that stores a value that can be obtained
807+
* Gets a pseudo-property a `URL` that stores a value that can be obtained
808808
* with a `get` or `getAll` call to the `searchParams` property.
809809
*/
810810
private string hiddenUrlPseudoProperty() { result = "$hiddenSearchPararms" }
811811

812812
/**
813-
* A pseudo-property on a `URLSearchParams` that can be obtained
813+
* Gets a pseudo-property on a `URLSearchParams` that can be obtained
814814
* with a `get` or `getAll` call.
815815
*/
816816
private string getableUrlPseudoProperty() { result = "$gettableSearchPararms" }

javascript/ql/lib/semmle/javascript/dataflow/internal/FlowSteps.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private module CachedSteps {
480480
}
481481

482482
/**
483-
* A step from `pred` to `succ` through a call to an identity function.
483+
* Holds if there is a step from `pred` to `succ` through a call to an identity function.
484484
*/
485485
cached
486486
predicate identityFunctionStep(DataFlow::Node pred, DataFlow::CallNode succ) {

0 commit comments

Comments
 (0)