Map<MeasureKey, List<ProjectMeasure>> measuresByKey = getDatabaseService(ProjectMeasureService.class)
.getHistory(module.getMavenProject(), metrics);
for (Object o : measuresByKey.entrySet()) {
Map.Entry entry = (Map.Entry) o;
MeasureKey key = (MeasureKey) entry.getKey();
List<ProjectMeasure> measures = (List<ProjectMeasure>) entry.getValue();
List<Double> values = getValues(measures);
TendencyAnalyser analyser = new TendencyAnalyser(values, MAX_DAYS);
Number[] slopeAndLevel = getSlopeAndLevel(analyser, key.getMetric());
if (slopeAndLevel[0] != null && slopeAndLevel[1]!=null) {
module.createTendency(((MeasureKey) key.clone()), (Double) slopeAndLevel[0], (Integer) slopeAndLevel[1], MAX_DAYS);
}
}
}