Undev/redmine_role_replacements

View on GitHub
app/models/role_replacement.rb

Summary

Maintainability
A
0 mins
Test Coverage

Space inside parentheses detected.
Open

    super || ( project_id && Project.unscoped.find(project_id) )
Severity: Minor
Found in app/models/role_replacement.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Missing top-level class documentation comment.
Open

class RoleReplacement < ActiveRecord::Base
Severity: Minor
Found in app/models/role_replacement.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Use the lambda method for multiline lambdas.
Open

  scope :for_active_projects, -> {
Severity: Minor
Found in app/models/role_replacement.rb by rubocop

This cop (by default) checks for uses of the lambda literal syntax for single line lambdas, and the method call syntax for multiline lambdas. It is configurable to enforce one of the styles for both single line and multiline lambdas as well.

Example: EnforcedStyle: linecountdependent (default)

# bad
f = lambda { |x| x }
f = ->(x) do
      x
    end

# good
f = ->(x) { x }
f = lambda do |x|
      x
    end

Example: EnforcedStyle: lambda

# bad
f = ->(x) { x }
f = ->(x) do
      x
    end

# good
f = lambda { |x| x }
f = lambda do |x|
      x
    end

Example: EnforcedStyle: literal

# bad
f = lambda { |x| x }
f = lambda do |x|
      x
    end

# good
f = ->(x) { x }
f = ->(x) do
      x
    end

Line is too long. [85/80]
Open

    joins(:project).where("#{Project.table_name}.status = ?", Project::STATUS_ACTIVE)
Severity: Minor
Found in app/models/role_replacement.rb by rubocop

Space inside parentheses detected.
Open

    super || ( project_id && Project.unscoped.find(project_id) )
Severity: Minor
Found in app/models/role_replacement.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

There are no issues that match your filters.

Category
Status