Showing 2,015 of 18,390 total issues
Method perf_gen_init_options
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def perf_gen_init_options(refresh = nil)
@perf_record = @record.kind_of?(MiqServer) ? @record.vm : @record # Use related server vm record
unless refresh == "n" || params[:refresh] == "n"
@perf_options = Options.new
tzs = TimeProfile.rollup_daily_metrics.all_timezones
- 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 comparemiq
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def comparemiq
assert_privileges(params[:pressed])
items = if !session[:checked_items].nil? && @lastaction == "set_checked_items"
session[:checked_items]
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 rbac_replace_right_cell
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def rbac_replace_right_cell(nodetype, presenter)
if %w[accordion_select change_tab tree_select].include?(params[:action])
presenter.replace(:ops_tabs, r[:partial => "all_tabs"])
elsif nodetype == "group_seq"
presenter.update(:rbac_details, r[:partial => "ldap_seq_form"])
- 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_resolve_screen
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def build_resolve_screen
@resolve ||= {}
@resolve[:new] ||= {}
@resolve[:new][:starting_object] ||= "SYSTEM/PROCESS"
@resolve[:new][:readonly] = false unless @resolve[:new][:readonly]
- 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 copy_objects_get_form_vars
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def copy_objects_get_form_vars
%w[domain override_existing override_source namespace new_name].each do |field|
fld = field.to_sym
if %w[override_existing override_source].include?(field)
@edit[:new][fld] = params[fld] == "1" if params[fld]
- 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_event_log
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def ap_get_form_vars_event_log
session[:nteventlog_data] = {}
if params[:entry]["name"] == ""
session[:nteventlog_data][:name] = params[:entry]["name"]
session[:nteventlog_data][:message] = params[:entry]["message"]
- 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 cu_collection_field_changed
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def cu_collection_field_changed
assert_privileges("region_edit")
return unless load_edit("cu_edit__collection", "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 button
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def button
@edit = session[:edit] # Restore @edit for adv search box
params[:display] = @display if ["#{params[:controller]}s"].include?(@display) # displaying container_*
params[:page] = @current_page if @current_page.nil? # Save current page for list refresh
- 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 rsop
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def rsop
assert_privileges('policy_simulation')
if params[:button] == "submit"
if params[:task_id] # First time thru, kick off the report generate task
miq_task = MiqTask.find(params[:task_id]) # Not first time, read the task 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"
Further reading
Method folder_get_info
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def folder_get_info(folder_node)
nodetype, nodeid = folder_node.split("_")
@sb[:mode] = nil
@sb[:nodeid] = nil
@sb[:folder] = nodeid.nil? ? nodetype.split("-").last : nodeid
- 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_button_operation
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def pxe_button_operation(method, display_name)
pxes = []
# Either a list or coming from a different controller (eg from host screen, go to its vms)
if !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 iso_datastore_button_operation
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def iso_datastore_button_operation(method, display_name)
isds = []
# Either a list or coming from a different controller (eg from host screen, go to its vms)
if !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 scaling
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def scaling
assert_privileges("ems_infra_scale")
# Hiding the toolbars
@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 gfv_model
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def gfv_model
if params[:chosen_model] && # Check for db table changed
params[:chosen_model] != @edit[:new][:model]
@edit[:new][:model] = params[:chosen_model]
@edit[:new][:perf_interval] = nil # Clear performance interval setting
- 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 log_depot_validate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def log_depot_validate
@schedule = nil # setting to nil, since we are using same view for both db_back and log_depot edit
# if zone is selected in tree replace tab#3
pfx = if x_active_tree == :diagnostics_tree
if @sb[:active_tab] == "diagnostics_database"
- 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 report_selection_menus
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def report_selection_menus
@folders = []
@menu.each do |r|
@folders.push(r[0])
next if @edit[:new][:filter].blank?
- 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 drop_breadcrumb
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def drop_breadcrumb(new_bc, onlyreplace = false)
# if the breadcrumb is in the array, remove it and all below by counting how many to pop
return if skip_breadcrumb?
remove = 0
- 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 render_or_redirect_partial
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def render_or_redirect_partial(pfx)
if @redirect_controller
if ["#{pfx}_clone", "#{pfx}_migrate", "#{pfx}_publish"].include?(params[:pressed])
if flash_errors?
javascript_flash
- 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_folders
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def menu_folders(view)
view.compact.map do |row|
row_id = nil
if @edit[:user_typ]
- 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 x_get_tree_server_roles
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def x_get_tree_server_roles
ServerRole.all.sort_by(&:description).each_with_object([]) do |r, objects|
next if @root.kind_of?(MiqRegion) && !r.regional_role? # Only regional roles under Region
next unless (@root.kind_of?(Zone) && r.miq_servers.any? { |s| s.my_zone == @root.name }) ||
(@root.kind_of?(MiqRegion) && !r.miq_servers.empty?) # Skip if no assigned servers in this 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"