Showing 2,015 of 18,390 total issues
Method drift_record_nonexistmode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def drift_record_nonexistmode(idx, match, value_found, last_value)
text = value_found ? _("Found") : _("Missing")
if value_found # This object has the record
if last_value && match == 100
drift_add_same_image(idx, text)
- 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 check_git_task
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_git_task
assert_privileges('miq_ae_class_import_export')
task = MiqTask.find(params[:task_id])
json = if task.state != MiqTask::STATE_FINISHED
{:state => task.state}
- 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 val_type_for
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def val_type_for(key, field)
if !self[key] || !self[field]
nil
elsif self[key].starts_with?('REG')
:regexp
- 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 through_choices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.through_choices(from_choice)
return nil if from_choice.nil?
tc = if ViewHelper::FROM_HOURS.include?(from_choice)
ViewHelper::FROM_HOURS
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def move_cols_down
if params[:selected_fields].blank? || params[:selected_fields][0] == ""
add_flash(_("No fields were selected to move down"), :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 adv_search_clear
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def adv_search_clear
respond_to do |format|
format.js do
@explorer = true
if x_active_tree.to_s =~ /_filter_tree$/ &&
- 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 exp_available_cfields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def exp_available_cfields
MiqExpression.miq_adv_search_lists(exp_model, :exp_available_finds).each_with_object([]) do |af, res|
next if af.last == exp_field
next unless af.last.split('-').first == exp_field.split('-').first
- 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_active_tab
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_active_tab(nodetype)
node = nodetype.downcase.split("-")
case x_active_tree
when :settings_tree
case node[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 show_record
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def show_record(_id = nil)
@display = params[:display] || "main" unless pagination_or_gtl_request?
@lastaction = "show"
@showtype = "config"
- 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_event_actions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_event_actions
@event ||= MiqEventDefinition.find_by(:id => @edit[:new][:event_id])
@edit[:new][:actions_true] = []
@policy ||= MiqPolicy.find_by(:id => @edit[:new][:policy_id]) # Get the policy above this event
- 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 storage_pod_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def storage_pod_list
assert_privileges('storage_pod_show_list')
@lastaction = "storage_pod_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 open_parent_nodes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def open_parent_nodes(record)
nodes = record.fqname.split("/")
parents = []
nodes.each_with_index do |_, i|
if i == nodes.length - 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 storage_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def storage_list
assert_privileges('storage_show_list')
@lastaction = "storage_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 set_method_form_vars
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_method_form_vars
session[:field_data] = {}
@ae_class = ae_class_for_instance_or_method(@ae_method)
@edit = {}
session[:edit] = {}
- 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 method_form_fields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def method_form_fields
assert_privileges("miq_ae_method_edit")
if params[:id] == 'new'
method = MiqAeMethod.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 host_form_fields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def host_form_fields
assert_privileges("host_edit")
host = find_record_with_rbac(Host, params[:id])
validate_against = if session.fetch_path(:edit, :validate_against) && params[:button] != "reset"
session.fetch_path(:edit, :validate_against)
- 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 items_to_delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def items_to_delete(selected)
ns_list = []
cs_list = []
selected.each do |items|
item = items.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 fetch_automate_request_vars
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fetch_automate_request_vars(schedule)
assert_privileges(params[:id] == "new" ? "schedule_add" : "schedule_edit")
automate_request = {}
# incase changing type of schedule
- 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 help_menu_form_field_changed
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def help_menu_form_field_changed
assert_privileges("region_edit")
return unless load_edit('customize_help_menu')
- 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 schedule_form_fields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def schedule_form_fields
assert_privileges("schedule_edit")
schedule = MiqSchedule.find(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"