public class TestCheckContext extends Object implements TreeVisitorContext
| Modifier and Type | Field and Description |
|---|---|
protected static com.sonar.sslr.api.typed.ActionParser<Tree> |
p |
| Constructor and Description |
|---|
TestCheckContext(File file,
org.sonar.api.config.Settings settings,
JavaScriptCheck check) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFileIssue(JavaScriptCheck check,
String message)
Creates an issue at a file level.
|
void |
addIssue(JavaScriptCheck check,
int line,
String message)
Creates an issue.
|
void |
addIssue(JavaScriptCheck check,
int line,
String message,
double cost)
Creates an issue.
|
void |
addIssue(JavaScriptCheck check,
IssueLocation location,
List<IssueLocation> secondaryLocations,
Double cost) |
void |
addIssue(JavaScriptCheck check,
Tree tree,
String message)
Creates an issue.
|
void |
addIssue(JavaScriptCheck check,
Tree tree,
String message,
double cost)
Creates an issue.
|
int |
getComplexity(Tree tree) |
File |
getFile() |
List<org.sonar.squidbridge.api.CheckMessage> |
getIssues() |
String[] |
getPropertyValues(String name)
Fetch project property
|
SymbolModel |
getSymbolModel() |
ScriptTree |
getTopTree() |
protected static final com.sonar.sslr.api.typed.ActionParser<Tree> p
public TestCheckContext(File file, org.sonar.api.config.Settings settings, JavaScriptCheck check)
public ScriptTree getTopTree()
getTopTree in interface TreeVisitorContextpublic void addIssue(JavaScriptCheck check, Tree tree, String message)
TreeVisitorContextaddIssue in interface TreeVisitorContextcheck - instance of the check that creates the issue.tree - the tree on which the issue should be raise. Means the issue will be raised on its corresponding line in the source code.message - the issue message.public void addIssue(JavaScriptCheck check, int line, String message)
TreeVisitorContextaddIssue in interface TreeVisitorContextcheck - instance of the check that create the issueline - source line on which the issue should be raisedmessage - the issue messagepublic void addFileIssue(JavaScriptCheck check, String message)
TreeVisitorContextaddFileIssue in interface TreeVisitorContextcheck - instance of the check that create the issuemessage - the issue messagepublic void addIssue(JavaScriptCheck check, Tree tree, String message, double cost)
TreeVisitorContextaddIssue in interface TreeVisitorContextcheck - instance of the check that create the issuetree - the tree on which the issue should be raise. Means the issue will be raised on its corresponding line in the source code.message - the issue messagecost - specific remediation cost for the issue, used to compute the technical debtpublic void addIssue(JavaScriptCheck check, int line, String message, double cost)
TreeVisitorContextaddIssue in interface TreeVisitorContextcheck - instance of the check that create the issueline - source line on which the issue should be raisedmessage - the issue messagecost - specific remediation cost for the issue, used to compute the technical debtpublic void addIssue(JavaScriptCheck check, IssueLocation location, List<IssueLocation> secondaryLocations, Double cost)
addIssue in interface TreeVisitorContextpublic File getFile()
getFile in interface TreeVisitorContextpublic SymbolModel getSymbolModel()
getSymbolModel in interface TreeVisitorContextpublic String[] getPropertyValues(String name)
TreeVisitorContextgetPropertyValues in interface TreeVisitorContextname - property keypublic int getComplexity(Tree tree)
getComplexity in interface TreeVisitorContextpublic List<org.sonar.squidbridge.api.CheckMessage> getIssues()
Copyright © 2011–2015 SonarSource and Eriks Nukis. All rights reserved.