Showing 18,390 of 18,390 total issues
Method settings_analysis_profile_summary
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def settings_analysis_profile_summary(selected_scan, categories, files, file_stats, registry, nteventlog)
- Create a ticketCreate a ticket
Method record_name
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def record_name(rec)
column = rec.display_name.blank? ? :name : :display_name
rec_name = if rec.kind_of?(MiqAeNamespace) && rec.domain?
editable_domain?(rec) && rec.enabled ? rec.send(column) : add_read_only_suffix(rec.send(column), editable_domain?(rec), rec.enabled)
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
Avoid deeply nested control flow statements. Open
return x_node == "root" ? "miq_report_schedules_center_tb" : "miq_report_schedule_center_tb"
- Create a ticketCreate a ticket
Method center_toolbar_filename_storage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def center_toolbar_filename_storage
if x_active_tree == :storage_tree
if x_node_split.first == 'ds'
return "storage_center_tb"
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 def_searches_active_filter?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def def_searches_active_filter?(search)
if @edit && @edit[:expression] &&
((default_search?(search.name) || no_default_search?(search.id)) && expression_selected_nil_or_id(search.id) ||
(@edit[:expression][:selected] && @edit[:expression][:selected][:id].zero? && search.id.to_i.zero? ||
expression_selected_id_or_name(:name, search.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 miq_summary_alert_send_email
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def miq_summary_alert_send_email(alert, email_to)
alert_options = alert.options
if alert_options && alert_options[:notifications] && alert.options[:notifications][:email].present?
rows = []
data = {:title => _('Send E-mail'), :mode => "miq_alert_send_email", :rows => []}
- 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
if @tagging
return false # when tagging Users, Groups, Roles and Tenants, the table is non-clickable
else
return "/" + request.parameters[:controller] + "/tree_select/?id=" + x_node.split("-")[1]
end
- Create a ticketCreate a ticket
Method process_managers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_managers(managers, task)
controller_class = request.parameters[:controller]
provider_class = case controller_class
when 'ems_automation' then ManageIQ::Providers::AutomationManager
when 'ems_configuration' then ManageIQ::Providers::ConfigurationManager
- 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 view.db == "MiqServer" &&
%w[ops report].include?(request.parameters[:controller])
return "/" + request.parameters[:controller] + "/tree_select/?id=" + TREE_WITH_TAB[active_tab]
elsif %w[ScanItemSet
MiqSchedule
- Create a ticketCreate a ticket
Method javascript_for_miq_button_visibility
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def javascript_for_miq_button_visibility(display, prefix = nil)
if prefix
"miqButtons('#{display ? 'show' : 'hide'}', '#{prefix}');".html_safe
else
"miqButtons('#{display ? 'show' : 'hide'}');".html_safe
- 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 perf_menu_click
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def perf_menu_click
# Parse the clicked item to get indexes and selection variables
chart_click_data = parse_chart_click(params[:menu_click])
# Swap in 'Instances' for 'VMs' in AZ breadcrumbs (poor man's cloud/infra split hack)
bc_model = %w[availability_zone host_aggregate].include?(request.parameters['controller']) && chart_click_data.model == 'VMs' ? 'Instances' : chart_click_data.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 prov_vm_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def prov_vm_data(data)
edit = data[:edit]
clones = [:clone_to_template, :clone_to_vm]
headers = prov_grid_vm_header(edit, clones, data[:vms], data[:type])
rows = []
- 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
next if @edit[:new][ppid] == @edit[:current][ppid] # Only process changes
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
elsif @edit[:new][:current_tab_key] == :purpose
build_tags_for_provisioning(@edit[:wf], @edit[:new][:vm_tags], true)
- Create a ticketCreate a ticket
Method drift_add_section_field_compressed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def drift_add_section_field_compressed(view, section, field)
row = {}
view.ids.each_with_index do |id, idx|
fld = view.results.fetch_path(id, section[:name], field[:name])
val = fld[:_value_].to_s unless fld.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 get_timezone_offset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_timezone_offset(user = nil, formatted = false)
tz = user ? user.get_timezone : server_timezone
tz = ActiveSupport::TimeZone::MAPPING[tz]
ActiveSupport::TimeZone.all.each do |a|
if ActiveSupport::TimeZone::MAPPING[a.name] == tz
- 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
if params[key] == "__HOST__NONE__" # Added this to deselect datastore in grid
@edit[:new][f.to_sym] = [nil, nil] # Save [value, description]
elsif v.id.to_i == val.to_i
@edit[:new][f.to_sym] = [val, v.name] # Save [value, description]
end
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
cols[i].gsub!(/\*\s/, "") if csv # If generating CSV
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
@edit[:hide_deprecated_templates] = provisioning_is_cloud? ? params[:hide_deprecated_templates] == "true" : nil
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if @edit[:wf].supports_customization_template?
build_template_grid(@edit[:wf].send("allowed_customization_templates"), @edit[:template_sortdir], @edit[:template_sortcol])
else
build_vc_grid(@edit[:wf].get_field(:sysprep_custom_spec, :customize)[:values], @edit[:vc_sortdir], @edit[:vc_sortcol])
end
- Create a ticketCreate a ticket