ManageIQ/manageiq-gems-pending

View on GitHub

Showing 88 of 217 total issues

Method initialize_upload_vars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def initialize_upload_vars(*upload_args)
upload_args.pop if (@byte_count = parse_byte_value(upload_args.last))
@remote_file_path = upload_args.pop
 
unless upload_args.empty?
Severity: Minor
Found in lib/gems/pending/util/miq_file_storage.rb - About 25 mins to fix

Method process_obj has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def process_obj(node)
lst = node.elements.find { |e| e.name == 'LST' }
dct = node.elements.find { |e| e.name == 'DCT' }
 
refId = node.attributes['RefId'].to_i
Severity: Minor
Found in lib/gems/pending/util/win32/miq-powershell.rb - About 25 mins to fix

Method require has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def require(path) # :doc:
with_require_logging(path) { gem_original_require(path) }
rescue LoadError => load_error
if load_error.message.end_with?(path) && Gem.try_activate(path)
return with_require_logging(path, :reenter) { gem_original_require(path) }
Severity: Minor
Found in lib/gems/pending/util/require_with_logging.rb - About 25 mins to fix

Method findElementInt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def self.findElementInt(paths, ele)
if paths.length > 0
searchStr = paths[0]
paths = paths[1..paths.length]
# puts "Search String: #{searchStr}"
Severity: Minor
Found in lib/gems/pending/util/xml/miq_rexml.rb - About 25 mins to fix

Method connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def connect
log_header = "MIQ(#{self.class.name}-connect)"
 
# Replace any encoded spaces back into spaces since the mount commands accepts quoted spaces
@mount_path = @mount_path.to_s.gsub('%20', ' ')
Severity: Minor
Found in lib/gems/pending/util/mount/miq_generic_mount_session.rb - About 25 mins to fix

Method getChildAttrib has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def self.getChildAttrib(ele, attrib, default)
type = nil
ele.each_element do |e|
type = e.text if e.attributes['name'] == attrib
break if type
Severity: Minor
Found in lib/gems/pending/util/xml/miq_rexml.rb - About 25 mins to fix

Method method_missing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def method_missing(m, *args)
m2 = m.to_s
if m2[-1, 1] == "="
m2.chop!
m2 = m2.to_sym if @key_type == Symbol
Severity: Minor
Found in lib/gems/pending/util/miq-hash_struct.rb - About 25 mins to fix

Method node_text has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def node_text
children.each do |node|
if node.node_type == TEXT_NODE
if node.content && node.content.rstrip.length > 0
return node.content
Severity: Minor
Found in lib/gems/pending/util/xml/miq_nokogiri.rb - About 25 mins to fix
Severity
Category
Status
Source
Language