ManageIQ/manageiq

View on GitHub
lib/vmdb/gettext/domains.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
95%

Avoid using or-assignment with constants.
Open

      TEXT_DOMAIN ||= 'manageiq'.freeze
Severity: Minor
Found in lib/vmdb/gettext/domains.rb by rubocop

Checks for unintended or-assignment to a constant.

Constants should always be assigned in the same location. And its value should always be the same. If constants are assigned in multiple locations, the result may vary depending on the order of require.

Safety:

This cop is unsafe because code that is already conditionally assigning a constant may have its behavior changed by autocorrection.

Example:

# bad
CONST ||= 1

# good
CONST = 1

Literal :mo used in void context.
Open

        else :mo
Severity: Minor
Found in lib/vmdb/gettext/domains.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