Showing 18,390 of 18,390 total issues
Method create_method
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_method
assert_privileges("miq_ae_method_new")
@in_a_form = true
case params[:button]
when "cancel"
- 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 set_instances_value_vars
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_instances_value_vars(vals, ae_instance = nil)
original_values = ae_instance ? ae_instance.ae_values : []
vals.each_with_index do |v, i|
original = original_values.detect { |ov| ov.id == v.id } unless original_values.empty?
- 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 ap_get_form_vars_category
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ap_get_form_vars_category
item_type = params[:item_type]
@edit[:new][item_type] ||= {}
@edit[:new][item_type][:type] = params[:item_type]
@edit[:new][item_type][:definition] = {} if @edit[:new][item_type][:definition].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 build_filtered_item_list
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def build_filtered_item_list(action_type, filter_type)
case filter_type
when "vm"
filtered_item_list = find_filtered(Vm).sort_by { |vm| vm.name.downcase }.collect(&:name).uniq
when "miq_template"
- 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 rbac_group_delete
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def rbac_group_delete
assert_privileges("rbac_group_delete")
groups = []
if params[:id].nil? # showing a list
ids = find_checked_items.collect { |r| r.to_s.split("-").last }
- 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 smartproxy_affinity_get_form_vars
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def smartproxy_affinity_get_form_vars(id, checked)
# Add/remove affinity based on the node that was checked
server_id, child = id.split('__')
if server_id.include?('svr')
- 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 rbac_role_delete
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def rbac_role_delete
assert_privileges("rbac_role_delete")
roles = []
if params[:id].nil? # showing a role list
ids = find_checked_items.collect { |r| r.to_s.split("-").last }
- 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 forest_select
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def forest_select
assert_privileges("ops_settings")
forest_get_form_vars
if params[:ldaphost_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
Method move_cols_down
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def move_cols_down
return unless load_edit("rbac_group_edit__seq", "replace_cell__explorer")
if params[:seq_fields].blank? || params[:seq_fields][0] == ""
add_flash(_("No fields were selected to move down"), :error)
- 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 logs_collect
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def logs_collect(options = {})
options[:support_case] = params[:support_case] if params[:support_case]
obj, id = x_node.split("-")
assert_privileges("#{obj == "z" ? "zone_" : ""}collect_logs")
klass = obj == "svr" ? MiqServer : Zone
- 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 index
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def index
assert_privileges('my_settings_view')
@breadcrumbs = []
active_tab = nil
if role_allows?(:feature => "my_settings_visuals")
- 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 iso_datastore_list
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def iso_datastore_list
assert_privileges('iso_datastore_view')
@lastaction = "iso_datastore_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 specific_buttons
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def specific_buttons(pressed)
return false unless BUTTON_TO_ACTION_MAPPING.include?(pressed)
if pressed == "cloud_volume_refresh"
queue_refresh(controller_to_model)
- 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_alert_set_assign
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def miq_alert_set_assign
assert_privileges("miq_alert_set_assign")
@assign = @sb[:assign]
@alert_profile = @assign[:alert_profile] if @assign
case params[:button]
- 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 alert_profile_assign_changed
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def alert_profile_assign_changed
@assign = @sb[:assign]
@alert_profile = @assign[:alert_profile]
if params.key?(:chosen_assign_to)
- 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 create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create
assert_privileges("cloud_volume_new")
case params[:button]
when "cancel"
flash_and_redirect(_("Add of new Cloud Volume was cancelled by the user"))
- 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 common_st_record_vars
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def common_st_record_vars(st)
st.name = @edit[:new][:name]
st.description = @edit[:new][:description]
st.long_description = @edit[:new][:display] ? @edit[:new][:long_description] : nil
st.provision_cost = @edit[:new][:provision_cost]
- 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 authenticate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def authenticate
@layout = "dashboard"
unless params[:task_id] # First time thru, check for buttons pressed
# Handle More and Back buttons (for changing password)
- 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 menu_editor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def menu_editor
assert_privileges("miq_report_menu_editor")
menu_set_form_vars if %w[explorer tree_select x_history].include?(params[:action])
@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
Method set_elements_and_redirect_unauthorized_user
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_elements_and_redirect_unauthorized_user
@nodetype, _id = parse_nodetype_and_id(params[:id])
prefix = prefix_by_nodetype(@nodetype)
# Position in tree that matches selected record
- 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"