.collect(Collectors.toSet());
}
- private Consumer<LiveMeasureDto> configureLiveMeasure(String language, MetricDto metric, ProjectDto project, ComponentDto componentDto) {
+ private Consumer<LiveMeasureDto> configureLiveMeasure(String language, MetricDto metric, ComponentDto componentDto) {
return liveMeasure -> liveMeasure
.setMetricUuid(metric.getUuid())
.setComponentUuid(componentDto.uuid())
- .setProjectUuid(project.getUuid())
+ .setProjectUuid(componentDto.uuid())
.setData(language + "=" + random.nextInt(10));
}
private Consumer<ProjectData> insertLiveMeasure(String language, MetricDto metric) {
return (projectData) -> db.measures().insertLiveMeasure(projectData.getMainBranchComponent(), metric,
- configureLiveMeasure(language, metric, projectData.getProjectDto(), projectData.getMainBranchComponent()));
+ configureLiveMeasure(language, metric, projectData.getMainBranchComponent()));
}
private void insertProjectsLiveMeasures(String language, Set<ProjectData> projects) {
<select id="selectProjectUuidsAssociatedToDefaultQualityProfileByLanguage" parameterType="map" resultType="string">
select
- lm.project_uuid
+ p.uuid
from
live_measures lm
inner join
- projects p on p.uuid = lm.project_uuid
+ project_branches pb on pb.uuid = lm.component_uuid
inner join
- metrics m on m.uuid = lm.metric_uuid
+ projects p on p.uuid = pb.project_uuid
inner join
- project_branches pb on pb.uuid = lm.component_uuid
+ metrics m on m.uuid = lm.metric_uuid
where
m.name = 'ncloc_language_distribution'
and pb.is_main = ${_true}
from
live_measures lm
inner join
- projects p on p.uuid = lm.project_uuid
+ project_branches pb on pb.uuid = lm.project_uuid and pb.is_main = ${_true}
+ inner join
+ projects p on p.uuid = pb.project_uuid
inner join
metrics m on m.uuid = lm.metric_uuid
where
);
}
- private Consumer<LiveMeasureDto> configureLiveMeasure(String language, MetricDto metric, ProjectDto project, ComponentDto componentDto) {
+ private Consumer<LiveMeasureDto> configureLiveMeasure(String language, MetricDto metric, ComponentDto componentDto) {
return liveMeasure -> liveMeasure
.setMetricUuid(metric.getUuid())
.setComponentUuid(componentDto.uuid())
- .setProjectUuid(project.getUuid())
+ .setProjectUuid(componentDto.uuid())
.setData(language + "=" + 100);
}
private Consumer<ProjectData> insertLiveMeasure(String language, MetricDto metric) {
return projectData -> db.measures().insertLiveMeasure(projectData.getMainBranchComponent(), metric,
- configureLiveMeasure(language, metric, projectData.getProjectDto(), projectData.getMainBranchComponent()));
+ configureLiveMeasure(language, metric, projectData.getMainBranchComponent()));
}
}