rkokkelk/siso

View on GitHub

Showing 22 of 22 total issues

The name of this source file (rack-attack.rb) should use snake_case.
Open

# be sure to restart your server when you modify this file.
Severity: Minor
Found in config/initializers/rack-attack.rb by rubocop

This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.

Example:

# bad
lib/layoutManager.rb

anything/usingCamelCase

# good
lib/layout_manager.rb

anything/using_snake_case.rake

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

    if !Rails.env.test? && !file.tempfile.is_a?(StringIO)

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok
Severity
Category
Status
Source
Language