docs: private void ensureBuiltInDefaultQPContainsRules(DbSession dbSession) {
      Map<String, RulesProfileDto> rulesProfilesByLanguage = dbClient.qualityProfileDao().selectBuiltInRuleProfilesWithActiveRules(dbSession).stream()
        .collect(toMap(RulesProfileDto::getLanguage, Function.identity(), (oldValue, newValue) -> oldValue));
  
      dbClient.qualityProfileDao().selectDefaultBuiltInProfilesWithoutActiveRules(dbSession, rulesProfilesByLanguage.keySet())
        .forEach(qp -> {
          RulesProfileDto rulesProfile = rulesProfilesByLanguage.get(qp.getLanguage());
          if (rulesProfile == null) {
            return;
          }
  
          QProfileDto qualityProfile = dbClient.qualityProfileDao().selectByRuleProfileUuid(dbSession, qp.getOrganizationUuid(), rulesProfile.getKee());
          if (qualityProfile == null) {
            return;
          }
  
          Set<String> uuids = dbClient.defaultQProfileDao().selectExistingQProfileUuids(dbSession, qp.getOrganizationUuid(), Collections.singleton(qp.getKee()));
          dbClient.defaultQProfileDao().deleteByQProfileUuids(dbSession, uuids);
          dbClient.defaultQProfileDao().insertOrUpdate(dbSession, new DefaultQProfileDto()
            .setQProfileUuid(qualityProfile.getKee())
            .setLanguage(qp.getLanguage())
            .setOrganizationUuid(qp.getOrganizationUuid())
          );
  
          LOGGER.info("Default built-in quality profile for language [{}] has been updated from [{}] to [{}] since previous default does not have active rules.",
            qp.getLanguage(),
            qp.getName(),
            rulesProfile.getName());
        });
  
      dbSession.commit();
    }