Skip to content

Commit 0bd60c1

Browse files
committed
JS: Autoformat
1 parent 12079cd commit 0bd60c1

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

javascript/ql/src/semmle/javascript/JsonSchema.qll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ module JsonSchema {
1818
}
1919

2020
/** A data flow node that is used a JSON schema. */
21-
abstract class SchemaRoot extends DataFlow::Node {
22-
}
21+
abstract class SchemaRoot extends DataFlow::Node { }
2322

2423
/** An object literal with a `$schema` property indicating it is the root of a JSON schema. */
2524
private class SchemaNodeByTag extends SchemaRoot, DataFlow::ObjectLiteralNode {
@@ -35,9 +34,7 @@ module JsonSchema {
3534
or
3635
result = getAPartOfJsonSchema(t.continue()).getAPropertySource()
3736
or
38-
exists(DataFlow::TypeBackTracker t2 |
39-
result = getAPartOfJsonSchema(t2).backtrack(t2, t)
40-
)
37+
exists(DataFlow::TypeBackTracker t2 | result = getAPartOfJsonSchema(t2).backtrack(t2, t))
4138
}
4239

4340
/** Gets a data flow node that is part of a JSON schema. */
@@ -68,7 +65,7 @@ module JsonSchema {
6865
}
6966

7067
/**
71-
* Gets an API node for a function produced by `new Ajv().compile()` or similar.
68+
* Gets an API node for a function produced by `new Ajv().compile()` or similar.
7269
*
7370
* Note that this does not include the instance method `new Ajv().validate` as its
7471
* signature is different.
@@ -83,9 +80,7 @@ module JsonSchema {
8380
* Gets an API node that refers to an error produced by this Ajv instance.
8481
*/
8582
API::Node getAValidationError() {
86-
exists(API::Node base |
87-
base = [ref(), getAValidationFunction()]
88-
|
83+
exists(API::Node base | base = [ref(), getAValidationFunction()] |
8984
result = base.getMember("errors")
9085
or
9186
result = base.getMember("errorsText").getReturn()
@@ -122,7 +117,12 @@ module JsonSchema {
122117

123118
private class AjvSchemaNode extends SchemaRoot {
124119
AjvSchemaNode() {
125-
this = any(Instance i).ref().getMember(["addSchema", "validate", "compile", "compileAsync"]).getParameter(0).getARhs()
120+
this =
121+
any(Instance i)
122+
.ref()
123+
.getMember(["addSchema", "validate", "compile", "compileAsync"])
124+
.getParameter(0)
125+
.getARhs()
126126
}
127127
}
128128
}

javascript/ql/src/semmle/javascript/Regexp.qll

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,12 +866,15 @@ predicate isInterpretedAsRegExp(DataFlow::Node source) {
866866
not exists(PropAccess p | p.getBase() = mce.getEnclosingExpr())
867867
)
868868
or
869-
exists(DataFlow::SourceNode schema |
870-
schema = JsonSchema::getAPartOfJsonSchema()
871-
|
869+
exists(DataFlow::SourceNode schema | schema = JsonSchema::getAPartOfJsonSchema() |
872870
source = schema.getAPropertyWrite("pattern").getRhs()
873871
or
874-
source = schema.getAPropertySource("patternProperties").getAPropertyWrite().getPropertyNameExpr().flow()
872+
source =
873+
schema
874+
.getAPropertySource("patternProperties")
875+
.getAPropertyWrite()
876+
.getPropertyNameExpr()
877+
.flow()
875878
)
876879
)
877880
}

javascript/ql/src/semmle/javascript/security/dataflow/ExceptionXss.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ module ExceptionXss {
156156
this = any(JsonSchema::Ajv::Instance i).getAValidationError().getAnImmediateUse()
157157
}
158158

159-
override string getDescription() {
160-
result = "JSON schema validation error"
161-
}
159+
override string getDescription() { result = "JSON schema validation error" }
162160
}
163161

164162
/**

0 commit comments

Comments
 (0)