Showing 2,015 of 18,390 total issues
Method drift_record_field_compressed
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def drift_record_field_compressed(view, section, record, field)
basval = ""
row = {:col0 => field[:header].to_s}
view.ids.each_with_index do |id, idx|
- 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 comp_add_total
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def comp_add_total(view)
row = {
:col0 => "<span class='cell-effort-driven cell-plain'>" + _("Total Matches") + "</span>",
:id => "id_#{@rows.length}",
:total => 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 comp_add_section_field_compressed
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def comp_add_section_field_compressed(view, section, field)
row = {}
base_val = view.results.fetch_path(view.ids[0], section[:name], field[:name], :_value_)
view.ids.each_with_index do |id, idx|
fld = view.results.fetch_path(id, section[:name], field[: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 comp_add_record_field_exists_expanded
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def comp_add_record_field_exists_expanded(idx, val, base_rec, field)
if @exists_mode
passed_text_color = failed_text_color = "black"
else
passed_text_color = "#403990"
- 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 parent_folder_id
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def parent_folder_id(vm)
if vm.orphaned
"xx-orph"
elsif vm.archived
"xx-arch"
- 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 setup_presenter_for_old_dialogs_tree
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def setup_presenter_for_old_dialogs_tree(nodetype, presenter)
nodes = nodetype.split("_")
if nodetype == "root" || nodes[0].split('-').first != "odg"
partial = nodetype == 'root' ? 'old_dialogs_list' : 'layouts/x_gtl'
presenter.update(:main_div, render_proc[:partial => partial])
- 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 rebuild_toolbars
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def rebuild_toolbars(record_showing, presenter)
if !@in_a_form && !@sb[:action]
center_tb = center_toolbar_filename
c_tb = build_toolbar(center_tb)
- 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 custom_toolbar_explorer
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def custom_toolbar_explorer
if x_tree
if @display == "main" && @record
Mixins::CustomButtons::Result.new(:single)
elsif @lastaction == "show_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 ap_get_form_vars_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ap_get_form_vars_file
if params[:entry]['fname'].blank?
add_flash(_("File Entry is required"), :error)
return
end
- 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 delete_namespaces_or_classes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def delete_namespaces_or_classes
selected = find_checked_items
ae_ns = []
ae_cs = []
node = x_node.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 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"