Showing 18,390 of 18,390 total issues
Method set_method_form_vars
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_method_form_vars
session[:field_data] = {}
@ae_class = ae_class_for_instance_or_method(@ae_method)
@edit = {}
session[:edit] = {}
- 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 method_form_fields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def method_form_fields
assert_privileges("miq_ae_method_edit")
if params[:id] == 'new'
method = MiqAeMethod.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
Method host_form_fields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def host_form_fields
assert_privileges("host_edit")
host = find_record_with_rbac(Host, params[:id])
validate_against = if session.fetch_path(:edit, :validate_against) && params[:button] != "reset"
session.fetch_path(:edit, :validate_against)
- 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 items_to_delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def items_to_delete(selected)
ns_list = []
cs_list = []
selected.each do |items|
item = items.split('-')
- 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 fetch_automate_request_vars
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fetch_automate_request_vars(schedule)
assert_privileges(params[:id] == "new" ? "schedule_add" : "schedule_edit")
automate_request = {}
# incase changing type of schedule
- 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 help_menu_form_field_changed
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def help_menu_form_field_changed
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
Method schedule_form_fields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def schedule_form_fields
assert_privileges("schedule_edit")
schedule = MiqSchedule.find(params[:id])
- 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 demote_server
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def demote_server
assert_privileges("demote_server")
if @sb[:diag_selected_model] != "AssignedServerRole"
add_flash(_("Setting priority is not allowed for the selected item"), :error)
else
- 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 build_server_tree
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def build_server_tree(parent)
@server_tree = if @sb[:diag_tree_type] == "roles"
TreeBuilderRolesByServer.new(:roles_by_server_tree, @sb, true, :root => parent)
else
TreeBuilderServersByRole.new(:servers_by_role_tree, @sb, true, :root => parent)
- 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 label_tag_mapping_delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def label_tag_mapping_delete
assert_privileges("region_edit")
mapping = ProviderTagMapping.find(params[:id])
category = mapping.tag.classification
label_name = mapping.label_name
- 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 show_record
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def show_record(_id = nil)
@display = params[:display] || "main" unless pagination_or_gtl_request?
@lastaction = "show"
@showtype = "config"
- 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 settings_load_edit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def settings_load_edit
if selected?(x_node, "z") && @sb[:active_tab] != "settings_advanced"
# if zone node is selected
return unless load_edit("#{@sb[:active_tab]}_edit__#{@sb[:selected_zone_id]}", "replace_cell__explorer")
- 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 cluster_tree_settings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def cluster_tree_settings(model, id)
if id == "NonCluster" # Clicked on all non-clustered hosts
@edit[:new][:non_cl_hosts].each { |c| c[:capture] = params[:check] == "1" }
elsif model == "EmsCluster" # Clicked on a cluster
@edit[:new][id.to_i].each { |h| h[:capture] = params[:check] == "1" }
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update
assert_privileges('my_settings_default_filters')
tab_vars(@tabform.split('_').last)
if params["save"]
case @tabform
- 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 promote_server
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def promote_server
assert_privileges("promote_server")
if @sb[:diag_selected_model] != "AssignedServerRole"
add_flash(_("Setting priority is not allowed for the selected item"), :error)
else
- 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 filters_field_changed
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def filters_field_changed
assert_privileges('my_settings_default_filters')
return unless load_edit("config_edit__ui3", "configuration")
id = params[:id].split('-').last.to_i
- 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 pause_or_resume_emss
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def pause_or_resume_emss(options)
assert_privileges(params[:pressed])
# Test if multiple providers have been selected via checkboxes
if params[:miq_grid_checks].present? || params.keys.any? { |k| k.starts_with?('check') }
emss = find_checked_items
- 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 pxe_server_get_node_info
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def pxe_server_get_node_info(treenodeid)
if treenodeid == "root"
pxe_server_list
@right_cell_text = _("All PXE Servers")
@right_cell_div = "pxe_server_list"
- 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 pxe_image_type_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def pxe_image_type_list
assert_privileges('pxe_image_type_view')
@lastaction = "pxe_image_type_list"
@force_no_grid_xml = true
if params[:ppsetting] # User selected new per page value
- 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 pxe_server_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def pxe_server_list
assert_privileges('pxe_server_view')
@lastaction = "pxe_server_list"
@force_no_grid_xml = true
if params[:ppsetting] # User selected new per page value
- 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"