use of org.sonar.scanner.externalissue.ReportParser.Location in project sonarqube by SonarSource.
the class ExternalIssueImporter method importIssue.
private boolean importIssue(Issue issue) {
NewExternalIssue externalIssue = context.newExternalIssue().engineId(issue.engineId).ruleId(issue.ruleId).severity(Severity.valueOf(issue.severity)).type(RuleType.valueOf(issue.type));
if (issue.effortMinutes != null) {
externalIssue.remediationEffortMinutes(Long.valueOf(issue.effortMinutes));
}
NewIssueLocation primary = fillLocation(context, externalIssue.newLocation(), issue.primaryLocation);
if (primary != null) {
knownFiles.add(issue.primaryLocation.filePath);
externalIssue.at(primary);
if (issue.secondaryLocations != null) {
for (Location l : issue.secondaryLocations) {
NewIssueLocation secondary = fillLocation(context, externalIssue.newLocation(), l);
if (secondary != null) {
externalIssue.addLocation(secondary);
}
}
}
externalIssue.save();
return true;
} else {
unknownFiles.add(issue.primaryLocation.filePath);
return false;
}
}
Aggregations