Package org.sonar.plugins.javascript.api
Interface JavaScriptCheck
-
- All Known Implementing Classes:
DoubleDispatchVisitorCheck,ExecutableLineVisitor,SeCheck,SeChecksDispatcher,SubscriptionVisitorCheck
@Beta public interface JavaScriptCheckMarker interface for all JavaScript checks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description PreciseIssueaddIssue(Tree tree, String message)Returns new issue which is instance ofPreciseIssue.<T extends Issue>
TaddIssue(T issue)Use this method only to add specific kind of issue.LineIssueaddLineIssue(Tree tree, String message)Deprecated.since 2.14 useaddIssue(Issue)List<Issue>scanFile(TreeVisitorContext context)
-
-
-
Method Detail
-
addLineIssue
@Deprecated LineIssue addLineIssue(Tree tree, String message)
Deprecated.since 2.14 useaddIssue(Issue)Returns new issue which is located on first line oftree
-
addIssue
PreciseIssue addIssue(Tree tree, String message)
Returns new issue which is instance ofPreciseIssue. 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) orPreciseIssue.secondary(IssueLocation)to add secondary locationPreciseIssue.cost(double)to add cost
See example
To create new issue you also can usenewIssue(functionDeclaration, "Remove this function declaration") .secondary(call, "Function call") .secondary(redefinition, "Function redefinition") .cost(functionDeclaration.parameters().parameters().size());addIssue(Issue):getContext().addIssue(new FileIssue(this, "Some message"))
- Parameters:
tree- primary location of issuemessage- primary message- Returns:
- new issue
-
addIssue
<T extends Issue> T addIssue(T issue)
Use this method only to add specific kind of issue. E.g. you can use this method to add issue on file level, line issue or precise issue with sophisticated primary location.Otherwise please use
addIssue(Tree, String)
-
scanFile
List<Issue> scanFile(TreeVisitorContext context)
-
-