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 (when listed below methods don't meet your needs).
|
PreciseIssue |
addIssue(Tree tree,
String message)
Returns new issue which is instance of
PreciseIssue. |
LineIssue |
addLineIssue(Tree tree,
String message)
This method should be deprecated, as soon as this plugin will be migrated on 5.X LTS (with support of precise issue locations).
|
void |
afterBlockElement(ProgramState currentState,
Tree element) |
void |
beforeBlockElement(ProgramState currentState,
Tree element) |
void |
checkConditions(Map<Tree,Collection<Truthiness>> conditions) |
void |
endOfExecution(Scope functionScope)
Method is called when the execution finished before reaching limit
|
List<Issue> |
scanFile(TreeVisitorContext context) |
void |
startOfExecution(Scope functionScope) |
public void checkConditions(Map<Tree,Collection<Truthiness>> conditions)
public void beforeBlockElement(ProgramState currentState, Tree element)
public void afterBlockElement(ProgramState currentState, Tree element)
public void endOfExecution(Scope functionScope)
public void startOfExecution(Scope functionScope)
public LineIssue addLineIssue(Tree tree, String message)
JavaScriptCheck
Instead please use JavaScriptCheck.addIssue(Tree, String)
addLineIssue 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)
JavaScriptCheckOtherwise please use:
JavaScriptCheck.addIssue(Tree, String) for precise issue (see PreciseIssue)JavaScriptCheck.addLineIssue(Tree, String) for line issue (see LineIssue)addIssue in interface JavaScriptCheckpublic List<Issue> scanFile(TreeVisitorContext context)
scanFile in interface JavaScriptCheckCopyright © 2011–2016 SonarSource and Eriks Nukis. All rights reserved.