Showing 2,015 of 18,390 total issues
Avoid deeply nested control flow statements. Open
self.exp_skey = nil unless MiqExpression.get_col_operators(exp_field).include?(exp_skey)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
elsif %w[rbac_role_add rbac_role_copy rbac_role_edit].include?(@sb[:action])
action_url = "rbac_role_edit"
record_id = @edit[:role_id] ? @edit[:role_id] : nil
elsif %w[rbac_group_add rbac_group_edit].include?(@sb[:action])
action_url = "rbac_group_edit"
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
elsif params[field_name]
fld[field] = params[field_name]
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if @report.graph.present?
@render_chart = true
@ght_type = "hybrid"
else
@ght_type = "tabular"
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
record_id = @edit[:user_id] ? @edit[:user_id] : nil
- Create a ticketCreate a ticket
Method policy_edit_reset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def policy_edit_reset
@policy = params[:id] ? MiqPolicy.find(params[:id]) : MiqPolicy.new # Get existing or new record
assert_privileges("miq_policy_#{@policy.id ? "edit" : "new"}")
@in_a_form = true
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
fld[field] = params[field_name] if params[field_name]
- Create a ticketCreate a ticket
Method form_copy_objects_field_changed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def form_copy_objects_field_changed
assert_privileges(feature_by_action)
return unless load_edit("copy_objects__#{params[:id]}", "replace_cell__explorer")
copy_objects_get_form_vars
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method miq_policy_edit_events
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def miq_policy_edit_events
assert_privileges('miq_policy_events_assignment')
case params[:button]
when "cancel"
@sb[:action] = @edit = nil
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method ce_select
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ce_select
assert_privileges("region_edit")
ce_get_form_vars
if params[:id] == "new"
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
fld[field] = params["fields_password_value_#{i}".to_sym] if params["fields_password_value_#{i}".to_sym]
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if %w[ap_copy ap_edit ap_host_edit ap_vm_edit].include?(@sb[:action])
action_url = "ap_edit"
record_id = @edit[:scan_id] ? @edit[:scan_id] : nil
elsif %w[schedule_add schedule_edit].include?(@sb[:action])
action_url = "schedule_edit"
- Create a ticketCreate a ticket
Method copy_save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def copy_save
assert_privileges(feature_by_action)
return unless load_edit("copy_objects__#{params[:id]}", "replace_cell__explorer")
begin
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
elsif @sb[:active_tab] == "settings_tags" && @sb[:active_subtab] == "settings_co_categories" && @in_a_form
action_url = "category_edit"
record_id = @category.try(:id)
elsif @sb[:active_tab] == "settings_tags" && @sb[:active_subtab] == "settings_label_tag_mapping" && @in_a_form
action_url = "label_tag_mapping_edit"
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
self.x_node = "xx-sis" if params[:button] == "add"
- Create a ticketCreate a ticket
Method settings_update_help_menu
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def settings_update_help_menu
assert_privileges("region_edit")
return unless load_edit('customize_help_menu')
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
case schedule.filter.exp[key]["field"]
when "Vm.ext_management_system-name",
"MiqTemplate.ext_management_system-name",
"Storage.ext_management_systems-name",
"Host.ext_management_system-name",
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
@sb[:miq_tab] = @scan.mode == "Host" ? "edit_2" : "edit_1"
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if @sb[:active_tab] == "diagnostics_evm_log"
@log = fetch_local_log("evm")
add_flash(_("Logs for this %{product} Server are not available for viewing") % {:product => Vmdb::Appliance.PRODUCT_NAME}, :warning) if @log.blank?
@msg_title = _("ManageIQ")
@refresh_action = "refresh_log"
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
@scan.mode = params[:typ] if params[:typ]
- Create a ticketCreate a ticket