* If no profile found, try to find the quality profile set on the project (if provided)
* If still no profile found, try to find the default profile of the language
* <p/>
- * Never return null because a default profile should always be set on ech language
+ * Never return null because a default profile should always be set on each language
*/
private QualityProfileDto getProfile(String languageKey, @Nullable String projectKey, @Nullable String profileName, DbSession session) {
QualityProfileDto qualityProfileDto = profileName != null ? qProfileFactory.getByNameAndLanguage(session, profileName, languageKey) : null;
private static final String PARAM_LANGUAGE = FIELD_LANGUAGE;
private final Languages languages;
-
private final QProfileLookup profileLookup;
-
private final QProfileLoader profileLoader;
-
private final QualityProfileDao qualityProfileDao;
public SearchAction(Languages languages, QProfileLookup profileLookup, QProfileLoader profileLoader, QualityProfileDao qualityProfileDao) {
.setSince("5.2")
.setDescription("List quality profiles.")
.setHandler(this)
+ .addFieldsParam(ALL_FIELDS)
.setResponseExample(getClass().getResource("example-search.json"));
search.createParam(PARAM_LANGUAGE)
.setDescription("The key of a language supported by the platform. If specified, only profiles for the given language are returned.")
- .setExampleValue("js")
.setPossibleValues(LanguageParamUtils.getLanguageKeys(languages));
-
- search.createParam(Param.FIELDS)
- .setDescription("Use to restrict returned fields.")
- .setExampleValue("key,language")
- .setPossibleValues(ALL_FIELDS);
}
@Override