njazari/sef-founderwall

View on GitHub
config/initializers/rails_admin.rb

Summary

Maintainability
A
0 mins
Test Coverage

Trailing whitespace detected.
Open

  
Severity: Minor
Found in config/initializers/rails_admin.rb by rubocop

Prefer !expression.nil? over expression != nil.
Open

    redirect_to main_app.new_user_session_path unless current_user != nil and current_user.admin == true
Severity: Minor
Found in config/initializers/rails_admin.rb by rubocop

This cop checks for non-nil checks, which are usually redundant.

Example:

# bad
if x != nil
end

# good (when not allowing semantic changes)
# bad (when allowing semantic changes)
if !x.nil?
end

# good (when allowing semantic changes)
if x
end

Non-nil checks are allowed if they are the final nodes of predicate.

# good
def signed_in?
  !current_user.nil?
end

Use && instead of and.
Open

    redirect_to main_app.new_user_session_path unless current_user != nil and current_user.admin == true
Severity: Minor
Found in config/initializers/rails_admin.rb by rubocop

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Line is too long. [87/80]
Open

  # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
Severity: Minor
Found in config/initializers/rails_admin.rb by rubocop

Line is too long. [104/80]
Open

    redirect_to main_app.new_user_session_path unless current_user != nil and current_user.admin == true
Severity: Minor
Found in config/initializers/rails_admin.rb by rubocop

There are no issues that match your filters.

Category
Status