Showing 303 of 303 total issues
Space inside } missing. Open
validates :name, length: {maximum: MAXIMUM_NAME_COLONY_LENGTH}
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
# good
h = { a: { b: 2 }}
Tab detected. Open
validates :end_date, presence: true
- Exclude checks
Inconsistent indentation detected. Open
has_and_belongs_to_many :colonies
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
validates :bio, length: { maximum: MAXIMUM_BIO_LENGTH }
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Extra empty line detected at class body end. Open
end
- Read upRead up
- Exclude checks
This cops checks if empty lines around the bodies of classes match the configuration.
Example: EnforcedStyle: empty_lines
# good
class Foo
def bar
# ...
end
end
Example: EnforcedStyle: emptylinesexcept_namespace
# good
class Foo
class Bar
# ...
end
end
Example: EnforcedStyle: emptylinesspecial
# good
class Foo
def bar; end
end
Example: EnforcedStyle: noemptylines (default)
# good
class Foo
def bar
# ...
end
end
Inconsistent indentation detected. Open
validates :name, length: {maximum: 20}
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Tab detected. Open
MAXIMUM_DESCRIPTION_LENGTH = 512
- Exclude checks
Space inside parentheses detected. Open
redirect_to( illnesses_path )
- Read upRead up
- Exclude checks
Checks for spaces inside ordinary round parentheses.
Example:
# bad
f( 3)
g = (a + 3 )
# good
f(3)
g = (a + 3)
Space inside parentheses detected. Open
@illness = Illness.find( params[ :id ])
- Read upRead up
- Exclude checks
Checks for spaces inside ordinary round parentheses.
Example:
# bad
f( 3)
g = (a + 3 )
# good
f(3)
g = (a + 3)
(...)
interpreted as grouped expression. Open
redirect_to (illness_path( params[ :id ] ))
- Read upRead up
- Exclude checks
Checks for space between the name of a called method and a left parenthesis.
Example:
# bad
puts (x + y)
Example:
# good
puts(x + y)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
!@user.nil? && (@user.role == "volunteer" || @user.role == "admin")
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Prefer !expression.nil?
over expression != nil
. Open
if birthday_date != nil
- Read upRead up
- Exclude checks
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
Space inside { missing. Open
validates :name, length: {maximum: MAXIMUM_NAME_LENGTH}
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
# good
h = { a: { b: 2 }}
Line is too long. [115/80] Open
validates :stock, :price, numericality: {only_integer: true, greater_than_or_equal_to: MINIMUM_STOCK_PRICE_VALUE}
- Exclude checks
Space inside } missing. Open
validates :bio, length: {maximum: MAXIMUM_BIO_LENGTH}
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
# good
h = { a: { b: 2 }}
Inconsistent indentation detected. Open
has_many :cats, through: :adoptions
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Tab detected. Open
has_many :cats, through: :sponsors
- Exclude checks
Tab detected. Open
validates :username, :email, :role, :purrs, presence: true
- Exclude checks
Do not use space inside reference brackets. Open
@location = Location.find( params[ :id ])
- Read upRead up
- Exclude checks
Checks that reference brackets have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: no_space (default)
# The `no_space` style enforces that reference brackets have
# no surrounding space.
# bad
hash[ :key ]
array[ index ]
# good
hash[:key]
array[index]
Example: EnforcedStyle: space
# The `space` style enforces that reference brackets have
# surrounding space.
# bad
hash[:key]
array[index]
# good
hash[ :key ]
array[ index ]
Final newline missing. Open
end
- Exclude checks