app/models/miq_task.rb
Useless method definition detected. Open
Open
def message=(message)
super(message)
end
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for useless method definitions, specifically: empty constructors
and methods just delegating to super
.
Safety:
This cop is unsafe as it can register false positives for cases when an empty constructor just overrides the parent constructor, which is bad anyway.
Example:
# bad
def initialize
super
end
def method
super
end
# good - with default arguments
def initialize(x = Object.new)
super
end
# good
def initialize
super
initialize_internals
end
def method(*args)
super(:extra_arg, *args)
end
Avoid using Marshal.load
. Open
Open
return Marshal.load(Base64.decode64(results.split("\n").join)) unless results.nil?
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for the use of Marshal class methods which have potential security issues leading to remote code execution when loading from an untrusted source.
Example:
# bad
Marshal.load("{}")
Marshal.restore("{}")
# good
Marshal.dump("{}")
# okish - deep copy hack
Marshal.load(Marshal.dump({}))