ManageIQ/manageiq-gems-pending

View on GitHub

Showing 217 of 217 total issues

protected (on line 445) does not make singleton methods protected. Use protected inside a class << self block instead.
Open

def self.raw_disconnect(mnt_point)

Call super to initialize state of the parent class.
Open

def initialize(log_settings)
raise "URI missing" unless log_settings.key?(:uri)
@settings = log_settings.dup
@mnt_point = nil
end

Useless assignment to variable - query_log. Use _ or _query_log as a variable name to indicate that it won't be used.
Open

scheme_log, userinfo_log, host_log, port_log, registry_log, share_log, opaque_log, query_log, fragment_log = URI.split(URI::DEFAULT_PARSER.escape(log_uri))

Useless assignment to variable - err.
Open

rescue NoSuchFileOrDirectory => err

Useless assignment to variable - host. Use _ or _host as a variable name to indicate that it won't be used.
Open

scheme, userinfo, host, port, registry, path, opaque, query, fragment = URI.split(URI::DEFAULT_PARSER.escape(uri))

Useless assignment to variable - version.
Open

return version = stdout_text.split('\n').first.split('[')[1].split(']')[0].split(' ')[1] unless stdout_text.empty?

Useless assignment to variable - i.
Open

i = 0

private (on line 63) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
Open

def self.findRegElementInt(paths, ele)

Use any?(args.last) instead of block.
Open

continue_on_error = args.pop if [true, false, nil].any? { |type| args.last == type }
Severity: Minor
Found in lib/gems/pending/util/miq-ipmi.rb by rubocop

Variable MiqGlusterfsSession used in void context.
Open

::MiqGlusterfsSession

private (on line 139) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
Open

def self.split_raw_line(line)

Use atomic file operation method FileUtils.rm_f.
Open

FileUtils.rmdir(mnt_point) if File.exist?(mnt_point)

The use of Kernel#open is a serious security risk.
Open

open(file, "w") { |fd| fd.write(contents) }

Useless assignment to variable - scheme. Use _ or _scheme as a variable name to indicate that it won't be used.
Open

scheme, userinfo, @host, port, registry, @mount_path, opaque, query, fragment = URI.split(URI::DEFAULT_PARSER.escape(@settings[:uri]))

Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
Open

rescue Exception
log_require(path, :fail, Time.now - t, memory_consumed, features_loaded) rescue nil
raise

Use yield instead of block.call.
Open

each_element { |node| block.call(node); node.each_recursive(&block) }

Shadowing outer local variable - h.
Open

h.each_with_object({}) { |(k, v), h| h[k.to_s] = remove_invalid_chars(v.to_s.encode('UTF-8', :undef => :replace, :invalid => :replace, :replace => '')) }
Severity
Category
Status
Source
Language