use of com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType in project hub-detect by blackducksoftware.
the class CodeLocationDependencyCounter method aggregateCountsByGroup.
public Map<DetectCodeLocationType, Integer> aggregateCountsByGroup(final Map<DetectCodeLocation, Integer> codeLocations) {
final Map<DetectCodeLocationType, Integer> dependencyCounts = new HashMap<>();
for (final Entry<DetectCodeLocation, Integer> countEntry : codeLocations.entrySet()) {
final DetectCodeLocationType group = countEntry.getKey().getCodeLocationType();
if (!dependencyCounts.containsKey(group)) {
dependencyCounts.put(group, 0);
}
dependencyCounts.put(group, dependencyCounts.get(group) + countEntry.getValue());
}
return dependencyCounts;
}
use of com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType in project hub-detect by blackducksoftware.
the class CodeLocationReporter method writeBomToolCounts.
private void writeBomToolCounts(final ReportWriter writer, final Map<DetectCodeLocationType, Integer> dependencyCounts) {
for (final DetectCodeLocationType group : dependencyCounts.keySet()) {
final Integer count = dependencyCounts.get(group);
writer.writeLine(group.toString() + " : " + count);
}
}
Aggregations