Skip to content

Commit b3d8b95

Browse files
committed
JS: Autoformat
1 parent ca6cd18 commit b3d8b95

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

javascript/ql/src/semmle/javascript/frameworks/Angular2.qll

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ private import semmle.javascript.DynamicPropertyAccess
1313
*/
1414
module Angular2 {
1515
/** Gets a reference to a `Router` object. */
16-
DataFlow::SourceNode router() {
17-
result.hasUnderlyingType("@angular/router", "Router")
18-
}
16+
DataFlow::SourceNode router() { result.hasUnderlyingType("@angular/router", "Router") }
1917

2018
/** Gets a reference to a `RouterState` object. */
2119
DataFlow::SourceNode routerState() {
@@ -60,13 +58,15 @@ module Angular2 {
6058
result = activatedRouteSnapshot().getAPropertyRead("data").getAPropertyRead(name)
6159
or
6260
// this.route.foo.subscribe(foo => { ... })
63-
result = activatedRoute().getAPropertyRead(name).getAMethodCall("subscribe").getABoundCallbackParameter(0, 0)
61+
result =
62+
activatedRoute()
63+
.getAPropertyRead(name)
64+
.getAMethodCall("subscribe")
65+
.getABoundCallbackParameter(0, 0)
6466
}
6567

6668
/** Gets an array of URL segments matched by some route. */
67-
private DataFlow::SourceNode urlSegmentArray() {
68-
result = activatedRouteProp("url")
69-
}
69+
private DataFlow::SourceNode urlSegmentArray() { result = activatedRouteProp("url") }
7070

7171
/** Gets a data flow node referring to a `UrlSegment` object matched by some route. */
7272
DataFlow::SourceNode urlSegment() {
@@ -115,9 +115,7 @@ module Angular2 {
115115
this = routerStateSnapshot().getAPropertyRead("url")
116116
}
117117

118-
override string getSourceType() {
119-
result = "Angular route parameter"
120-
}
118+
override string getSourceType() { result = "Angular route parameter" }
121119
}
122120

123121
/** Gets a reference to a `DomSanitizer` object. */
@@ -127,20 +125,32 @@ module Angular2 {
127125

128126
/** A value that is about to be promoted to a trusted HTML or CSS value. */
129127
private class AngularXssSink extends DomBasedXss::Sink {
130-
AngularXssSink() { this = domSanitizer().getAMethodCall(["bypassSecurityTrustHtml", "bypassSecurityTrustStyle"]).getArgument(0) }
128+
AngularXssSink() {
129+
this =
130+
domSanitizer()
131+
.getAMethodCall(["bypassSecurityTrustHtml", "bypassSecurityTrustStyle"])
132+
.getArgument(0)
133+
}
131134
}
132135

133136
/** A value that is about to be promoted to a trusted script value. */
134137
private class AngularCodeInjectionSink extends CodeInjection::Sink {
135-
AngularCodeInjectionSink() { this = domSanitizer().getAMethodCall(["bypassSecurityTrustScript"]).getArgument(0) }
138+
AngularCodeInjectionSink() {
139+
this = domSanitizer().getAMethodCall(["bypassSecurityTrustScript"]).getArgument(0)
140+
}
136141
}
137142

138143
/**
139144
* A value that is about to be promoted to a trusted URL or resource URL value.
140145
*/
141146
private class AngularUrlSink extends ClientSideUrlRedirect::Sink {
142147
// We mark this as a client URL redirect sink for precision reasons, though its description can be a bit confusing.
143-
AngularUrlSink() { this = domSanitizer().getAMethodCall(["bypassSecurityTrustUrl", "bypassSecurityTrustResourceUrl"]).getArgument(0) }
148+
AngularUrlSink() {
149+
this =
150+
domSanitizer()
151+
.getAMethodCall(["bypassSecurityTrustUrl", "bypassSecurityTrustResourceUrl"])
152+
.getArgument(0)
153+
}
144154
}
145155

146156
private predicate taintStep(DataFlow::Node pred, DataFlow::Node succ) {
@@ -155,13 +165,9 @@ module Angular2 {
155165
}
156166

157167
private class AngularTaintStep extends TaintTracking::AdditionalTaintStep {
158-
AngularTaintStep() {
159-
taintStep(_, this)
160-
}
168+
AngularTaintStep() { taintStep(_, this) }
161169

162-
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
163-
taintStep(pred, succ)
164-
}
170+
override predicate step(DataFlow::Node pred, DataFlow::Node succ) { taintStep(pred, succ) }
165171
}
166172

167173
/** Gets a reference to an `HttpClient` object. */
@@ -180,13 +186,9 @@ module Angular2 {
180186
argumentOffset = 0
181187
}
182188

183-
override DataFlow::Node getUrl() {
184-
result = getArgument(argumentOffset)
185-
}
189+
override DataFlow::Node getUrl() { result = getArgument(argumentOffset) }
186190

187-
override DataFlow::Node getHost() {
188-
none()
189-
}
191+
override DataFlow::Node getHost() { none() }
190192

191193
override DataFlow::Node getADataNode() {
192194
getMethodName() = ["patch", "post", "put"] and
@@ -207,8 +209,6 @@ module Angular2 {
207209

208210
/** A reference to the DOM location obtained through `DomAdapter.getLocation()`. */
209211
private class DomAdapterLocation extends DOM::LocationSource::Range {
210-
DomAdapterLocation() {
211-
this = domAdapter().getAMethodCall("getLocation")
212-
}
212+
DomAdapterLocation() { this = domAdapter().getAMethodCall("getLocation") }
213213
}
214214
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module InsecureDownload {
1818
private class ConcreteSensitiveInsecureURL extends Label::SensitiveInsecureURL {
1919
ConcreteSensitiveInsecureURL() { this = this }
2020
}
21+
2122
private class ConcreteInsecureURL extends Label::InsecureURL {
2223
ConcreteInsecureURL() { this = this }
2324
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module TaintedPath {
1616
private class ConcretePosixPath extends Label::PosixPath {
1717
ConcretePosixPath() { this = this }
1818
}
19+
1920
private class ConcreteSplitPath extends Label::SplitPath {
2021
ConcreteSplitPath() { this = this }
2122
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module UnvalidatedDynamicMethodCall {
2121
private class ConcreteMaybeNonFunction extends MaybeNonFunction {
2222
ConcreteMaybeNonFunction() { this = this }
2323
}
24+
2425
private class ConcreteMaybeFromProto extends MaybeFromProto {
2526
ConcreteMaybeFromProto() { this = this }
2627
}

0 commit comments

Comments
 (0)