diff options
author | Dejan Milisavljevic <dejan.milisavljevic@sonarsource.com> | 2024-10-28 10:40:27 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-11-05 20:03:01 +0000 |
commit | 969c7f691192a9f3af6220ef85de973b303ed473 (patch) | |
tree | 6542fb9ea83dae52228b39d4c8d94c1add725f65 /server/sonar-db-dao/src/main/java/org/sonar/db/issue | |
parent | 72bd306ed82ab8746a0c306b48b48a7ebe811f11 (diff) | |
download | sonarqube-969c7f691192a9f3af6220ef85de973b303ed473.tar.gz sonarqube-969c7f691192a9f3af6220ef85de973b303ed473.zip |
SONAR-23298 Compute new measures for project and live update
Diffstat (limited to 'server/sonar-db-dao/src/main/java/org/sonar/db/issue')
3 files changed, 78 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java index e533bf62a1b..a292a26d1f9 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java @@ -94,6 +94,11 @@ public class IssueDao implements Dao { return mapper(dbSession).selectIssueImpactGroupsByComponent(component, leakPeriodBeginningDate); } + public Collection<IssueImpactSeverityGroupDto> selectIssueImpactSeverityGroupsByComponent(DbSession dbSession, ComponentDto component, + long leakPeriodBeginningDate) { + return mapper(dbSession).selectIssueImpactSeverityGroupsByComponent(component, leakPeriodBeginningDate); + } + public Cursor<IndexedIssueDto> scrollIssuesForIndexation(DbSession dbSession, @Nullable @Param("branchUuid") String branchUuid, @Nullable @Param("issueKeys") Collection<String> issueKeys) { return mapper(dbSession).scrollIssuesForIndexation(branchUuid, issueKeys); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueImpactSeverityGroupDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueImpactSeverityGroupDto.java new file mode 100644 index 00000000000..9cfa17c65fa --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueImpactSeverityGroupDto.java @@ -0,0 +1,70 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.db.issue; + +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; +import org.sonar.api.issue.impact.Severity; + +public class IssueImpactSeverityGroupDto { + + private String resolution; + private Severity severity; + private long count; + private boolean inLeak; + + public IssueImpactSeverityGroupDto() { + // nothing to do + } + + public boolean isInLeak() { + return inLeak; + } + + public void setInLeak(boolean inLeak) { + this.inLeak = inLeak; + } + + @CheckForNull + public String getResolution() { + return resolution; + } + + public void setResolution(@Nullable String resolution) { + this.resolution = resolution; + } + + public long getCount() { + return count; + } + + public void setCount(long count) { + this.count = count; + } + + public Severity getSeverity() { + return severity; + } + + public void setSeverity(Severity severity) { + this.severity = severity; + } + +} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java index b1b3d7f760d..c1c5b9726ce 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java @@ -76,6 +76,9 @@ public interface IssueMapper { Collection<IssueImpactGroupDto> selectIssueImpactGroupsByComponent(@Param("component") ComponentDto component, @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate); + Collection<IssueImpactSeverityGroupDto> selectIssueImpactSeverityGroupsByComponent(@Param("component") ComponentDto component, + @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate); + List<IssueDto> selectByBranch(@Param("keys") Set<String> keys, @Nullable @Param("changedSince") Long changedSince); List<String> selectRecentlyClosedIssues(@Param("queryParams") IssueQueryParams issueQueryParams); |