diff --git a/javascript/ql/src/AngularJS/IncompatibleService.ql b/javascript/ql/src/AngularJS/IncompatibleService.ql index b2adc1ce44b..dcbc0d2ceaf 100644 --- a/javascript/ql/src/AngularJS/IncompatibleService.ql +++ b/javascript/ql/src/AngularJS/IncompatibleService.ql @@ -134,9 +134,7 @@ where isCompatibleRequestedService(request, compatibleKind) and not isWildcardKind(compatibleKind) | - "'" + compatibleKind + "'", ", " - order by - compatibleKind + "'" + compatibleKind + "'", ", " order by compatibleKind ).regexpReplaceAll(",(?=[^,]+$)", " or") and ( isServiceDirectiveOrFilterFunction(request) and diff --git a/javascript/ql/src/Declarations/UnstableCyclicImport.ql b/javascript/ql/src/Declarations/UnstableCyclicImport.ql index 2fb94eb054a..51006e42ad7 100644 --- a/javascript/ql/src/Declarations/UnstableCyclicImport.ql +++ b/javascript/ql/src/Declarations/UnstableCyclicImport.ql @@ -137,9 +137,7 @@ string pathToModule(Module source, Module destination, int steps) { isImportedAtRuntime(source, mod) and numberOfStepsToModule(mod, destination, steps - 1) | - mod - order by - mod.getName() + mod order by mod.getName() ) and result = repr(getARuntimeImport(source, next)) + " => " + pathToModule(next, destination, steps - 1) diff --git a/javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql b/javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql index 1434c51632f..a05d18b374b 100644 --- a/javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql +++ b/javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql @@ -18,8 +18,8 @@ private predicate isBoundInMethod(MethodDeclaration method) { bindingMethod.getDeclaringClass() = method.getDeclaringClass() and not bindingMethod.isStatic() and thiz.getBinder().getAstNode() = bindingMethod.getBody() - | - exists (DataFlow::MethodCallNode bind, DataFlow::PropWrite w | + | + exists(DataFlow::MethodCallNode bind, DataFlow::PropWrite w | // this[x] = .bind(...) w = thiz.getAPropertyWrite() and not exists(w.getPropertyName()) and diff --git a/javascript/ql/src/LanguageFeatures/InconsistentNew.ql b/javascript/ql/src/LanguageFeatures/InconsistentNew.ql index f4703848cd5..1e07cfd72f8 100644 --- a/javascript/ql/src/LanguageFeatures/InconsistentNew.ql +++ b/javascript/ql/src/LanguageFeatures/InconsistentNew.ql @@ -38,9 +38,7 @@ Function getALikelyCallee(DataFlow::InvokeNode cs, boolean isNew) { result = min(Function callee, int imprecision | callee = cs.getACallee(imprecision) | - callee - order by - imprecision + callee order by imprecision ) and not cs.isUncertain() and not whitelistedCall(cs) and @@ -89,9 +87,7 @@ DataFlow::InvokeNode getFirstInvocation(Function f, boolean isNew) { result = min(DataFlow::InvokeNode invk, string path, int line, int col | f = getALikelyCallee(invk, isNew) and invk.hasLocationInfo(path, line, col, _, _) | - invk - order by - path, line, col + invk order by path, line, col ) } diff --git a/javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql b/javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql index 89d8269e8ab..bd3f9a65e27 100644 --- a/javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql +++ b/javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql @@ -21,9 +21,7 @@ predicate constantInCharacterClass(RegExpCharacterClass recc, int i, RegExpConst cc = rank[i](RegExpConstant cc2, int j | cc2 = recc.getChild(j) and cc2.isCharacter() and cc2.getValue() = val | - cc2 - order by - j + cc2 order by j ) } diff --git a/javascript/ql/src/RegExp/IdentityReplacement.ql b/javascript/ql/src/RegExp/IdentityReplacement.ql index 782372d23b8..3206527330e 100644 --- a/javascript/ql/src/RegExp/IdentityReplacement.ql +++ b/javascript/ql/src/RegExp/IdentityReplacement.ql @@ -59,9 +59,7 @@ predicate regExpMatchesString(RegExpTerm t, string s) { s = concat(int i, RegExpTerm child | child = seq.getChild(i) | - any(string subs | regExpMatchesString(child, subs)) - order by - i + any(string subs | regExpMatchesString(child, subs)) order by i ) ) } diff --git a/javascript/ql/src/Security/CWE-116/DoubleEscaping.ql b/javascript/ql/src/Security/CWE-116/DoubleEscaping.ql index 7bc69c75b6c..5692491ba8b 100644 --- a/javascript/ql/src/Security/CWE-116/DoubleEscaping.ql +++ b/javascript/ql/src/Security/CWE-116/DoubleEscaping.ql @@ -36,9 +36,7 @@ string getStringValue(RegExpLiteral rl) { result = strictconcat(RegExpTerm ch, int i | ch = root.(RegExpSequence).getChild(i) | - ch.(RegExpConstant).getValue() - order by - i + ch.(RegExpConstant).getValue() order by i ) ) } diff --git a/javascript/ql/src/Statements/ImplicitReturn.ql b/javascript/ql/src/Statements/ImplicitReturn.ql index bf187c205c5..b729c678240 100644 --- a/javascript/ql/src/Statements/ImplicitReturn.ql +++ b/javascript/ql/src/Statements/ImplicitReturn.ql @@ -26,16 +26,16 @@ predicate isThrowOrReturn(Stmt s) { /** * A `return` statement with an operand (that is, not just `return;`). */ -class ValueReturn extends ReturnStmt { ValueReturn() { exists(getExpr()) } } +class ValueReturn extends ReturnStmt { + ValueReturn() { exists(getExpr()) } +} /** Gets the lexically first explicit return statement in function `f`. */ ValueReturn getFirstExplicitReturn(Function f) { result = min(ValueReturn ret | ret.getContainer() = f | - ret - order by - ret.getLocation().getStartLine(), ret.getLocation().getStartColumn() + ret order by ret.getLocation().getStartLine(), ret.getLocation().getStartColumn() ) } diff --git a/javascript/ql/src/Statements/UselessConditional.ql b/javascript/ql/src/Statements/UselessConditional.ql index 115f16ef126..ec7718fc4f0 100644 --- a/javascript/ql/src/Statements/UselessConditional.ql +++ b/javascript/ql/src/Statements/UselessConditional.ql @@ -81,7 +81,7 @@ predicate isConstantBooleanReturnValue(Expr e) { ssa.getVariable().getAUse() = e ) ) - | + | ret.(BooleanLiteral).getValue() = b ) ) diff --git a/javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql b/javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql index 0633ef94c21..aa11d69262f 100644 --- a/javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql +++ b/javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql @@ -12,8 +12,10 @@ import javascript from Vue::Instance instance, DataFlow::Node def, DataFlow::FunctionNode arrow, ThisExpr dis -where instance.getABoundFunction() = def and - arrow.flowsTo(def) and - arrow.asExpr() instanceof ArrowFunctionExpr and - arrow.asExpr() = dis.getEnclosingFunction() -select def, "The $@ of this $@ it will not be bound to the Vue instance.", dis, "`this` variable", arrow, "arrow function" +where + instance.getABoundFunction() = def and + arrow.flowsTo(def) and + arrow.asExpr() instanceof ArrowFunctionExpr and + arrow.asExpr() = dis.getEnclosingFunction() +select def, "The $@ of this $@ it will not be bound to the Vue instance.", dis, "`this` variable", + arrow, "arrow function" diff --git a/javascript/ql/test/library-tests/HTML/HtmlScript/ScriptElement_getScript.ql b/javascript/ql/test/library-tests/HTML/HtmlScript/ScriptElement_getScript.ql index 2e1df238261..bc8ea9891c8 100644 --- a/javascript/ql/test/library-tests/HTML/HtmlScript/ScriptElement_getScript.ql +++ b/javascript/ql/test/library-tests/HTML/HtmlScript/ScriptElement_getScript.ql @@ -1,5 +1,4 @@ import javascript - from HTML::ScriptElement e -select e, e.getScript() \ No newline at end of file +select e, e.getScript() diff --git a/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/CheckResolution.ql b/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/CheckResolution.ql index f5ba712e41d..6eb7a3a1972 100644 --- a/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/CheckResolution.ql +++ b/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/CheckResolution.ql @@ -1,6 +1,8 @@ import javascript -abstract class Violation extends ASTNode { abstract string reason(); } +abstract class Violation extends ASTNode { + abstract string reason(); +} /** * Holds for tuples of form `[X, "name1"]` where `X` is a simple type access diff --git a/javascript/ql/test/library-tests/TypeScript/Tokens/PrettyPrintTokens.ql b/javascript/ql/test/library-tests/TypeScript/Tokens/PrettyPrintTokens.ql index 7394b758787..1f5491fc28c 100644 --- a/javascript/ql/test/library-tests/TypeScript/Tokens/PrettyPrintTokens.ql +++ b/javascript/ql/test/library-tests/TypeScript/Tokens/PrettyPrintTokens.ql @@ -10,9 +10,7 @@ string getTokenStringAtLine(File file, int line) { result = concat(Token tok | tok = getATokenAtLine(file, line) | - tok.toString().replaceAll(" ", "~") + " " - order by - tok.getLocation().getStartColumn() + tok.toString().replaceAll(" ", "~") + " " order by tok.getLocation().getStartColumn() ) } diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.ql index 1b08ee7173a..7bbeec43860 100644 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.ql +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.ql @@ -1,6 +1,8 @@ import javascript -abstract class Violation extends ASTNode { abstract string reason(); } +abstract class Violation extends ASTNode { + abstract string reason(); +} class MissingContainer extends Violation, TypeExpr { MissingContainer() { not exists(getContainer()) } diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.ql index 45c1ba53585..28a7b196a71 100644 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.ql +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.ql @@ -3,7 +3,10 @@ import javascript string getKind(ImportTypeExpr imprt) { if imprt.isTypeAccess() then result = "type" - else if imprt.isNamespaceAccess() then result = "namespace" else result = "value" + else + if imprt.isNamespaceAccess() + then result = "namespace" + else result = "value" } from ImportTypeExpr imprt diff --git a/javascript/ql/test/library-tests/frameworks/Vue/Instance.ql b/javascript/ql/test/library-tests/frameworks/Vue/Instance.ql index 6f611acaa27..702e0a48682 100644 --- a/javascript/ql/test/library-tests/frameworks/Vue/Instance.ql +++ b/javascript/ql/test/library-tests/frameworks/Vue/Instance.ql @@ -1,3 +1,3 @@ import javascript -select any(Vue::Instance i) \ No newline at end of file +select any(Vue::Instance i) diff --git a/javascript/ql/test/library-tests/frameworks/Vue/Instance_getAPropertyValue.ql b/javascript/ql/test/library-tests/frameworks/Vue/Instance_getAPropertyValue.ql index 49f01e18e70..ff797e5bf02 100644 --- a/javascript/ql/test/library-tests/frameworks/Vue/Instance_getAPropertyValue.ql +++ b/javascript/ql/test/library-tests/frameworks/Vue/Instance_getAPropertyValue.ql @@ -1,4 +1,4 @@ import javascript from Vue::Instance i, string name -select i, name, i.getAPropertyValue(name) \ No newline at end of file +select i, name, i.getAPropertyValue(name) diff --git a/javascript/ql/test/library-tests/frameworks/Vue/Instance_getOption.ql b/javascript/ql/test/library-tests/frameworks/Vue/Instance_getOption.ql index 5614c398d21..ef98d0e001c 100644 --- a/javascript/ql/test/library-tests/frameworks/Vue/Instance_getOption.ql +++ b/javascript/ql/test/library-tests/frameworks/Vue/Instance_getOption.ql @@ -1,4 +1,4 @@ import javascript from Vue::Instance i, string name -select i, name, i.getOption(name) \ No newline at end of file +select i, name, i.getOption(name) diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.ql index 0abe6622c8c..c62032ba8f3 100644 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.ql +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.ql @@ -1,6 +1,8 @@ import javascript -class CommaToken extends PunctuatorToken { CommaToken() { getValue() = "," } } +class CommaToken extends PunctuatorToken { + CommaToken() { getValue() = "," } +} from CommaToken comma where comma.getNextToken() instanceof CommaToken