]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Remove unused code
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Thu, 17 Nov 2022 13:33:31 +0000 (14:33 +0100)
committersonartech <sonartech@sonarsource.com>
Wed, 14 Dec 2022 20:03:52 +0000 (20:03 +0000)
34 files changed:
server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDtoWithSnapshotId.java [deleted file]
server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/measure/LiveMeasureDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodParser.java
server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/plugin/PluginMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociation.java [deleted file]
server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryMapper.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipMapper.java
server/sonar-db-dao/src/main/resources/org/sonar/db/audit/AuditMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/component/ApplicationProjectsMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/component/BranchMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/issue/IssueMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/permission/template/PermissionTemplateMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/property/PropertiesMapper.xml
server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml
server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/RedirectionException.java [deleted file]
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/package-info.java [deleted file]

index 72f8c31e7703d9d9d3c8625a9723a37375cd7c69..0791981626139722ed1e6d9620dd44bdac8b1ef1 100644 (file)
@@ -50,7 +50,6 @@ import org.sonar.db.component.AnalysisPropertyValuePerProject;
 import org.sonar.db.component.ApplicationProjectsMapper;
 import org.sonar.db.component.BranchMapper;
 import org.sonar.db.component.ComponentDto;
-import org.sonar.db.component.ComponentDtoWithSnapshotId;
 import org.sonar.db.component.ComponentKeyUpdaterMapper;
 import org.sonar.db.component.ComponentMapper;
 import org.sonar.db.component.ComponentWithModuleUuidDto;
