]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18856 Fix code smells and TODOs
authorLéo Geoffroy <leo.geoffroy@sonarsource.com>
Thu, 1 Jun 2023 08:30:02 +0000 (10:30 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 1 Jun 2023 20:03:00 +0000 (20:03 +0000)
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSubscriptions.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/user/ServerUserSession.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java

index 63b197577ce6fae9f049de07aacba4bd0f28d5f1..12bfa4d129f3b0a23c880fd55f62c7c1341ff4e0 100644 (file)
@@ -26,7 +26,7 @@ import org.sonar.server.platform.db.migration.step.DataChange;
 import org.sonar.server.platform.db.migration.step.MassUpdate;
 
 public class PopulateReportSubscriptions extends DataChange {
-  // TODO should we add a inner join on users to not transfer values of non-existent users?
+
   private static final String SELECT_QUERY = """
     SELECT port.uuid as portfolioUuid, pb.uuid as branchUuid, p.user_uuid as userUuid
     FROM properties p
index 518b710e5f4a896cfa57092c929faf4398407bf6..dfabf7787409fb56b845d0a5dcdaafcf9a18c3cd 100644 (file)
@@ -199,7 +199,7 @@ public class ServerUserSession extends AbstractUserSession {
   @Override
   public <T extends EntityDto> List<T> keepAuthorizedEntities(String permission, Collection<T> projects) {
     Set<String> projectsUuids = projects.stream().map(EntityDto::getUuid).collect(Collectors.toSet());
-    // TODO
+    // TODO in SONAR-19445
     Set<String> authorizedProjectsUuids = keepProjectsUuidsByPermission(permission, projectsUuids);
 
     return projects.stream()
index bf4136b08a14dcb866aeca78d21e40521d2c18cd..c905660861a58d8d65df63644c16fec25a5dfa92 100644 (file)
@@ -150,12 +150,12 @@ public class ComponentUpdater {
       dbClient.portfolioDao().insert(dbSession, portfolioDto);
     }
 
-    // TODO permissions: probably we want to apply it to the projectDto or portfolioDto
+    // TODO SONAR-19445: probably we want to apply it to the projectDto or portfolioDto
     permissionTemplateService.applyDefaultToNewComponent(dbSession, componentDto, userUuid);
     return new ComponentCreationData(componentDto, mainBranch, projectDto);
   }
 
-  // TODO, when working on permissions, maybe we could remove the last argument from this method
+  // TODO SONAR-19445, when working on permissions, maybe we could remove the last argument from this method
   private void addToFavourites(DbSession dbSession, ProjectDto projectDto, @Nullable String userUuid, @Nullable String userLogin, ComponentDto componentDto) {
     if (permissionTemplateService.hasDefaultTemplateWithPermissionOnProjectCreator(dbSession, componentDto)) {
       favoriteUpdater.add(dbSession, projectDto, userUuid, userLogin, false);