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)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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))
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Useless assignment to variable - err
. Open
rescue NoSuchFileOrDirectory => err
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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))
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Useless assignment to variable - version
. Open
return version = stdout_text.split('\n').first.split('[')[1].split(']')[0].split(' ')[1] unless stdout_text.empty?
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Useless assignment to variable - i
. Open
i = 0
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Use any?(args.last)
instead of block. Open
continue_on_error = args.pop if [true, false, nil].any? { |type| args.last == type }
- Create a ticketCreate a ticket
- Exclude checks
Variable MiqGlusterfsSession
used in void context. Open
::MiqGlusterfsSession
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Use atomic file operation method FileUtils.rm_f
. Open
FileUtils.rmdir(mnt_point) if File.exist?(mnt_point)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
The use of Kernel#open
is a serious security risk. Open
open(file, "w") { |fd| fd.write(contents) }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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]))
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Use yield
instead of block.call
. Open
each_element { |node| block.call(node); node.each_recursive(&block) }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 => '')) }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks