@Beta
public interface JavaScriptCheck
| 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).
|
TreeVisitorContext |
getContext() |
List<Issue> |
scanFile(TreeVisitorContext context) |
TreeVisitorContext getContext()
LineIssue addLineIssue(Tree tree, String message)
Instead please use addIssue(Tree, String)
PreciseIssue addIssue(Tree tree, String message)
PreciseIssue. 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 addIssue(Issue): getContext().addIssue(new FileIssue(this, "Some message"))
tree - primary location of issuemessage - primary message<T extends Issue> T addIssue(T issue)
Otherwise please use:
addIssue(Tree, String) for precise issue (see PreciseIssue)addLineIssue(Tree, String) for line issue (see LineIssue)List<Issue> scanFile(TreeVisitorContext context)
Copyright © 2011–2016 SonarSource and Eriks Nukis. All rights reserved.