Showing 285 of 1,314 total issues
Method update_request_status
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def update_request_status
states = Hash.new { |h, k| h[k] = 0 }
status = Hash.new { |h, k| h[k] = 0 }
child_requests = miq_request_tasks
- 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_table
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def build_table(data, _db, options = {})
data = data.to_a
objs = data[0] && data[0].kind_of?(Integer) ? db_class.where(:id => data) : data.compact
remove_loading_relations_for_virtual_custom_attributes
- 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 deliver
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def deliver(requester = nil, &block)
result = nil
delivered_on
_log.info("#{MiqQueue.format_short_log_msg(self)}, Delivering...")
- 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 vim_performance_state_for_ts
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def vim_performance_state_for_ts(ts)
ts = Time.parse(ts).utc if ts.kind_of?(String)
ts_iso = ts.utc.iso8601
return nil unless respond_to?(:vim_performance_states)
- 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 parse_contents
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def self.parse_contents(contents)
items = []
current_item = nil
contents.each_line do |line|
- 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_sort_table
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def build_sort_table
return if sortby.nil? # Are there any sort fields
new_sortby = build_sort_suffix_data
sb_nil_sub = []
- 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_targets
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def get_targets
if @options[:targets]
@compute = Array.wrap(@options[:targets][:compute])
@storage = Array.wrap(@options[:targets][:storage])
elsif @options[:target_tags]
- 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_server_proxies
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def miq_server_proxies
case vendor
when 'vmware'
# VM cannot be scanned by server if they are on a repository
return [] if storage_id.blank? || repository_vm?
- 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 normalize
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def self.normalize(rel_time, tz, mode = "beginning", is_date = nil)
# time_spec =
# <value> <interval> Ago
# "Today"
# "Yesterday"
- 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 validate
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def validate
if self.options.kind_of?(Hash) && self.options.fetch_path(:notifications, :automate)
event_name = self.options.fetch_path(:notifications, :automate, :event_name)
unless (event_name =~ /[^a-z0-9_]/i).nil?
errors.add("Event Name", "must be alphanumeric characters and underscores without spaces")
- 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_or_default_field_values
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def set_or_default_field_values(values)
field_names = values.keys
fields do |fn, f, _dn, _d|
if field_names.include?(fn)
if f.key?(:values)
- 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_performance_chart_area
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def build_performance_chart_area(maxcols)
tz = mri.get_time_zone(Time.zone.name)
mri.graph[:columns].each_with_index do |col, col_idx|
next if col_idx >= maxcols
- 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 fqusername
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def fqusername(username)
return username if dn?(username) || domain_username?(username)
user_type = @user_type.split("-").first
return username if user_type != "mail" && upn?(username)
- 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_document_header
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Open
def build_document_header
super
type = c3_convert_type(mri.graph[:type].to_s)
mri.chart = {
:miqChart => type,
- 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 refresh_internal
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def refresh_internal(ems_id_or_object_ids, ems_ref, queue:)
targets =
if ems_ref.nil?
Array(ems_id_or_object_ids).map { |id| [base_class, id] }
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 set_customization_spec
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def set_customization_spec(custom_spec_name, override = false)
if custom_spec_name.nil?
disable_customization_spec
else
custom_spec_name = custom_spec_name.name unless custom_spec_name.kind_of?(String)
- 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 to_dot
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def to_dot(include_starred_states = false)
all_states = transitions.values.map(&:to_a).flatten.uniq.reject { |t| t == "*" }
"".tap do |s|
s << "digraph #{self.class.name.inspect} {\n"
- 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_message_via_drb
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def get_message_via_drb
loop do
begin
msg_id, lock_version = worker_monitor_drb.get_queue_message(@worker.pid)
rescue DRb::DRbError => err
- 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 format_boolean
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def format_boolean(val, options = {})
return val.to_s.titleize if options.blank?
return val.to_s.titleize unless val.kind_of?(TrueClass) || val.kind_of?(FalseClass)
case options[:format]
- 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_pivot
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def build_pivot(data)
return data unless rpt_options && rpt_options.key?(:pivot)
return data if data.blank?
# Build a tempory table so that ruport sorting can be used to sort data before summarizing pivot data
- 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"