Feedback incorporation and documentation updates

This commit is contained in:
Francis Alexander
2020-10-22 20:27:38 +05:30
parent f7d63f8666
commit 5c256dadc8
7 changed files with 0 additions and 101 deletions

View File

@@ -108,7 +108,6 @@ private class MessageBodyReaderParameterSource extends RemoteFlowSource {
override string getSourceType() { result = "MessageBodyReader parameter" }
}
<<<<<<< HEAD
private class SpringMultipartRequestSource extends RemoteFlowSource {
SpringMultipartRequestSource() {
exists(MethodAccess ma, Method m |
@@ -129,15 +128,6 @@ class PlayParameterSource extends RemoteFlowSource {
PlayParameterSource() {
exists(PlayActionMethodQueryParameter p | p = this.asParameter()) or
exists(PlayMVCHTTPRequestHeaderMethods m | m.getQueryString().getAnArgument() = this.asExpr())
=======
class PlayParameterSource extends RemoteFlowSource {
PlayParameterSource() {
exists(PlayActionQueryParameter p | p = this.asParameter())
or
exists(PlayHTTPRequestHeaderMethods m |
m.hasName("getQueryString") and m.getAParameter() = this.asParameter()
)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
}
override string getSourceType() { result = "Play Query Parameters" }

View File

@@ -1,16 +1,9 @@
import java
/**
<<<<<<< HEAD
* Play Framework AddCSRFToken Annotation
*
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaCsrf
=======
* Play Framework AddCSRFToken
*
* @description Gets the methods using AddCSRFToken annotation.
* (https://www.playframework.com/documentation/2.6.x/JavaBodyParsers#Choosing-an-explicit-body-parser)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayAddCSRFTokenAnnotation extends Annotation {
PlayAddCSRFTokenAnnotation() {

View File

@@ -1,16 +1,9 @@
import java
/**
<<<<<<< HEAD
* Play Framework Async Promise - Gets the Promise<Result> Generic Member/Type of (play.libs.F)
*
* Documentation: https://www.playframework.com/documentation/2.5.1/api/java/play/libs/F.Promise.html
=======
* Play Framework Async Promise of Generic Result
*
* @description Gets the Promise<Result> Generic Type of (play.libs.F), This is async in 2.6x and below.
* (https://www.playframework.com/documentation/2.5.1/api/java/play/libs/F.Promise.html)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayAsyncResultPromise extends Member {
PlayAsyncResultPromise() {
@@ -23,16 +16,9 @@ class PlayAsyncResultPromise extends Member {
}
/**
<<<<<<< HEAD
* Play Framework Async Generic Result - Gets the CompletionStage<Result> Generic Type of (java.util.concurrent)
*
* Documentation: https://www.playframework.com/documentation/2.6.x/JavaAsync
=======
* Play Framework Async Generic Result extending generic promise API called CompletionStage.
*
* @description Gets the CompletionStage<Result> Generic Type of (java.util.concurrent)
* (https://www.playframework.com/documentation/2.6.x/JavaAsync)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayAsyncResultCompletionStage extends Type {
PlayAsyncResultCompletionStage() {

View File

@@ -1,16 +1,9 @@
import java
/**
<<<<<<< HEAD
* Play Framework Explicit Body Parser Annotation
*
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaBodyParsers#Choosing-an-explicit-body-parser
=======
* Play Framework Explicit Body Parser
*
* @description Gets the methods using the explicit body parser annotation. The methods are usually controller action methods
* (https://www.playframework.com/documentation/2.8.x/JavaBodyParsers#Choosing-an-explicit-body-parser)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayBodyParserAnnotation extends Annotation {
PlayBodyParserAnnotation() { this.getType().hasQualifiedName("play.mvc", "BodyParser<>$Of") }

View File

@@ -4,24 +4,13 @@ import semmle.code.java.frameworks.play.PlayMVCResult
/**
* Play MVC Framework Controller
<<<<<<< HEAD
=======
*
* @description Gets the play.mvc.Controller class
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayMVCControllerClass extends Class {
PlayMVCControllerClass() { this.hasQualifiedName("play.mvc", "Controller") }
}
/**
<<<<<<< HEAD
* Play Framework Controllers which extends/implements PlayMVCController recursively - Used to find all Controllers
=======
* Play Framework Controller which extends/implements
*
* @description Gets the classes which extends play.mvc.controller rescursively.
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayController extends Class {
PlayController() {
@@ -30,7 +19,6 @@ class PlayController extends Class {
}
/**
<<<<<<< HEAD
* Play Framework Controller Action Methods - Mappings to route files
*
* Sample Route - `POST /login @com.linkedin.Application.login()`
@@ -49,13 +37,6 @@ class PlayController extends Class {
* ```
*
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaActions
=======
* Play Framework Controller Action Methods
*
* @description Gets the controller action methods defined against it.
* (https://www.playframework.com/documentation/2.8.x/JavaActions)
* @tip Checking for Public methods usually retrieves direct controller mapped methods defined in routes.
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayControllerActionMethod extends Method {
PlayControllerActionMethod() {
@@ -71,7 +52,6 @@ class PlayControllerActionMethod extends Method {
}
/**
<<<<<<< HEAD
* Play Action-Method parameters. These are a source of user input
*
* Example - Class get's `username` & `password` as valid parameters
@@ -85,12 +65,6 @@ class PlayControllerActionMethod extends Method {
*/
class PlayActionMethodQueryParameter extends Parameter {
PlayActionMethodQueryParameter() {
=======
* Play Action-Method parameters, these are essentially part of routes.
*/
class PlayActionQueryParameter extends Parameter {
PlayActionQueryParameter() {
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
exists(PlayControllerActionMethod a |
a.isPublic() and
this = a.getAParameter()

View File

@@ -1,14 +1,7 @@
import java
/**
<<<<<<< HEAD
* Play MVC Framework Result Class
=======
* Play MVC Framework Result
*
* @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.
* (https://www.playframework.com/documentation/2.8.x/JavaActions)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayMVCResultClass extends Class {
PlayMVCResultClass() { this.hasQualifiedName("play.mvc", "Result") }

View File

@@ -1,23 +1,15 @@
import java
/**
<<<<<<< HEAD
* Play MVC Framework Results Class
*
* Documentation: https://www.playframework.com/documentation/2.8.x/JavaActions
=======
* Play MVC Framework Results
*
* @description Gets the play.mvc.Results class - Helper utilities to generate results
* (https://www.playframework.com/documentation/2.8.x/JavaActions)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
*/
class PlayMVCResultsClass extends Class {
PlayMVCResultsClass() { this.hasQualifiedName("play.mvc", "Results") }
}
/**
<<<<<<< HEAD
* Play Framework mvc.Results Methods - `ok`, `status`, `redirect`
*
* Documentation: https://www.playframework.com/documentation/2.5.8/api/java/play/mvc/Results.html
@@ -37,27 +29,5 @@ class PlayMVCResultsMethods extends Method {
*/
MethodAccess getARedirectAccess() {
this.hasName("redirect") and result = this.getAReference()
=======
* Play Framework mvc.Results Methods
*
* @description Gets the methods of play.mvc.Results like - ok, status, redirect etc.
* (https://www.playframework.com/documentation/2.5.8/api/java/play/mvc/Results.html)
*/
class PlayHTTPResultsMethods extends Method {
PlayHTTPResultsMethods() { this.getDeclaringType() instanceof PlayMVCResultsClass }
/**
* Gets all references to play.mvc.Results ok method
*/
MethodAccess ok() {
exists(MethodAccess ma | ma = this.getAReference() and this.hasName("ok") | result = ma)
}
/**
* Gets all references to play.mvc.Results redirect method
*/
MethodAccess redirect() {
exists(MethodAccess ma | ma = this.getAReference() and this.hasName("redirect") | result = ma)
>>>>>>> fa523e456f96493dcc08b819ad4bd620cca789b8
}
}