ManageIQ/manageiq

View on GitHub
app/models/binary_blob.rb

Summary

Maintainability
A
0 mins
Test Coverage
D
66%

Do not return a value in binary=.
Open

    return self if data.bytesize == 0
Severity: Minor
Found in app/models/binary_blob.rb by rubocop

Checks for the use of a return with a value in a context where the value will be ignored. (initialize and setter methods)

Example:

# bad
def initialize
  foo
  return :qux if bar?
  baz
end

def foo=(bar)
  return 42
end

Example:

# good
def initialize
  foo
  return if bar?
  baz
end

def foo=(bar)
  return
end

self used in void context.
Open

    self
Severity: Minor
Found in app/models/binary_blob.rb by rubocop

Checks for operators, variables, literals, lambda, proc and nonmutating methods used in void context.

Example: CheckForMethodsWithNoSideEffects: false (default)

# bad
def some_method
  some_num * 10
  do_something
end

def some_method(some_var)
  some_var
  do_something
end

Example: CheckForMethodsWithNoSideEffects: true

# bad
def some_method(some_array)
  some_array.sort
  do_something(some_array)
end

# good
def some_method
  do_something
  some_num * 10
end

def some_method(some_var)
  do_something
  some_var
end

def some_method(some_array)
  some_array.sort!
  do_something(some_array)
end

There are no issues that match your filters.

Category
Status