public class SeCheck extends Object implements JavaScriptCheck
| Constructor and Description |
|---|
SeCheck() |
| Modifier and Type | Method and Description |
|---|---|
<T extends Issue> |
addIssue(T issue)
Use this method only to add specific kind of issue.
|
PreciseIssue |
addIssue(Tree tree,
String message)
Returns new issue which is instance of
PreciseIssue. |
LineIssue |
addLineIssue(Tree tree,
String message)
Deprecated.
|
void |
afterBlockElement(ProgramState currentState,
Tree element)
Override this method to perform actions after executing
element. |
void |
beforeBlockElement(ProgramState currentState,
Tree element)
Override this method to perform actions before executing
element. |
void |
checkConditions(Map<Tree,Collection<Truthiness>> conditions)
Override this method to check the truthiness of conditions in current execution (aka function scope).
|
void |
endOfExecution(Scope functionScope)
Override this method to perform actions when the execution is finished.
|
List<Issue> |
scanFile(TreeVisitorContext context) |
void |
startOfExecution(Scope functionScope)
Override this method to perform actions before the start of execution.
|
public void checkConditions(Map<Tree,Collection<Truthiness>> conditions)
public void beforeBlockElement(ProgramState currentState, Tree element)
element.
This method is called before each element until end of execution or reaching the execution limit.currentState - current state at the program point preceding elementelement - syntax tree to be executed nextpublic void afterBlockElement(ProgramState currentState, Tree element)
element.
This method is called after each element until end of execution or reaching the execution limit.currentState - current state at the program point following elementelement - last executed syntax treepublic void endOfExecution(Scope functionScope)
functionScope - scope corresponding to the function which was executedpublic void startOfExecution(Scope functionScope)
functionScope - scope corresponding to the function which will be executed@Deprecated public LineIssue addLineIssue(Tree tree, String message)
JavaScriptCheck.addLineIssue(Tree, String)JavaScriptChecktreeaddLineIssue in interface JavaScriptCheckpublic PreciseIssue addIssue(Tree tree, String message)
JavaScriptCheckPreciseIssue. Then you can chain this method with following method calls to provide more information about issue:
PreciseIssue.secondary(Tree, String), PreciseIssue.secondary(Tree) (without message) or
PreciseIssue.secondary(IssueLocation) to add secondary locationPreciseIssue.cost(double) to add costSee example
newIssue(functionDeclaration, "Remove this function declaration")
.secondary(call, "Function call")
.secondary(redefinition, "Function redefinition")
.cost(functionDeclaration.parameters().parameters().size());
To create new issue you also can use JavaScriptCheck.addIssue(Issue): getContext().addIssue(new FileIssue(this, "Some message"))
addIssue in interface JavaScriptChecktree - primary location of issuemessage - primary messagepublic <T extends Issue> T addIssue(T issue)
JavaScriptCheck
Otherwise please use JavaScriptCheck.addIssue(Tree, String)
addIssue in interface JavaScriptCheckpublic List<Issue> scanFile(TreeVisitorContext context)
scanFile in interface JavaScriptCheckCopyright © 2011–2016 SonarSource and Eriks Nukis. All rights reserved.