Showing 288 of 997 total issues
Method update_authentication
has a Cognitive Complexity of 33 (exceeds 11 allowed). Consider refactoring. Open
def update_authentication(data, options = {})
return if data.blank?
options.reverse_merge!(:save => 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 apply_belongsto_filters
has a Cognitive Complexity of 33 (exceeds 11 allowed). Consider refactoring. Open
def self.apply_belongsto_filters(inputs, bfilters)
return [] if inputs.nil?
return inputs if bfilters.empty?
vcmeta_index = bfilters.index_with { |tag| belongsto2object_list(tag) }
- 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 discoverHost
has a Cognitive Complexity of 32 (exceeds 11 allowed). Consider refactoring. Open
def self.discoverHost(options)
require 'manageiq/network_discovery/discovery'
ost = OpenStruct.new(Marshal.load(options))
_log.info("Discovering Host: #{ost_inspect(ost)}")
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"
Further reading
Method build_hash_filter_expression
has a Cognitive Complexity of 30 (exceeds 11 allowed). Consider refactoring. Open
def build_hash_filter_expression(value, other_value = nil, filter_type = "Base")
check_compliance = sched_action&.dig(:method) == "check_compliance"
filter_resource_type = if check_compliance
if resource_type == "ContainerImage"
"ContainerImageCheckCompliance"
- 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 xml_to_hashes
has a Cognitive Complexity of 30 (exceeds 11 allowed). Consider refactoring. Open
def self.xml_to_hashes(xmlNode, findPath, typeName = nil)
el = XmlFind.findElement(findPath, xmlNode.root)
return nil unless MiqXml.isXmlElement?(el)
result = []
- 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 29 (exceeds 11 allowed). Consider refactoring. Open
def validate
case action_type
when "email"
self.options ||= {}
self.options[:to] ||= ""
- 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 calculate_costs
has a Cognitive Complexity of 29 (exceeds 11 allowed). Consider refactoring. Open
def calculate_costs(consumption, _)
self.fixed_compute_metric = consumption.chargeback_fields_present if consumption.chargeback_fields_present
self.metering_used_metric = consumption.metering_used_fields_present if consumption.metering_used_fields_present
self.existence_hours_metric = consumption.consumed_hours_in_interval
- 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 group_by_tags
has a Cognitive Complexity of 29 (exceeds 11 allowed). Consider refactoring. Open
def self.group_by_tags(recs, options)
raise _("no category provided") if options[:category].blank?
raise _("option :cat_model must have a value") unless options[:cat_model]
cat_assoc = Object.const_get(options[:cat_model].to_s).table_name.to_sym
tp = options.fetch_path(:ext_options, :time_profile)
- 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 run
has a Cognitive Complexity of 29 (exceeds 11 allowed). Consider refactoring. Open
def run(options = {})
return if available_columns.empty?
puts "fixing #{table_name}.#{available_columns.join(", ")}" unless options[:silent]
processed = 0
errors = 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 get_column_details
has a Cognitive Complexity of 29 (exceeds 11 allowed). Consider refactoring. Open
def self.get_column_details(column_names, class_path, assoc_path, opts)
include_model = opts[:include_model]
base_model = class_path.split(".").first
excludes = EXCLUDE_COLUMNS
- 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 verify
has a Cognitive Complexity of 29 (exceeds 11 allowed). Consider refactoring. Open
def verify
@errors.clear
@verified_data = {}
good = bad = 0
@data.each 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_relats
has a Cognitive Complexity of 28 (exceeds 11 allowed). Consider refactoring. Open
def self.build_relats(model, parent = {}, seen = [])
_log.info("Building relationship tree for: [#{parent[:path]} => #{model}]...")
model = model_class(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 operands2humanvalue
has a Cognitive Complexity of 28 (exceeds 11 allowed). Consider refactoring. Open
def self.operands2humanvalue(ops, options = {})
# puts "Enter: operands2humanvalue: ops: #{ops.inspect}"
ret = []
if ops["tag"]
v = 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_correlate_tag_cols
has a Cognitive Complexity of 27 (exceeds 11 allowed). Consider refactoring. Open
def build_correlate_tag_cols
tags2desc = {}
arr = self.cols.inject([]) do |a, c|
self.extras[:group_by_tag_cols].each do |tc|
tag = tc[(c.length + 1)..-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 import_from_hash
has a Cognitive Complexity of 27 (exceeds 11 allowed). Consider refactoring. Open
def import_from_hash(miq_schedule, options = nil)
miq_schedule = handle_miq_report_attributes_for_import(miq_schedule) if miq_schedule["resource_type"] == "MiqReport"
input_userid = options&.dig(:userid) || miq_schedule&.dig('userid')
if input_userid && input_userid != 'system'
- 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_assigned_tos
has a Cognitive Complexity of 27 (exceeds 11 allowed). Consider refactoring. Open
def get_assigned_tos
# Returns: {:objects => [obj, obj, ...], :tags => [[Classification.entry_object, klass], ...]}
result = {:objects => [], :tags => [], :labels => []}
tags = tag_list(:ns => namespace).split
tags.each do |t|
- 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 m_callback
has a Cognitive Complexity of 26 (exceeds 11 allowed). Consider refactoring. Open
def m_callback(msg, result)
if miq_callback[:class_name] && miq_callback[:method_name]
begin
klass = miq_callback[:class_name].constantize
if miq_callback[:instance_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"
Further reading
Method validate_request
has a Cognitive Complexity of 26 (exceeds 11 allowed). Consider refactoring. Open
def self.validate_request(options)
errors = []
limits = request_limits(options)
# Check if memory value is divisible by 4 and within the allowed limits
- 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 purge_in_batches
has a Cognitive Complexity of 26 (exceeds 11 allowed). Consider refactoring. Open
def self.purge_in_batches(scope, window, total = 0, total_limit = nil)
query = scope.select(:id).limit(window)
_, timings = Benchmark.realtime_block(:total_time) do
loop do
- 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 model_details
has a Cognitive Complexity of 26 (exceeds 11 allowed). Consider refactoring. Open
def self.model_details(model, opts = {:typ => "all", :include_model => true, :include_tags => false, :include_my_tags => false, :include_id_columns => false})
@classifications = nil
model = model.to_s
opts = {:typ => "all", :include_model => true}.merge(opts)
- 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"