use of org.sonar.plugins.html.checks.PreciseHtmlIssue in project sonar-web by SonarSource.
the class HtmlSensor method locationForIssue.
private static NewIssueLocation locationForIssue(InputFile inputFile, HtmlIssue issue, NewIssue newIssue) {
NewIssueLocation location = newIssue.newLocation().on(inputFile).message(issue.message());
Integer line = issue.line();
if (issue instanceof PreciseHtmlIssue) {
PreciseHtmlIssue preciseHtmlIssue = (PreciseHtmlIssue) issue;
location.at(inputFile.newRange(issue.line(), preciseHtmlIssue.startColumn(), preciseHtmlIssue.endLine(), preciseHtmlIssue.endColumn()));
} else if (line != null) {
location.at(inputFile.selectLine(line));
}
return location;
}
Aggregations