@@ -194,7 +193,6 @@ public class MyBatis {
     confBuilder.loadAlias("CeTaskCharacteristic", CeTaskCharacteristicDto.class);
     confBuilder.loadAlias("Component", ComponentDto.class);
     confBuilder.loadAlias("ComponentWithModuleUuid", ComponentWithModuleUuidDto.class);
-    confBuilder.loadAlias("ComponentWithSnapshot", ComponentDtoWithSnapshotId.class);
     confBuilder.loadAlias("DuplicationUnit", DuplicationUnitDto.class);
     confBuilder.loadAlias("Event", EventDto.class);
     confBuilder.loadAlias("FilePathWithHash", FilePathWithHashDto.class);
index 398d50b9e8ebd2044deda204920f9f5dcaee3b8b..2e2c85a9eca5b1de9602b20eae5684cafa0a5a84 100644 (file)
@@ -27,8 +27,6 @@ public interface AuditMapper {
 
   void insert(@Param("dto") AuditDto auditDto);
 
-  void delete(@Param("uuids") List<String> uuids);
-
   List<AuditDto> selectByPeriodPaginated(@Param("start")long start, @Param("end") long end, @Param("pagination") Pagination pagination);
 
   List<AuditDto> selectOlderThan(@Param("beforeTimestamp") long beforeTimestamp);
index 18b9e3272d2b05a6afb773b77355c909b5682da7..ec0a3b1513b1e43c11ef230473e8c371f9620b51 100644 (file)
@@ -102,10 +102,6 @@ public class ApplicationProjectsDao implements Dao {
     return session.getMapper(ApplicationProjectsMapper.class);
   }
 
-  public void updateApplicationBranchName(DbSession dbSession, String applicationBranchUuid, String newName) {
-    getMapper(dbSession).updateApplicationBranchName(applicationBranchUuid, newName);
-  }
-
   public void removeAllProjectBranchesOfAppBranch(DbSession dbSession, String applicationBranchUuid) {
     getMapper(dbSession).removeAllProjectBranchesOfAppBranch(applicationBranchUuid);
   }
index 4ef0376269f3149af25a9b222225df82859d1c5b..8fcf9b642387e1370bd75020f4383ff59b28704c 100644 (file)
@@ -61,8 +61,6 @@ public interface ApplicationProjectsMapper {
 
   int countApplicationProjects(@Param("applicationUuid") String applicationUuid);
 
-  void updateApplicationBranchName(@Param("uuid") String uuid, @Param("newName") String newName);
-
   Set<ProjectDto> selectApplicationsFromProjectBranch(@Param("projectUuid") String projectUuid, @Param("branchKey") String branchKey);
 
   Set<ProjectDto> selectApplicationsFromProjects(@Param("projectUuids") Collection<String> projectUuids);
index 39242c80ac6158e0bf6c435b051f8fe4fdb72e04..1dff7ccc75bed838be3f345695898421358d51f9 100644 (file)
@@ -165,10 +165,6 @@ public class BranchDao implements Dao {
     return mapper(dbSession).updateNeedIssueSync(branchUuid, needIssueSync, now);
   }
 
-  public void deleteBranch(DbSession dbSession, String projectUuid, String branchKey) {
-    mapper(dbSession).deleteBranch(projectUuid, branchKey);
-  }
-
   public boolean doAnyOfComponentsNeedIssueSync(DbSession session, List<String> components) {
     if (!components.isEmpty()) {
       List<Boolean> result = new LinkedList<>();
index 691ef746cbde3afe88333446742690002a03bb57..eebd797906abbe2e4ddab97c4cc79c7be830f839 100644 (file)
@@ -34,8 +34,6 @@ public interface BranchMapper {
 
   int updateMainBranchName(@Param("projectUuid") String projectUuid, @Param("newBranchName") String newBranchName, @Param("now") long now);
 
-  int updateManualBaseline(@Param("uuid") String uuid, @Nullable @Param("analysisUuid") String analysisUuid, @Param("now") long now);
-
   int updateExcludeFromPurge(@Param("uuid") String uuid, @Param("excludeFromPurge") boolean excludeFromPurge,
     @Param("now") long now);
 
@@ -75,5 +73,4 @@ public interface BranchMapper {
 
   short doAnyOfComponentsNeedIssueSync(@Param("componentKeys") List<String> components);
 
-  void deleteBranch(@Param("projectUuid") String projectUuid, @Param("branchKey") String branchKey);
 }
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDtoWithSnapshotId.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDtoWithSnapshotId.java
deleted file mode 100644 (file)
index c8c4868..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.component;
-
-public class ComponentDtoWithSnapshotId extends ComponentDto {
-  private Long snapshotId;
-
-  public Long getSnapshotId() {
-    return snapshotId;
-  }
-
-  public ComponentDtoWithSnapshotId setSnapshotId(Long snapshotId) {
-    this.snapshotId = snapshotId;
-    return this;
-  }
-}
index f669ff574df7e79f95f7e6a5b1823706919951e3..52340ca7660dae51341085b32af97bbec341b5a8 100644 (file)
@@ -132,8 +132,6 @@ public interface ComponentMapper {
 
   void setPrivateForRootComponentUuid(@Param("branchUuid") String branchUuid, @Param("isPrivate") boolean isPrivate);
 
-  void delete(String componentUuid);
-
   List<KeyWithUuidDto> selectComponentsFromPullRequestsTargetingCurrentBranchThatHaveOpenIssues(@Param("referenceBranchUuid") String referenceBranchUuid,
     @Param("currentBranchUuid") String currentBranchUuid);
 
index 80ccda2b0d7623d4eade92cc1a22f7217e198e8e..f2fa7be583fe96f545fd1f43035ed49bb78ca440 100644 (file)
@@ -71,11 +71,6 @@ public class IssueDao implements Dao {
       languages, Pagination.forPage(page).andSize(BIG_PAGE_SIZE));
   }
 
-  public Set<String> selectIssueKeysByComponentUuidAndChangedSinceDate(DbSession session, String componentUuid, long changedSince, int page) {
-    return selectIssueKeysByComponentUuidAndChangedSinceDate(session, componentUuid, changedSince, emptyList(), emptyList(),
-      emptyList(), page);
-  }
-
   public Set<String> selectIssueKeysByComponentUuidAndChangedSinceDate(DbSession session, String componentUuid, long changedSince,
     List<String> includingRepositories, List<String> excludingRepositories,
     List<String> languages, int page) {
@@ -108,10 +103,6 @@ public class IssueDao implements Dao {
     return executeLargeInputs(componentUuids, mapper(dbSession)::selectOpenByComponentUuids);
   }
 
-  public Collection<HotspotGroupDto> selectBranchHotspotsCount(DbSession dbSession, String branchUuid, long leakPeriodBeginningDate) {
-    return mapper(dbSession).selectBranchHotspotsCount(branchUuid, leakPeriodBeginningDate);
-  }
-
   public Collection<IssueGroupDto> selectIssueGroupsByComponent(DbSession dbSession, ComponentDto component, long leakPeriodBeginningDate) {
     return mapper(dbSession).selectIssueGroupsByComponent(component, leakPeriodBeginningDate);
   }
index f040fc89480ca690a355b387e6e50cd5eb3d5409..ff0d7a33731ee0e5ce1b60dd702265638b015e52 100644 (file)
@@ -76,8 +76,6 @@ public interface IssueMapper {
 
   List<IssueDto> selectNonClosedByModuleOrProject(@Param("projectUuid") String projectUuid, @Param("likeModuleUuidPath") String likeModuleUuidPath);
 
-  Collection<HotspotGroupDto> selectBranchHotspotsCount(@Param("rootUuid") String rootUuid, @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate);
-
   Collection<IssueGroupDto> selectIssueGroupsByComponent(@Param("component") ComponentDto component, @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate);
 
   List<IssueDto> selectByBranch(@Param("keys") Set<String> keys, @Nullable @Param("changedSince") Long changedSince);
index 7bbdd0c44e6b9efd63e69e3f8d55ed18cd8d034d..b1cb9d7362f54885a3526c07421c505d5710f3a7 100644 (file)
@@ -113,10 +113,6 @@ public class LiveMeasureDao implements Dao {
     mapper(dbSession).insert(dto, Uuids.create(), system2.now());
   }
 
-  public void update(DbSession dbSession, LiveMeasureDto dto) {
-    mapper(dbSession).update(dto, system2.now());
-  }
-
   public void insertOrUpdate(DbSession dbSession, LiveMeasureDto dto) {
     LiveMeasureMapper mapper = mapper(dbSession);
     long now = system2.now();
index 82b2d02702b12437fcb9e7d087985f8ec51c6a97..c59df0ef22128e9d605e431dc8074e1064955449 100644 (file)
@@ -90,13 +90,6 @@ public class NewCodePeriodDao implements Dao {
     return ofNullable(mapper(dbSession).selectByBranch(projectUuid, branchUuid));
   }
 
-  public NewCodePeriodDto selectBestMatchForBranch(DbSession dbSession, String projectUuid, String branchUuid) {
-    return selectByBranch(dbSession, projectUuid, branchUuid)
-      .or(() -> selectByProject(dbSession, projectUuid)
-        .or(() -> selectGlobal(dbSession)))
-      .orElse(NewCodePeriodDto.defaultInstance());
-  }
-
   public Set<String> selectBranchesReferencing(DbSession dbSession, String projectUuid, String referenceBranchName) {
     return mapper(dbSession).selectBranchesReferencing(projectUuid, referenceBranchName);
   }
index bd34248c777c75679683f41589677078b5104522..fb0631c7d7277429eac81baf739b6f64effe56f4 100644 (file)
@@ -26,10 +26,6 @@ public class NewCodePeriodParser {
     // static only
   }
 
-  public static LocalDate parseDate(String value) {
-    return LocalDate.parse(value);
-  }
-
   public static int parseDays(String value) {
     return Integer.parseInt(value);
   }
index e20f17a29f99570ccaa865e119825ef8ea522019..7fa547b06e287ef4a0edaf3cbeb72c08b7521acf 100644 (file)
@@ -38,20 +38,14 @@ public interface PermissionTemplateMapper {
 
   int deleteByUuid(String templateUuid);
 
-  void deleteByUuids(@Param("templateUuids") List<String> templateUuids);
-
   void deleteUserPermissionsByTemplateUuid(String templateUuid);
 
-  void deleteUserPermissionsByTemplateUuids(@Param("templateUuids") List<String> templateUuids);
-
   int deleteUserPermissionsByUserUuid(@Param("userUuid") String userUuid);
 
   int deleteUserPermission(PermissionTemplateUserDto permissionTemplateUser);
 
   void deleteGroupPermissionsByTemplateUuid(String templateUuid);
 
-  void deleteGroupPermissionsByTemplateUuids(@Param("templateUuids") List<String> templateUuids);
-
   int deleteGroupPermission(PermissionTemplateGroupDto permissionTemplateGroup);
 
   PermissionTemplateDto selectByUuid(String templateUuid);
@@ -86,8 +80,6 @@ public interface PermissionTemplateMapper {
 
   int countGroupsWithPermission(@Param("templateUuid") String templateUuid, @Param("permission") String permission, @Nullable @Param("groupUuid") String groupUuid);
 
-  List<String> selectTemplateUuids();
-
   List<PermissionTemplateGroupDto> selectAllGroupPermissionTemplatesByGroupUuid(@Param("groupUuid") String groupUuid);
 
 }
index d71ce79afeca3feac0b2bca18547243c1a6bfde8..c14edc192e8f49df1d3407a22f0dd085e30fc97d 100644 (file)
@@ -34,5 +34,4 @@ public interface PluginMapper {
 
   void update(PluginDto dto);
 
-  void delete(@Param("uuid") String uuid);
 }
index 3fc983b8eb44bfd7a6c5fad277b2a993d887ddc3..3b2b3096964eccc5ae50270b1a93f786030b13d9 100644 (file)
@@ -47,8 +47,6 @@ public interface ProjectMapper {
 
   List<ProjectDto> selectAll();
 
-  void updateKey(@Param("uuid") String uuid, @Param("newKey") String newKey, @Param("updatedAt") long updatedAt);
-
   void updateTags(ProjectDto project);
 
   void update(ProjectDto project);
index 47006f65dbdf7d96da5d9750a223c860c7ce4678..50faa522fa881eb86fc286510664ac4c6fef224f 100644 (file)
@@ -34,8 +34,6 @@ public interface PropertiesMapper {
 
   List<PropertyDto> selectGlobalProperties();
 
-  List<PropertyDto> selectProjectProperties(String resourceKey);
-
   PropertyDto selectByKey(PropertyDto key);
 
   List<PropertyDto> selectByKeys(@Param("keys") List<String> keys);
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociation.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociation.java
deleted file mode 100644 (file)
index e910bb4..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.qualitygate;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-
-public class ProjectQgateAssociation {
-
-  private Long id;
-  private String name;
-  private boolean isMember;
-
-  public Long id() {
-    return id;
-  }
-
-  public ProjectQgateAssociation setId(Long id) {
-    this.id = id;
-    return this;
-  }
-
-  public String name() {
-    return name;
-  }
-
-  public ProjectQgateAssociation setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public boolean isMember() {
-    return isMember;
-  }
-
-  public ProjectQgateAssociation setMember(boolean isMember) {
-    this.isMember = isMember;
-    return this;
-  }
-
-  @Override
-  public String toString() {
-    return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || getClass() != o.getClass()) {
-      return false;
-    }
-    ProjectQgateAssociation that = (ProjectQgateAssociation) o;
-    return name.equals(that.name);
-  }
-
-  @Override
-  public int hashCode() {
-    return name.hashCode();
-  }
-}
index 968adaa370f81c0038bf7d1be3e08ea4d22313ea..060fdf65549031a82af5109c8404b3aac5a5829e 100644 (file)
@@ -43,8 +43,6 @@ public interface ActiveRuleMapper {
   @CheckForNull
   ActiveRuleDto selectByKey(@Param("ruleProfileUuid") String ruleProfileUuid, @Param("repository") String repository, @Param("rule") String rule);
 
-  List<ActiveRuleDto> selectByKeys(@Param("keys") List<ActiveRuleKey> keys);
-
   List<OrgActiveRuleDto> selectOrgByRuleUuid(@Param("ruleUuid") String ruleUuid);
 
   List<ActiveRuleDto> selectByRuleUuid(String ruleUuid);
@@ -86,5 +84,4 @@ public interface ActiveRuleMapper {
 
   void scrollByRuleProfileUuidForIndexing(@Param("ruleProfileUuid") String ruleProfileUuid, ResultHandler<IndexedActiveRuleDto> handler);
 
-  List<OrgActiveRuleDto> selectByQualityProfileUuid(@Param("qualityProfileUuid") String qualityProfileUuid);
 }
index 6a2c9d2c119c75464ed055e0d5fd3ccebbd43c58..fbb70f7e5ba50f3d4e8ffbad4a0f03c2ed267ba1 100644 (file)
@@ -34,9 +34,6 @@ public interface RuleRepositoryMapper {
 
   List<RuleRepositoryDto> selectByQueryAndLanguage(@Param("query") String query,@Param("language") @Nullable String language);
 
-  @CheckForNull
-  RuleRepositoryDto selectByKey(@Param("key") String key);
-
   void insert(@Param("repository") RuleRepositoryDto repository, @Param("now") long now);
 
   void update(@Param("repository") RuleRepositoryDto repository);
index 67e8fbc5467e98858a4b364ab0a7666e1a5bf65a..40c1c872f20d12bec83209e69a21ffdb6f8d7e77 100644 (file)
@@ -70,15 +70,6 @@ public class GroupMembershipDao implements Dao {
     return result;
   }
 
-  public Map<String, Integer> countGroupsByUsers(DbSession dbSession, List<String> logins) {
-    List<LoginGroupCount> loginGroupCount = mapper(dbSession).countGroupsByUsers(logins);
-    Map<String, Integer> map = new HashMap<>();
-    for (LoginGroupCount l : loginGroupCount) {
-      map.put(l.login(), l.groupCount());
-    }
-    return map;
-  }
-
   public List<String> selectGroupUuidsByUserUuid(DbSession dbSession, String userUuid) {
     return mapper(dbSession).selectGroupUuidsByUserUuid(userUuid);
   }
index d3577a92cd9c13d20ad8211e4eb58b9066e531cc..d05947b4e09d04061d06543e780d5f2a1b7a76d1 100644 (file)
@@ -36,8 +36,6 @@ public interface GroupMembershipMapper {
 
   List<GroupUserCount> countUsersByGroup(@Param("groupUuids") List<String> groupUuids);
 
-  List<LoginGroupCount> countGroupsByUsers(@Param("logins") List<String> logins);
-
   List<LoginGroup> selectGroupsByLogins(@Param("logins") List<String> logins);
 
   List<String> selectGroupUuidsByUserUuid(@Param("userUuid") String userUuid);
index f0d9c9249b4890b43f99ec3a20a888b7784578aa..edf3aaa73290e704485bf3441fb4b5e50fbc875c 100644 (file)
     where uuid in (select a.uuid from audits a where a.created_at &lt; #{threshold,jdbcType=BIGINT}
       order by a.created_at fetch first 100000 rows only)
   </delete>
-
-  <delete id="deleteByUuids" parameterType="string">
-    delete
-      from audits
-    where
-      uuid in
-      <foreach collection="uuids" open="(" close=")" item="uuid" separator=",">
-        #{uuid,jdbcType=VARCHAR}
-      </foreach>
-  </delete>
-
 </mapper>
index 747ce122c2b32b6a4a9fc3f46186f505ecd38b7b..0217e51091030ea25c98ec786113a5b934dab477 100644 (file)
     ap.application_uuid = #{applicationUuid,jdbcType=VARCHAR}
   </select>
 
-  <update id="updateApplicationBranchName" parameterType="String">
-    UPDATE
-      project_branches
-    SET
-      kee = #{newName,jdbcType=VARCHAR}
-    WHERE
-      uuid = #{uuid,jdbcType=VARCHAR}
-  </update>
-
   <select id="selectApplicationsFromProjectBranch" parameterType="String" resultType="Project">
     SELECT
       <include refid="projectColumns"/>
index fcfae3b120a3e7cdae81b6fc11a20efd31c30197..ab077238c9f81e9269cd9af58a9dd3c446ab61b2 100644 (file)
       uuid = #{projectUuid, jdbcType=VARCHAR}
   </update>
 
-  <delete id="deleteBranch" parameterType="string">
-    delete from project_branches
-    where
-      project_uuid = #{projectUuid, jdbcType=VARCHAR},
-      kee = #{branchKey, jdbcType=VARCHAR}
-  </delete>
-
   <update id="updateExcludeFromPurge">
     update project_branches
     set
index 76ca07cef96b97d0674157d3564898c3f70288d3..5605626e4b8dc779a8aed36a10b5f5b5984fd3cb 100644 (file)
       and private &lt;&gt; #{isPrivate,jdbcType=BOOLEAN}
   </update>
 
-  <delete id="delete" parameterType="String">
-    DELETE FROM components WHERE uuid=#{componentUuid,jdbcType=VARCHAR}
-  </delete>
-
   <select id="selectComponentsFromPullRequestsTargetingCurrentBranchThatHaveOpenIssues" resultType="KeyWithUuid">
     SELECT DISTINCT p.kee as kee, p.uuid as uuid FROM components p
     JOIN issues i
index 84824708ea9b66e93ac9ade3d6f67960ed5e8019..655c142af2e6af18bcf2ece8d5619bce71477079 100644 (file)
     i.issue_type &lt;&gt; 4
   </select>
 
-  <select id="selectBranchHotspotsCount" resultType="org.sonar.db.issue.HotspotGroupDto" parameterType="map">
-    select i.status as status, count(i.status) as "count",
-    <if test="leakPeriodBeginningDate &gt;= 0">
-      (i.issue_creation_date &gt; #{leakPeriodBeginningDate,jdbcType=BIGINT}) as inLeak
-    </if>
-    <if test="leakPeriodBeginningDate &lt; 0">
-      CASE WHEN n.uuid is null THEN false ELSE true END as inLeak
-    </if>
-    from issues i
-    <if test="leakPeriodBeginningDate &lt; 0">
-      left join new_code_reference_issues n on n.issue_key = i.kee
-    </if>
-    where i.project_uuid = #{rootUuid,jdbcType=VARCHAR}
-    and i.status !='CLOSED'
-    and i.issue_type = 4
-    group by i.status, inLeak
-  </select>
-
-  <select id="selectBranchHotspotsCount" resultType="org.sonar.db.issue.HotspotGroupDto" parameterType="map" databaseId="oracle">
-    select i2.status as status, count(i2.status) as "count", i2.inLeak as inLeak
-    from (
-      select i.status,
-      <if test="leakPeriodBeginningDate &gt;= 0">
-       case when i.issue_creation_date &gt; #{leakPeriodBeginningDate,jdbcType=BIGINT} then 1 else 0 end as inLeak
-      </if>
-      <if test="leakPeriodBeginningDate &lt; 0">
-        case when n.uuid is null then 0 else 1 end as inLeak
-      </if>
-      from issues i
-      <if test="leakPeriodBeginningDate &lt; 0">
-        left join new_code_reference_issues n on n.issue_key = i.kee
-      </if>
-      where i.project_uuid = #{rootUuid,jdbcType=VARCHAR}
-      and i.status !='CLOSED'
-      and i.issue_type = 4
-    ) i2
-    group by i2.status, i2.inLeak
-  </select>
-
-  <select id="selectBranchHotspotsCount" resultType="org.sonar.db.issue.HotspotGroupDto" parameterType="map" databaseId="mssql">
-    select i2.status as status, count(i2.status) as "count", i2.inLeak as inLeak
-    from (
-      select i.status,
-      <if test="leakPeriodBeginningDate &gt;= 0">
-        case when i.issue_creation_date &gt; #{leakPeriodBeginningDate,jdbcType=BIGINT} then 1 else 0 end as inLeak
-      </if>
-      <if test="leakPeriodBeginningDate &lt; 0">
-        case when n.uuid is null then 0 else 1 end as inLeak
-      </if>
-      from issues i
-      <if test="leakPeriodBeginningDate &lt; 0">
-        left join new_code_reference_issues n on n.issue_key = i.kee
-      </if>
-      where i.project_uuid = #{rootUuid,jdbcType=VARCHAR}
-      and i.status !='CLOSED'
-      and i.issue_type = 4
-    ) i2
-    group by i2.status, i2.inLeak
-  </select>
-
   <select id="selectIssueGroupsByComponent" resultType="org.sonar.db.issue.IssueGroupDto" parameterType="map">
     select i.issue_type as ruleType, i.severity as severity, i.resolution as resolution, i.status as status, sum(i.effort) as effort, count(i.issue_type) as "count",
     <if test="leakPeriodBeginningDate &gt;= 0">
index 8c9a5c8d2e0271f7cdcd7dd28fbe4186a806a09f..0ced621cbd782ca9be95177ba612b89958d97687 100644 (file)
     WHERE uuid = #{uuid}
   </delete>
 
-  <delete id="deleteByUuids" parameterType="String">
-    delete from
-      permission_templates
-    where
-      uuid in <foreach collection="templateUuids" open="(" close=")" item="uuid" separator=",">
-        #{uuid,jdbcType=BIGINT}
-      </foreach>
-  </delete>
-
   <delete id="deleteUserPermissionsByTemplateUuid" parameterType="string">
     delete from
       perm_templates_users
       template_uuid = #{templateUuid,jdbcType=VARCHAR}
   </delete>
 
-  <delete id="deleteUserPermissionsByTemplateUuids">
-    delete from
-      perm_templates_users
-    where
-      template_uuid in <foreach collection="templateUuids" open="(" close=")" item="templateUuid" separator=",">
-        #{templateUuid,jdbcType=BIGINT}
-      </foreach>
-  </delete>
-
   <delete id="deleteUserPermission" parameterType="PermissionTemplateUser">
     DELETE FROM perm_templates_users
     WHERE template_uuid = #{templateUuid}
       template_uuid = #{templateUuid,jdbcType=VARCHAR}
   </delete>
 
-  <delete id="deleteGroupPermissionsByTemplateUuids">
-    delete from
-      perm_templates_groups
-    where
-      template_uuid in <foreach collection="templateUuids" open="(" close=")" item="templateUuid" separator=",">
-        #{templateUuid,jdbcType=VARCHAR}
-      </foreach>
-  </delete>
-
   <delete id="deleteGroupPermission" parameterType="PermissionTemplateGroup">
     DELETE FROM perm_templates_groups
     WHERE template_uuid = #{templateUuid}
     </if>
   </select>
 
-  <select id="selectTemplateUuidsn" resultType="String">
-    select
-      uuid
-    from
-      permission_templates
-  </select>
-
   <select id="selectAllGroupPermissionTemplatesByGroupUuid" parameterType="string" resultType="PermissionTemplateGroup">
     SELECT
       ptg.uuid,
index 87ee3c5edce65d03e364429cec0d29a7c1593711..1da38dd2e0628f032e24cb97e4f078c97b9700ab 100644 (file)
     uuid = #{uuid,jdbcType=VARCHAR}
   </update>
 
-  <update id="updateKey">
-    update projects set
-    kee = #{newKey,jdbcType=VARCHAR},
-    updated_at = #{updatedAt,jdbcType=BIGINT}
-    where
-    uuid = #{uuid,jdbcType=VARCHAR}
-  </update>
-
-    <update id="updateVisibility">
+  <update id="updateVisibility">
     update projects set
     private = #{isPrivate,jdbcType=BOOLEAN},
     updated_at = #{updatedAt,jdbcType=BIGINT}
index 40e2a56a55180e741e3d8a947e6b81185a7072a7..f1f3f77500aae96fb82cb6da35491075cca68451 100644 (file)
       and p.user_uuid is null
   </select>
 
-  <select id="selectProjectProperties" parameterType="String" resultType="ScrapProperty">
-    select
-      <include refid="columnsToScrapPropertyDto"/>
-    from
-      properties p,
-      components r
-    where
-      p.component_uuid=r.uuid
-      and p.user_uuid is null
-      and r.kee=#{resourceKey,jdbcType=VARCHAR}
-  </select>
-
   <select id="selectByKey" parameterType="map" resultType="ScrapProperty">
     select
       <include refid="columnsToScrapPropertyDto"/>
index 84a298f7dccabecb0586047564896f06cef24675..d450e04b1a01bf7ea58360a849d33be0c97ae1a1 100644 (file)
     and r.plugin_name = #{repository, jdbcType=VARCHAR}
   </select>
 
-  <select id="selectByKeys" parameterType="map" resultType="ActiveRule">
-    select
-    <include refid="activeRuleColumns"/>
-    from active_rules a
-    <include refid="activeRuleKeyJoin"/>
-    where
-    <foreach collection="keys" item="key" open="(" separator=" or " close=")">
-      (rp.uuid = #{key.ruleProfileUuid, jdbcType=VARCHAR}
-      AND r.plugin_rule_key = #{key.ruleKey.rule, jdbcType=VARCHAR}
-      AND r.plugin_name = #{key.ruleKey.repository, jdbcType=VARCHAR}
-      )
-    </foreach>
-  </select>
-
   <select id="selectByProfileUuid" parameterType="string" resultType="org.sonar.db.qualityprofile.OrgActiveRuleDto">
     select
     <include refid="orgActiveRuleColumns"/>
index f575c82df67e74f1ecaf3008fe1ab716d9864401..64a8d59cf3635912ae83e555591c05cecd3534d7 100644 (file)
@@ -191,20 +191,6 @@ public class IssueDaoTest {
     assertThat(issues).containsOnly("I1", "I3");
   }
 
-  @Test
-  public void selectIssueKeysByComponentUuidAndChangedSince() {
-    long t1 = 1_340_000_000_000L;
-    long t2 = 1_400_000_000_000L;
-    // contains I1 and I2
-    prepareTables();
-    // Insert I3, I4, where t1 < t2
-    IntStream.range(3, 5).forEach(i -> underTest.insert(db.getSession(), newIssueDto("I" + i).setUpdatedAt(t1)));
-
-    Set<String> issues = underTest.selectIssueKeysByComponentUuidAndChangedSinceDate(db.getSession(), PROJECT_UUID, t2, 1);
-
-    assertThat(issues).contains("I1");
-  }
-
   @Test
   public void selectIssueKeysByComponentUuidAndChangedSinceFiltersAccordingly() {
     long t1 = 1_340_000_000_000L;
@@ -421,16 +407,6 @@ public class IssueDaoTest {
     assertThat(groups).isEmpty();
   }
 
-  @Test
-  public void test_selectBranchHotspotsCount_on_component_without_issues() {
-    ComponentDto project = db.components().insertPublicProject();
-    ComponentDto file = db.components().insertComponent(ComponentTesting.newFileDto(project));
-
-    Collection<HotspotGroupDto> groups = underTest.selectBranchHotspotsCount(db.getSession(), project.uuid(), 1_000L);
-
-    assertThat(groups).isEmpty();
-  }
-
   @Test
   public void selectByKey_givenOneIssueWithQuickFix_selectOneIssueWithQuickFix() {
     prepareIssuesComponent();
@@ -550,74 +526,6 @@ public class IssueDaoTest {
     assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isOne();
   }
 
-  @Test
-  public void selectBranchHotspotsCount_on_project() {
-    ComponentDto project = db.components().insertPublicProject();
-    ComponentDto file = db.components().insertComponent(ComponentTesting.newFileDto(project));
-    RuleDto rule = db.rules().insert();
-    IssueDto i1 = db.issues().insert(rule, project, file,
-      i -> i.setStatus("REVIEWED").setResolution("SAFE").setSeverity("CRITICAL").setType(RuleType.SECURITY_HOTSPOT).setIssueCreationTime(1_500L));
-    IssueDto i2 = db.issues().insert(rule, project, file,
-      i -> i.setStatus("TO_REVIEW").setResolution(null).setSeverity("CRITICAL").setType(RuleType.SECURITY_HOTSPOT).setIssueCreationTime(1_600L));
-    IssueDto i3 = db.issues().insert(rule, project, file,
-      i -> i.setStatus("TO_REVIEW").setResolution(null).setSeverity("CRITICAL").setType(RuleType.SECURITY_HOTSPOT).setIssueCreationTime(1_700L));
-
-    // closed issues or other types are ignored
-    IssueDto closed = db.issues().insert(rule, project, file,
-      i -> i.setStatus("CLOSED").setResolution("REMOVED").setSeverity("CRITICAL").setType(RuleType.BUG).setIssueCreationTime(1_700L));
-    IssueDto bug = db.issues().insert(rule, project, file,
-      i -> i.setStatus("OPEN").setResolution(null).setSeverity("CRITICAL").setType(RuleType.BUG).setIssueCreationTime(1_700L));
-
-    Collection<HotspotGroupDto> result = underTest.selectBranchHotspotsCount(db.getSession(), project.uuid(), 1_000L);
-
-    assertThat(result.stream().mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(3);
-
-    assertThat(result.stream().filter(g -> g.getStatus().equals("TO_REVIEW")).mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(2);
-    assertThat(result.stream().filter(g -> g.getStatus().equals("REVIEWED")).mapToLong(HotspotGroupDto::getCount).sum()).isOne();
-    assertThat(result.stream().filter(g -> g.getStatus().equals("CLOSED")).mapToLong(HotspotGroupDto::getCount).sum()).isZero();
-
-    assertThat(result.stream().filter(HotspotGroupDto::isInLeak).mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(3);
-    assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(HotspotGroupDto::getCount).sum()).isZero();
-
-    // test leak
-    result = underTest.selectBranchHotspotsCount(db.getSession(), project.uuid(), 999_999_999L);
-    assertThat(result.stream().filter(HotspotGroupDto::isInLeak).mapToLong(HotspotGroupDto::getCount).sum()).isZero();
-    assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(3);
-  }
-
-  @Test
-  public void selectBranchHotspotsCount_on_project_with_reference_branch() {
-    ComponentDto project = db.components().insertPublicProject();
-    ComponentDto file = db.components().insertComponent(ComponentTesting.newFileDto(project));
-    RuleDto rule = db.rules().insert();
-    IssueDto i1 = db.issues().insert(rule, project, file,
-      i -> i.setStatus("REVIEWED").setResolution("SAFE").setSeverity("CRITICAL").setType(RuleType.SECURITY_HOTSPOT).setIssueCreationTime(1_500L));
-    IssueDto i2 = db.issues().insert(rule, project, file,
-      i -> i.setStatus("TO_REVIEW").setResolution(null).setSeverity("CRITICAL").setType(RuleType.SECURITY_HOTSPOT).setIssueCreationTime(1_600L));
-    IssueDto i3 = db.issues().insert(rule, project, file,
-      i -> i.setStatus("TO_REVIEW").setResolution(null).setSeverity("CRITICAL").setType(RuleType.SECURITY_HOTSPOT).setIssueCreationTime(1_700L));
-
-    // closed issues or other types are ignored
-    IssueDto closed = db.issues().insert(rule, project, file,
-      i -> i.setStatus("CLOSED").setResolution("REMOVED").setSeverity("CRITICAL").setType(RuleType.BUG).setIssueCreationTime(1_700L));
-    IssueDto bug = db.issues().insert(rule, project, file,
-      i -> i.setStatus("OPEN").setResolution(null).setSeverity("CRITICAL").setType(RuleType.BUG).setIssueCreationTime(1_700L));
-
-    db.issues().insertNewCodeReferenceIssue(i1);
-    db.issues().insertNewCodeReferenceIssue(bug);
-
-    Collection<HotspotGroupDto> result = underTest.selectBranchHotspotsCount(db.getSession(), project.uuid(), -1);
-
-    assertThat(result.stream().mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(3);
-
-    assertThat(result.stream().filter(g -> g.getStatus().equals("TO_REVIEW")).mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(2);
-    assertThat(result.stream().filter(g -> g.getStatus().equals("REVIEWED")).mapToLong(HotspotGroupDto::getCount).sum()).isOne();
-    assertThat(result.stream().filter(g -> g.getStatus().equals("CLOSED")).mapToLong(HotspotGroupDto::getCount).sum()).isZero();
-
-    assertThat(result.stream().filter(HotspotGroupDto::isInLeak).mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(1);
-    assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(HotspotGroupDto::getCount).sum()).isEqualTo(2);
-  }
-
   @Test
   public void selectModuleAndDirComponentUuidsOfOpenIssuesForProjectUuid() {
     assertThat(underTest.selectModuleAndDirComponentUuidsOfOpenIssuesForProjectUuid(db.getSession(), randomAlphabetic(12)))
diff --git a/server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/RedirectionException.java b/server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/RedirectionException.java
deleted file mode 100644 (file)
index 146aef6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.server.authentication.exception;
-
-public abstract class RedirectionException extends RuntimeException {
-
-  public abstract String getPath(String contextPath);
-}
diff --git a/server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/package-info.java b/server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/package-info.java
deleted file mode 100644 (file)
index cd0ff4e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.server.authentication.exception;
-
-import javax.annotation.ParametersAreNonnullByDefault;