use of org.sonar.db.protobuf.DbIssues.Locations in project sonarqube by SonarSource.
the class ShowAction method formatFlows.
private void formatFlows(DbSession dbSession, ShowWsResponse.Builder hotspotBuilder, IssueDto hotspot) {
DbIssues.Locations locations = hotspot.parseLocations();
if (locations == null) {
return;
}
Set<String> componentUuids = readComponentUuidsFromLocations(hotspot, locations);
Map<String, ComponentDto> componentsByUuids = loadComponents(dbSession, componentUuids);
for (DbIssues.Flow flow : locations.getFlowList()) {
Common.Flow.Builder targetFlow = Common.Flow.newBuilder();
for (DbIssues.Location flowLocation : flow.getLocationList()) {
targetFlow.addLocations(textRangeFormatter.formatLocation(flowLocation, hotspotBuilder.getComponent().getKey(), componentsByUuids));
}
hotspotBuilder.addFlows(targetFlow.build());
}
}
Aggregations