ManageIQ/manageiq

View on GitHub
app/models/miq_task.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
92%

Avoid using Marshal.load.
Open

    return Marshal.load(Base64.decode64(results.split("\n").join)) unless results.nil?
Severity: Minor
Found in app/models/miq_task.rb by rubocop

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({}))

Useless method definition detected.
Open

  def message=(message)
    super(message)
  end
Severity: Minor
Found in app/models/miq_task.rb by rubocop

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

There are no issues that match your filters.

Category
Status