Showing 18,390 of 18,390 total issues
Method rewind
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def rewind(direction)
case direction
when 'undo'
if idx.positive?
self.idx -= 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 adv_search_button
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def adv_search_button
@edit = session[:edit]
@view = session[:view]
# setting default to false
- 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
self.exp_ckey = nil unless MiqExpression.get_col_operators(exp_cfield).include?(exp_ckey)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
@right_cell_text = if model
_("Archived %{models}") % {:models => ui_lookup(:models => model)}
else
_("Archived VMs & Templates")
end
- Create a ticketCreate a ticket
Method replace_right_cell
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def replace_right_cell(options = {})
nodetype, replace_trees = options.values_at(:nodetype, :replace_trees)
if params[:pressed] == "custom_button"
presenter = set_custom_button_dialog_presenter(options)
render :json => presenter.for_render
- 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 valid_resolve_object?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def valid_resolve_object?
add_flash(_("Starting Class must be selected"), :error) if @resolve[:new][:starting_object].blank?
if @resolve[:new][:instance_name].blank? && @resolve[:new][:other_name].blank?
add_flash(_("Starting Process is required"), :error)
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
Avoid deeply nested control flow statements. Open
self.exp_key = nil unless MiqExpression.get_col_operators(:count).include?(exp_key)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
self.exp_skey = nil unless MiqExpression.get_col_operators(exp_field).include?(exp_skey)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
elsif %w[rbac_role_add rbac_role_copy rbac_role_edit].include?(@sb[:action])
action_url = "rbac_role_edit"
record_id = @edit[:role_id] ? @edit[:role_id] : nil
elsif %w[rbac_group_add rbac_group_edit].include?(@sb[:action])
action_url = "rbac_group_edit"
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
elsif params[field_name]
fld[field] = params[field_name]
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if @report.graph.present?
@render_chart = true
@ght_type = "hybrid"
else
@ght_type = "tabular"
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
record_id = @edit[:user_id] ? @edit[:user_id] : nil
- Create a ticketCreate a ticket
Method policy_edit_reset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def policy_edit_reset
@policy = params[:id] ? MiqPolicy.find(params[:id]) : MiqPolicy.new # Get existing or new record
assert_privileges("miq_policy_#{@policy.id ? "edit" : "new"}")
@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
Avoid deeply nested control flow statements. Open
fld[field] = params[field_name] if params[field_name]
- Create a ticketCreate a ticket
Method form_copy_objects_field_changed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def form_copy_objects_field_changed
assert_privileges(feature_by_action)
return unless load_edit("copy_objects__#{params[:id]}", "replace_cell__explorer")
copy_objects_get_form_vars
- 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_policy_edit_events
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def miq_policy_edit_events
assert_privileges('miq_policy_events_assignment')
case params[:button]
when "cancel"
@sb[:action] = @edit = 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 ce_select
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ce_select
assert_privileges("region_edit")
ce_get_form_vars
if params[: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
Avoid deeply nested control flow statements. Open
fld[field] = params["fields_password_value_#{i}".to_sym] if params["fields_password_value_#{i}".to_sym]
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if %w[ap_copy ap_edit ap_host_edit ap_vm_edit].include?(@sb[:action])
action_url = "ap_edit"
record_id = @edit[:scan_id] ? @edit[:scan_id] : nil
elsif %w[schedule_add schedule_edit].include?(@sb[:action])
action_url = "schedule_edit"
- Create a ticketCreate a ticket
Method copy_save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def copy_save
assert_privileges(feature_by_action)
return unless load_edit("copy_objects__#{params[:id]}", "replace_cell__explorer")
begin
- 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"