Showing 2,015 of 18,390 total issues
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"
Further reading
Method edit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def edit
assert_privileges("#{permission_prefix}_edit")
begin
@ems = find_record_with_rbac(model, params[:id]) ## TODO is params[:id] supposed to be checked_item_id? This assumes only one id is passed in
rescue => err
- 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 special_page_breadcrumb
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def special_page_breadcrumb(variable, explorer = false, x_node = nil)
# breadcrumb_url = url(controller_url, notshow, variable.first[:id])
# EMS has key instead of name
return if !variable || variable.count != 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 st_upload_image
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def st_upload_image
assert_privileges("st_catalog_edit")
err = false
identify_catalog(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 dialog_get_node_info
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def dialog_get_node_info(treenodeid)
if treenodeid == "root"
dialog_list
@right_cell_text = _("All Dialogs")
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 ot_remove_submit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ot_remove_submit
assert_privileges("orchestration_template_remove")
elements = find_records_with_rbac(OrchestrationTemplate, checked_or_params)
elements.each do |ot|
if ot.in_use?
- 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 old_dialogs_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def old_dialogs_list
assert_privileges('old_dialogs_accord') # feature like miq_ae_customization_old_dialogs_list is missing
@lastaction = "old_dialogs_list"
@force_no_grid_xml = true
@dialog = 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 dialog_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def dialog_list
assert_privileges('dialog_accord') # feature like miq_ae_customization_dialog_list is missing
@lastaction = "dialog_list"
@explorer = 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"