docs: public QProfileDto getProfile(DbSession dbSession, QProfileReference ref) {
      QProfileDto profile;
      if (ref.hasKey()) {
        profile = dbClient.qualityProfileDao().selectByUuid(dbSession, ref.getKey());
        checkFound(profile, "Quality Profile with key '%s' does not exist", ref.getKey());
        // Load organization to execute various checks (existence, membership if paid organization, etc.)
        getOrganization(dbSession, profile);
      } else {
        OrganizationDto org = getOrganizationByKey(dbSession, ref.getOrganizationKey().orElse(null));
        profile = dbClient.qualityProfileDao().selectByNameAndLanguage(dbSession, org, ref.getName(), ref.getLanguage());
        checkFound(profile, "Quality Profile for language '%s' and name '%s' does not exist%s", ref.getLanguage(), ref.getName(),
          ref.getOrganizationKey().map(o -> " in organization '" + o + "'").orElse(""));
      }
      return profile;
    }