Showing 21 of 118 total issues
Method initialize
has a Cognitive Complexity of 55 (exceeds 11 allowed). Consider refactoring. Open
def initialize(workspace, namespace, klass, instance, object_name = nil)
Benchmark.current_realtime[:object_count] += 1
@workspace = workspace
@namespace = namespace
- 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 instantiate
has a Cognitive Complexity of 35 (exceeds 11 allowed). Consider refactoring. Open
def instantiate(uri, user, root = nil)
@ae_user = user
@dom_search.ae_user = user
scheme, _userinfo, _host, _port, _registry, path, _opaque, query, fragment = MiqAeUri.split(uri, "miqaedb")
- 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 process_fields
has a Cognitive Complexity of 30 (exceeds 11 allowed). Consider refactoring. Open
def self.process_fields(fields)
priority = 0
ae_fields = []
fields.each do |field|
field["MiqAeField"].each do |f|
- 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 process_result
has a Cognitive Complexity of 27 (exceeds 11 allowed). Consider refactoring. Open
def self.process_result(ae_result, aevent)
scheme, _userinfo, _host, _port, _registry, _path, _opaque, query, _fragment = MiqAeEngine::MiqAeUri.split(ae_result)
args = MiqAeEngine::MiqAeUri.query2hash(query)
if scheme.casecmp('miqpeca').zero?
- 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 process_state
has a Cognitive Complexity of 26 (exceeds 11 allowed). Consider refactoring. Open
def process_state(field, message, args)
Benchmark.current_realtime[:state_count] += 1
Benchmark.realtime_block(:state_time) do
# Initialize the ae_state and ae_result variables, if blank
@workspace.root['ae_state'] = field['name'] if @workspace.root['ae_state'].blank?
- 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 24 (exceeds 11 allowed). Consider refactoring. Open
def self.deliver(*args)
options = options_from_args(args)
user_obj = ae_user_object(options)
state = options[:state]
vmdb_object = 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 process_collect_hash
has a Cognitive Complexity of 23 (exceeds 11 allowed). Consider refactoring. Open
def process_collect_hash(expr, rels, result)
lh = result[1].strip unless result[1].nil?
contents = result[2].strip
hash = {}
- 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_evm_event
has a Cognitive Complexity of 23 (exceeds 11 allowed). Consider refactoring. Open
def self.build_evm_event(event, passed_inputs = {})
inputs = passed_inputs.dup
# TODO: Add to Request Logs
$miq_ae_logger.info("MiqAeEvent.build_evm_event >> event=<#{event.inspect}> inputs=<#{inputs.inspect}>")
- 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_obj_from_path
has a Cognitive Complexity of 21 (exceeds 11 allowed). Consider refactoring. Open
def get_obj_from_path(path)
obj = current_object
return obj if path.nil? || path.blank?
- 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 expose
has a Cognitive Complexity of 19 (exceeds 11 allowed). Consider refactoring. Open
def self.expose(*args)
raise ArgumentError, "must pass at least one method name" if args.empty? || args.first.kind_of?(Hash)
options = args.last.kind_of?(Hash) ? args.pop : {}
raise ArgumentError, "cannot have :method option if there is more than one method name specified" if options.key?(:method) && args.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 miq_host_and_storage_least_utilized
has a Cognitive Complexity of 19 (exceeds 11 allowed). Consider refactoring. Open
def self.miq_host_and_storage_least_utilized(obj, _inputs)
prov = obj.workspace.get_obj_from_path("/")['miq_provision']
raise MiqAeException::MethodParmMissing, "Provision not specified" if prov.nil?
vm = prov.vm_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 load_xml
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def self.load_xml(filename, domain_name = nil)
_, t = Benchmark.realtime_block(:total_load_xml_time) do
classes = buttons = nil
Benchmark.realtime_block(:xml_load_time) do
require 'xml/xml_hash'
- 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 find_named_ancestor
has a Cognitive Complexity of 15 (exceeds 11 allowed). Consider refactoring. Open
def find_named_ancestor(path)
path = path[1..-1] if path[0] == '/'
plist = path.split("/")
raise MiqAeException::InvalidPathFormat, "Unsupported Path [#{path}]" if plist[0].blank?
- 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 uri2value
has a Cognitive Complexity of 15 (exceeds 11 allowed). Consider refactoring. Open
def uri2value(uri, required = false)
scheme, _userinfo, _host, _port, _registry, path, _opaque, _query, fragment = MiqAeUri.split(uri)
if scheme == 'miqaedb'
ns, klass, instance, attribute_name = MiqAePath.split(path, :has_attribute_name => 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 convert_value_based_on_datatype
has a Cognitive Complexity of 15 (exceeds 11 allowed). Consider refactoring. Open
def self.convert_value_based_on_datatype(value, datatype)
return value if value.blank? || datatype.nil?
# Basic Types
return convert_boolean_value(value) if datatype == 'boolean'
- 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_domain
has a Cognitive Complexity of 14 (exceeds 11 allowed). Consider refactoring. Open
def import_domain(domain_folder, domain_name)
domain_yaml = domain_properties(domain_folder, domain_name)
domain_name = domain_yaml.fetch_path('object', 'attributes', 'name')
domain_source = domain_yaml.fetch_path('object', 'attributes', 'source')
domain_obj = MiqAeDomain.lookup_by_fqname(domain_name, 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
Method automate_attrs_from_options
has a Cognitive Complexity of 14 (exceeds 11 allowed). Consider refactoring. Open
private_class_method def self.automate_attrs_from_options(options)
automate_attrs = options[:attrs].dup
automate_attrs['User::user'] = options[:user_id] unless options[:user_id].nil?
automate_attrs[:ae_state] = options[:state] unless options[:state].nil?
automate_attrs[:ae_fsm_started] = options[:ae_fsm_started] unless options[:ae_fsm_started].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 expose_class_attributes
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def self.expose_class_attributes(subclass)
subclass.class_eval do
model.attribute_names.each do |attr|
next if model.private_method_defined?(attr)
next if EXPOSED_ATTR_BLACK_LIST.any? { |rexp| attr =~ rexp }
- 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 preimport_check
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def preimport_check(domain_name, source_dom_source, dest_dom_source)
dest_domain_name = @options['import_as'] == '*' || @options['import_as'].nil? ? @domain_name : @options['import_as']
if source_dom_source == MiqAeDomain::SYSTEM_SOURCE
if @options['git_repository_id']
raise MiqAeException::InvalidDomain, _('Git based system domain import is not supported.')
- 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 invoke_method
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def invoke_method(namespace, klass, method_name, args)
aem = nil
# No class means an instance method
aem = @instance_methods[method_name.downcase] if klass.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"