use of org.sonar.plugins.html.checks.HtmlIssue in project sonar-web by SonarSource.
the class HtmlSensor method saveMetrics.
private static void saveMetrics(SensorContext context, HtmlSourceCode sourceCode) {
InputFile inputFile = sourceCode.inputFile();
for (Map.Entry<Metric<Integer>, Integer> entry : sourceCode.getMeasures().entrySet()) {
context.<Integer>newMeasure().on(inputFile).forMetric(entry.getKey()).withValue(entry.getValue()).save();
}
for (HtmlIssue issue : sourceCode.getIssues()) {
NewIssue newIssue = context.newIssue().forRule(issue.ruleKey()).gap(issue.cost());
NewIssueLocation location = locationForIssue(inputFile, issue, newIssue);
newIssue.at(location);
newIssue.save();
}
}
Aggregations