Skip to content

Commit ed80089

Browse files
committed
fix some QL-for-QL warnings in JS
1 parent 80cbddf commit ed80089

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointData.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ module FlowFromSource {
188188

189189
Query getQuery() { result = q }
190190

191-
/** The sinks are the endpoints we're extracting. */
191+
/** Holds if `sink` is an endpoint we're extracting. */
192192
override predicate isSink(DataFlow::Node sink) { sink = getAnEndpoint(q) }
193193

194-
/** The sinks are the endpoints we're extracting. */
194+
/** Holds if `sink` is an endpoint we're extracting. */
195195
override predicate isSink(DataFlow::Node sink, DataFlow::FlowLabel lbl) {
196196
sink = getAnEndpoint(q) and exists(lbl)
197197
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ module CallGraph {
190190
}
191191

192192
/**
193-
* Holds if `ref` installs an accessor on an object. Such property writes should not
193+
* Holds if `write` installs an accessor on an object. Such property writes should not
194194
* be considered calls to an accessor.
195195
*/
196196
pragma[nomagic]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ private import AbstractPropertiesImpl
1010
private import AbstractValuesImpl
1111

1212
/**
13-
* Flow analysis for property reads, either explicitly (`x.p` or `x[e]`) or
13+
* An analyzed property read, either explicitly (`x.p` or `x[e]`) or
1414
* implicitly.
1515
*/
1616
abstract class AnalyzedPropertyRead extends DataFlow::AnalyzedNode {
@@ -86,7 +86,7 @@ pragma[noinline]
8686
private predicate isTrackedPropertyName(string prop) { exists(MkAbstractProperty(_, prop)) }
8787

8888
/**
89-
* Flow analysis for property writes, including exports (which are
89+
* An analyzed property write, including exports (which are
9090
* modeled as assignments to `module.exports`).
9191
*/
9292
abstract class AnalyzedPropertyWrite extends DataFlow::Node {

javascript/ql/lib/semmle/javascript/frameworks/AngularJS/AngularJSExpressions.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ abstract private class HtmlAttributeAsNgSourceProvider extends NgSourceProvider,
9292
endColumn = startColumn + src.length() - 1
9393
}
9494

95-
/** The source code of the expression. */
95+
/** Gets the source code of the expression. */
9696
abstract string getSource();
9797

98-
/** The offset into the attribute where the expression starts. */
98+
/** Gets the offset into the attribute where the expression starts. */
9999
abstract int getOffset();
100100

101101
override DOM::ElementDefinition getEnclosingElement() { result = this.getElement() }

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ private module HandlebarsTaintSteps {
6161
* the `FunctionNode` representing `function loudHelper`, and return its parameter `text`.
6262
*/
6363
private DataFlow::ParameterNode getRegisteredHelperParam(
64-
string helperName, DataFlow::FunctionNode helperFunction, int paramIndex
64+
string helperName, DataFlow::FunctionNode func, int paramIndex
6565
) {
6666
exists(DataFlow::CallNode registerHelperCall |
6767
registerHelperCall = any(Handlebars::Handlebars hb).getAMemberCall("registerHelper") and
6868
registerHelperCall.getArgument(0).mayHaveStringValue(helperName) and
69-
helperFunction = registerHelperCall.getArgument(1).getAFunctionValue() and
70-
result = helperFunction.getParameter(paramIndex)
69+
func = registerHelperCall.getArgument(1).getAFunctionValue() and
70+
result = func.getParameter(paramIndex)
7171
)
7272
}
7373

@@ -132,15 +132,15 @@ private module HandlebarsTaintSteps {
132132
private predicate isHandlebarsArgStep(DataFlow::Node pred, DataFlow::Node succ) {
133133
exists(
134134
string helperName, DataFlow::CallNode templatingCall, DataFlow::CallNode compileCall,
135-
DataFlow::FunctionNode helperFunction
135+
DataFlow::FunctionNode func
136136
|
137137
templatingCall = compiledTemplate(compileCall).getACall() and
138138
exists(string templateText, string paramName, int argIdx |
139139
compileCall.getArgument(0).mayHaveStringValue(templateText)
140140
|
141141
pred = templatingCall.getArgument(0).getALocalSource().getAPropertyWrite(paramName).getRhs() and
142142
isTemplateHelperCallArg(templateText, helperName, argIdx, paramName) and
143-
succ = getRegisteredHelperParam(helperName, helperFunction, argIdx)
143+
succ = getRegisteredHelperParam(helperName, func, argIdx)
144144
)
145145
)
146146
}

javascript/ql/src/Expressions/CompareIdenticalValues.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ predicate accessWithConversions(Expr e, Variable v) {
3838
}
3939

4040
/**
41-
* A comment containing the word "NaN".
41+
* Holds if `c` is a comment containing the word "NaN".
4242
*/
4343
predicate isNaNComment(Comment c, string filePath, int startLine) {
4444
c.getText().matches("%NaN%") and

javascript/ql/src/Security/CWE-200/PrivateFileExposure.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Folder getAPackageJsonFolder() { result = any(PackageJson json).getFile().getPar
7676
* the current working folder, or the root folder.
7777
* All of these might cause information to be leaked.
7878
*
79-
* For the first case it is assumed that the presence of a `package.json` file means that a `node_modules` folder can also exist.
79+
* For the first case it is assumed that the presence of a `package.json` file means that a "node_modules" folder can also exist.
8080
*
8181
* For the root/home/working folder, they contain so much information that they must leak information somehow (e.g. ssh keys in the `~/.ssh` folder).
8282
*/

ql/ql/src/queries/style/MissingParameterInQlDoc.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private string getAMentionedNonParameter(Predicate p) {
4646
not result =
4747
[
4848
"true", "false", "NaN", "this", "forall", "exists", "null", "break", "return", "not", "if",
49-
"then", "else", "import"
49+
"then", "else", "import", "async"
5050
] and
5151
not result = any(Aggregate a).getKind() and // min, max, sum, count, etc.
5252
not result = getMentionedThings(p.getLocation().getFile()) and

0 commit comments

Comments
 (0)