Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1182fca

Browse files
committed
Javascript: Autoformat qls
1 parent 2546963 commit 1182fca

19 files changed

Lines changed: 39 additions & 45 deletions

File tree

javascript/ql/src/AngularJS/IncompatibleService.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ where
134134
isCompatibleRequestedService(request, compatibleKind) and
135135
not isWildcardKind(compatibleKind)
136136
|
137-
"'" + compatibleKind + "'", ", "
138-
order by
139-
compatibleKind
137+
"'" + compatibleKind + "'", ", " order by compatibleKind
140138
).regexpReplaceAll(",(?=[^,]+$)", " or") and
141139
(
142140
isServiceDirectiveOrFilterFunction(request) and

javascript/ql/src/Declarations/UnstableCyclicImport.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ string pathToModule(Module source, Module destination, int steps) {
137137
isImportedAtRuntime(source, mod) and
138138
numberOfStepsToModule(mod, destination, steps - 1)
139139
|
140-
mod
141-
order by
142-
mod.getName()
140+
mod order by mod.getName()
143141
) and
144142
result = repr(getARuntimeImport(source, next)) + " => " +
145143
pathToModule(next, destination, steps - 1)

javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ private predicate isBoundInMethod(MethodDeclaration method) {
1818
bindingMethod.getDeclaringClass() = method.getDeclaringClass() and
1919
not bindingMethod.isStatic() and
2020
thiz.getBinder().getAstNode() = bindingMethod.getBody()
21-
|
22-
exists (DataFlow::MethodCallNode bind, DataFlow::PropWrite w |
21+
|
22+
exists(DataFlow::MethodCallNode bind, DataFlow::PropWrite w |
2323
// this[x] = <expr>.bind(...)
2424
w = thiz.getAPropertyWrite() and
2525
not exists(w.getPropertyName()) and

javascript/ql/src/LanguageFeatures/InconsistentNew.ql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ Function getALikelyCallee(DataFlow::InvokeNode cs, boolean isNew) {
3838
result = min(Function callee, int imprecision |
3939
callee = cs.getACallee(imprecision)
4040
|
41-
callee
42-
order by
43-
imprecision
41+
callee order by imprecision
4442
) and
4543
not cs.isUncertain() and
4644
not whitelistedCall(cs) and
@@ -89,9 +87,7 @@ DataFlow::InvokeNode getFirstInvocation(Function f, boolean isNew) {
8987
result = min(DataFlow::InvokeNode invk, string path, int line, int col |
9088
f = getALikelyCallee(invk, isNew) and invk.hasLocationInfo(path, line, col, _, _)
9189
|
92-
invk
93-
order by
94-
path, line, col
90+
invk order by path, line, col
9591
)
9692
}
9793

javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ predicate constantInCharacterClass(RegExpCharacterClass recc, int i, RegExpConst
2121
cc = rank[i](RegExpConstant cc2, int j |
2222
cc2 = recc.getChild(j) and cc2.isCharacter() and cc2.getValue() = val
2323
|
24-
cc2
25-
order by
26-
j
24+
cc2 order by j
2725
)
2826
}
2927

javascript/ql/src/RegExp/IdentityReplacement.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ predicate regExpMatchesString(RegExpTerm t, string s) {
5959
s = concat(int i, RegExpTerm child |
6060
child = seq.getChild(i)
6161
|
62-
any(string subs | regExpMatchesString(child, subs))
63-
order by
64-
i
62+
any(string subs | regExpMatchesString(child, subs)) order by i
6563
)
6664
)
6765
}

javascript/ql/src/Security/CWE-116/DoubleEscaping.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ string getStringValue(RegExpLiteral rl) {
3636
result = strictconcat(RegExpTerm ch, int i |
3737
ch = root.(RegExpSequence).getChild(i)
3838
|
39-
ch.(RegExpConstant).getValue()
40-
order by
41-
i
39+
ch.(RegExpConstant).getValue() order by i
4240
)
4341
)
4442
}

javascript/ql/src/Statements/ImplicitReturn.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ predicate isThrowOrReturn(Stmt s) {
2626
/**
2727
* A `return` statement with an operand (that is, not just `return;`).
2828
*/
29-
class ValueReturn extends ReturnStmt { ValueReturn() { exists(getExpr()) } }
29+
class ValueReturn extends ReturnStmt {
30+
ValueReturn() { exists(getExpr()) }
31+
}
3032

3133
/** Gets the lexically first explicit return statement in function `f`. */
3234
ValueReturn getFirstExplicitReturn(Function f) {
3335
result = min(ValueReturn ret |
3436
ret.getContainer() = f
3537
|
36-
ret
37-
order by
38-
ret.getLocation().getStartLine(), ret.getLocation().getStartColumn()
38+
ret order by ret.getLocation().getStartLine(), ret.getLocation().getStartColumn()
3939
)
4040
}
4141

javascript/ql/src/Statements/UselessConditional.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ predicate isConstantBooleanReturnValue(Expr e) {
8181
ssa.getVariable().getAUse() = e
8282
)
8383
)
84-
|
84+
|
8585
ret.(BooleanLiteral).getValue() = b
8686
)
8787
)

javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
import javascript
1313

1414
from Vue::Instance instance, DataFlow::Node def, DataFlow::FunctionNode arrow, ThisExpr dis
15-
where instance.getABoundFunction() = def and
16-
arrow.flowsTo(def) and
17-
arrow.asExpr() instanceof ArrowFunctionExpr and
18-
arrow.asExpr() = dis.getEnclosingFunction()
19-
select def, "The $@ of this $@ it will not be bound to the Vue instance.", dis, "`this` variable", arrow, "arrow function"
15+
where
16+
instance.getABoundFunction() = def and
17+
arrow.flowsTo(def) and
18+
arrow.asExpr() instanceof ArrowFunctionExpr and
19+
arrow.asExpr() = dis.getEnclosingFunction()
20+
select def, "The $@ of this $@ it will not be bound to the Vue instance.", dis, "`this` variable",
21+
arrow, "arrow function"

0 commit comments

Comments
 (0)