package org.sonar.server.qualityprofile;
-import org.sonar.server.paging.Paging;
-
import com.google.common.base.Strings;
import org.sonar.api.ServerComponent;
import org.sonar.api.component.Component;
import org.sonar.server.exceptions.BadRequestException;
+import org.sonar.server.paging.Paging;
import org.sonar.server.user.UserSession;
import org.sonar.server.util.Validation;
// PROFILE RULES
+ @CheckForNull
public QProfileRule findByRule(int ruleId) {
return rules.findByRuleId(ruleId);
}
+ @CheckForNull
public QProfileRule findByActiveRuleId(int activeRuleId) {
return rules.findByActiveRuleId(activeRuleId);
}
+ @CheckForNull
public QProfileRule findByProfileAndRule(int profileId, int ruleId) {
return rules.findByProfileIdAndRuleId(profileId, ruleId);
}
call_backend do
@profile = Internal.quality_profiles.profile(params[:id].to_i)
+ not_found('Profile not found') unless @profile
@parent = Internal.quality_profiles.parent(@profile) if @profile.parent
@ancestors = Internal.quality_profiles.ancestors(@profile).to_a
@children = Internal.quality_profiles.children(@profile).to_a
require_parameters 'id'
call_backend do
@profile = Internal.quality_profiles.profile(params[:id].to_i)
+ not_found('Profile not found') unless @profile
end
render :partial => 'profiles/rename_form'
end
call_backend do
@profile = Internal.quality_profiles.profile(params[:id].to_i)
+ not_found('Profile not found') unless @profile
@parent_profile = Internal.quality_profiles.parent(@profile) if @profile.parent()
add_breadcrumbs ProfilesController::root_breadcrumb, Api::Utils.language_name(@profile.language),
# form to duplicate a rule
require_parameters :id, :rule_id
@profile = Internal.quality_profiles.profile(params[:id].to_i)
+ not_found('Profile not found') unless @profile
add_breadcrumbs ProfilesController::root_breadcrumb, Api::Utils.language_name(@profile.language),
{:name => @profile.name, :url => {:controller => 'rules_configuration', :action => 'index', :id => @profile.id}}
call_backend do
@profile = Internal.quality_profiles.profile(params[:id].to_i)
+ not_found('Profile not found') unless @profile
@rule = Internal.quality_profiles.findByRule(params[:rule_id].to_i)
if @rule.templateId().nil?
redirect_to :action => 'index', :id => params[:id]
stop_watch = Internal.profiling.start("rules", "BASIC")
@profile = Internal.quality_profiles.profile(params[:id].to_i)
+ not_found('Profile not found') unless @profile
init_params
criteria = init_criteria
query = Java::OrgSonarServerQualityprofile::ProfileRuleQuery::parse(criteria.to_java)