Skip to content

Commit 5c256da

Browse files
committed
Feedback incorporation and documentation updates
1 parent f7d63f8 commit 5c256da

7 files changed

Lines changed: 0 additions & 101 deletions

File tree

java/ql/src/semmle/code/java/dataflow/FlowSources.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ private class MessageBodyReaderParameterSource extends RemoteFlowSource {
108108
override string getSourceType() { result = "MessageBodyReader parameter" }
109109
}
110110

111-
<<<<<<< HEAD
112111
private class SpringMultipartRequestSource extends RemoteFlowSource {
113112
SpringMultipartRequestSource() {
114113
exists(MethodAccess ma, Method m |
@@ -129,15 +128,6 @@ class PlayParameterSource extends RemoteFlowSource {
129128
PlayParameterSource() {
130129
exists(PlayActionMethodQueryParameter p | p = this.asParameter()) or
131130
exists(PlayMVCHTTPRequestHeaderMethods m | m.getQueryString().getAnArgument() = this.asExpr())
132-
=======
133-
class PlayParameterSource extends RemoteFlowSource {
134-
PlayParameterSource() {
135-
exists(PlayActionQueryParameter p | p = this.asParameter())
136-
or
137-
exists(PlayHTTPRequestHeaderMethods m |
138-
m.hasName("getQueryString") and m.getAParameter() = this.asParameter()
139-
)
140-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
141131
}
142132

143133
override string getSourceType() { result = "Play Query Parameters" }

java/ql/src/semmle/code/java/frameworks/play/PlayAddCSRFToken.qll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
import java
22

33
/**
4-
<<<<<<< HEAD
54
* Play Framework AddCSRFToken Annotation
65
*
76
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaCsrf
8-
=======
9-
* Play Framework AddCSRFToken
10-
*
11-
* @description Gets the methods using AddCSRFToken annotation.
12-
* (https://www.playframework.com/documentation/2.6.x/JavaBodyParsers#Choosing-an-explicit-body-parser)
13-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
147
*/
158
class PlayAddCSRFTokenAnnotation extends Annotation {
169
PlayAddCSRFTokenAnnotation() {

java/ql/src/semmle/code/java/frameworks/play/PlayAsyncResult.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
import java
22

33
/**
4-
<<<<<<< HEAD
54
* Play Framework Async Promise - Gets the Promise<Result> Generic Member/Type of (play.libs.F)
65
*
76
* Documentation: https://www.playframework.com/documentation/2.5.1/api/java/play/libs/F.Promise.html
8-
=======
9-
* Play Framework Async Promise of Generic Result
10-
*
11-
* @description Gets the Promise<Result> Generic Type of (play.libs.F), This is async in 2.6x and below.
12-
* (https://www.playframework.com/documentation/2.5.1/api/java/play/libs/F.Promise.html)
13-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
147
*/
158
class PlayAsyncResultPromise extends Member {
169
PlayAsyncResultPromise() {
@@ -23,16 +16,9 @@ class PlayAsyncResultPromise extends Member {
2316
}
2417

2518
/**
26-
<<<<<<< HEAD
2719
* Play Framework Async Generic Result - Gets the CompletionStage<Result> Generic Type of (java.util.concurrent)
2820
*
2921
* Documentation: https://www.playframework.com/documentation/2.6.x/JavaAsync
30-
=======
31-
* Play Framework Async Generic Result extending generic promise API called CompletionStage.
32-
*
33-
* @description Gets the CompletionStage<Result> Generic Type of (java.util.concurrent)
34-
* (https://www.playframework.com/documentation/2.6.x/JavaAsync)
35-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
3622
*/
3723
class PlayAsyncResultCompletionStage extends Type {
3824
PlayAsyncResultCompletionStage() {

java/ql/src/semmle/code/java/frameworks/play/PlayBodyParser.qll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
import java
22

33
/**
4-
<<<<<<< HEAD
54
* Play Framework Explicit Body Parser Annotation
65
*
76
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaBodyParsers#Choosing-an-explicit-body-parser
8-
=======
9-
* Play Framework Explicit Body Parser
10-
*
11-
* @description Gets the methods using the explicit body parser annotation. The methods are usually controller action methods
12-
* (https://www.playframework.com/documentation/2.8.x/JavaBodyParsers#Choosing-an-explicit-body-parser)
13-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
147
*/
158
class PlayBodyParserAnnotation extends Annotation {
169
PlayBodyParserAnnotation() { this.getType().hasQualifiedName("play.mvc", "BodyParser<>$Of") }

java/ql/src/semmle/code/java/frameworks/play/PlayController.qll

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,13 @@ import semmle.code.java.frameworks.play.PlayMVCResult
44

55
/**
66
* Play MVC Framework Controller
7-
<<<<<<< HEAD
8-
=======
9-
*
10-
* @description Gets the play.mvc.Controller class
11-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
127
*/
138
class PlayMVCControllerClass extends Class {
149
PlayMVCControllerClass() { this.hasQualifiedName("play.mvc", "Controller") }
1510
}
1611

1712
/**
18-
<<<<<<< HEAD
1913
* Play Framework Controllers which extends/implements PlayMVCController recursively - Used to find all Controllers
20-
=======
21-
* Play Framework Controller which extends/implements
22-
*
23-
* @description Gets the classes which extends play.mvc.controller rescursively.
24-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
2514
*/
2615
class PlayController extends Class {
2716
PlayController() {
@@ -30,7 +19,6 @@ class PlayController extends Class {
3019
}
3120

3221
/**
33-
<<<<<<< HEAD
3422
* Play Framework Controller Action Methods - Mappings to route files
3523
*
3624
* Sample Route - `POST /login @com.linkedin.Application.login()`
@@ -49,13 +37,6 @@ class PlayController extends Class {
4937
* ```
5038
*
5139
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaActions
52-
=======
53-
* Play Framework Controller Action Methods
54-
*
55-
* @description Gets the controller action methods defined against it.
56-
* (https://www.playframework.com/documentation/2.8.x/JavaActions)
57-
* @tip Checking for Public methods usually retrieves direct controller mapped methods defined in routes.
58-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
5940
*/
6041
class PlayControllerActionMethod extends Method {
6142
PlayControllerActionMethod() {
@@ -71,7 +52,6 @@ class PlayControllerActionMethod extends Method {
7152
}
7253

7354
/**
74-
<<<<<<< HEAD
7555
* Play Action-Method parameters. These are a source of user input
7656
*
7757
* Example - Class get's `username` & `password` as valid parameters
@@ -85,12 +65,6 @@ class PlayControllerActionMethod extends Method {
8565
*/
8666
class PlayActionMethodQueryParameter extends Parameter {
8767
PlayActionMethodQueryParameter() {
88-
=======
89-
* Play Action-Method parameters, these are essentially part of routes.
90-
*/
91-
class PlayActionQueryParameter extends Parameter {
92-
PlayActionQueryParameter() {
93-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
9468
exists(PlayControllerActionMethod a |
9569
a.isPublic() and
9670
this = a.getAParameter()

java/ql/src/semmle/code/java/frameworks/play/PlayMVCResult.qll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import java
22

33
/**
4-
<<<<<<< HEAD
54
* Play MVC Framework Result Class
6-
=======
7-
* Play MVC Framework Result
8-
*
9-
* @description Gets the play.mvc.Result class - Used to set a HTTP result with a status code, a set of HTTP headers and a body to be sent to the web client.
10-
* (https://www.playframework.com/documentation/2.8.x/JavaActions)
11-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
125
*/
136
class PlayMVCResultClass extends Class {
147
PlayMVCResultClass() { this.hasQualifiedName("play.mvc", "Result") }
Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import java
22

33
/**
4-
<<<<<<< HEAD
54
* Play MVC Framework Results Class
65
*
76
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaActions
8-
=======
9-
* Play MVC Framework Results
10-
*
11-
* @description Gets the play.mvc.Results class - Helper utilities to generate results
12-
* (https://www.playframework.com/documentation/2.8.x/JavaActions)
13-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
147
*/
158
class PlayMVCResultsClass extends Class {
169
PlayMVCResultsClass() { this.hasQualifiedName("play.mvc", "Results") }
1710
}
1811

1912
/**
20-
<<<<<<< HEAD
2113
* Play Framework mvc.Results Methods - `ok`, `status`, `redirect`
2214
*
2315
* Documentation: https://www.playframework.com/documentation/2.5.8/api/java/play/mvc/Results.html
@@ -37,27 +29,5 @@ class PlayMVCResultsMethods extends Method {
3729
*/
3830
MethodAccess getARedirectAccess() {
3931
this.hasName("redirect") and result = this.getAReference()
40-
=======
41-
* Play Framework mvc.Results Methods
42-
*
43-
* @description Gets the methods of play.mvc.Results like - ok, status, redirect etc.
44-
* (https://www.playframework.com/documentation/2.5.8/api/java/play/mvc/Results.html)
45-
*/
46-
class PlayHTTPResultsMethods extends Method {
47-
PlayHTTPResultsMethods() { this.getDeclaringType() instanceof PlayMVCResultsClass }
48-
49-
/**
50-
* Gets all references to play.mvc.Results ok method
51-
*/
52-
MethodAccess ok() {
53-
exists(MethodAccess ma | ma = this.getAReference() and this.hasName("ok") | result = ma)
54-
}
55-
56-
/**
57-
* Gets all references to play.mvc.Results redirect method
58-
*/
59-
MethodAccess redirect() {
60-
exists(MethodAccess ma | ma = this.getAReference() and this.hasName("redirect") | result = ma)
61-
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
6232
}
6333
}

0 commit comments

Comments
 (0)