Showing 145 of 145 total issues
Missing top-level module documentation comment. Open
module ClassMethods
- Read upRead up
- Exclude checks
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
Trailing whitespace detected. Open
# Original attribute names from source API:
- Exclude checks
Trailing whitespace detected. Open
# Original attribute names from source API:
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"documentation_uri" => "https://www.rubydoc.info/github/natydev/fitbark/master"
- 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"
Use casecmp
instead of upcase ==
. Open
select{|h| h['status'].upcase == 'OWNER'}.map do |rel|
- Read upRead up
- Exclude checks
This cop identifies places where a case-insensitive string comparison
can better be implemented using casecmp
.
Example:
# bad
str.downcase == 'abc'
str.upcase.eql? 'ABC'
'abc' == str.downcase
'ABC'.eql? str.upcase
str.downcase == str.downcase
# good
str.casecmp('ABC').zero?
'abc'.casecmp(str).zero?
Space between { and | missing. Open
select{|h| h['status'].upcase == 'FRIEND'}.map do |rel|
- Read upRead up
- Exclude checks
Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.
Example: EnforcedStyle: space (default)
# The `space` style enforces that block braces have
# surrounding space.
# bad
some_array.each {puts e}
# good
some_array.each { puts e }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that block braces don't
# have surrounding space.
# bad
some_array.each { puts e }
# good
some_array.each {puts e}
Example: EnforcedStyleForEmptyBraces: no_space (default)
# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# block braces don't have a space in between when empty.
# bad
some_array.each { }
some_array.each { }
some_array.each { }
# good
some_array.each {}
Example: EnforcedStyleForEmptyBraces: space
# The `space` EnforcedStyleForEmptyBraces style enforces that
# block braces have at least a spece in between when empty.
# bad
some_array.each {}
# good
some_array.each { }
some_array.each { }
some_array.each { }
Example: SpaceBeforeBlockParameters: true (default)
# The SpaceBeforeBlockParameters style set to `true` enforces that
# there is a space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.
# bad
[1, 2, 3].each {|n| n * 2 }
# good
[1, 2, 3].each { |n| n * 2 }
Example: SpaceBeforeBlockParameters: true
# The SpaceBeforeBlockParameters style set to `false` enforces that
# there is no space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.
# bad
[1, 2, 3].each { |n| n * 2 }
# good
[1, 2, 3].each {|n| n * 2 }
Trailing whitespace detected. Open
# Original attribute names from source API:
- Exclude checks
Trailing whitespace detected. Open
# - *dog_slug*
- Exclude checks
Line is too long. [83/80] Open
"documentation_uri" => "https://www.rubydoc.info/github/natydev/fitbark/master"
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
"to": to,
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
"daily_goal": goal_points.to_s,
- Exclude checks
Use 2 (not 0) spaces for indenting an expression spanning multiple lines. Open
select{|h| h['status'].upcase == 'OWNER'}.map do |rel|
- Read upRead up
- Exclude checks
This cop checks the indentation of the method name part in method calls that span more than one line.
Example: EnforcedStyle: aligned
# bad
while myvariable
.b
# do something
end
# good
while myvariable
.b
# do something
end
# good
Thing.a
.b
.c
Example: EnforcedStyle: indented
# good
while myvariable
.b
# do something
end
Example: EnforcedStyle: indentedrelativeto_receiver
# good
while myvariable
.a
.b
# do something
end
# good
myvariable = Thing
.a
.b
.c
Trailing whitespace detected. Open
# inside Client object, it retrieve all dogs having friendship
- Exclude checks
Trailing whitespace detected. Open
# - *dog*
- Exclude checks
Missing top-level module documentation comment. Open
module Fitbark
- Read upRead up
- Exclude checks
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
Line is too long. [81/80] Open
# Fitbark::Handler::V2::SimilarDogsStats define method *similar_dogs_stats*
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
"resolution": format_resolution(res)
- Exclude checks
unexpected token $end
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
- Exclude checks
Place the . on the next line, together with the method name. Open
json_response['dog_relations'].
- Read upRead up
- Exclude checks
This cop checks the . position in multi-line method calls.
Example: EnforcedStyle: leading (default)
# bad
something.
mehod
# good
something
.method
Example: EnforcedStyle: trailing
# bad
something
.method
# good
something.
mehod
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
"dog": {
- Exclude checks