Showing 661 of 695 total issues
Variable @key
used in void context. Open
@key
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for operators, variables and literals used in void context.
Example:
# bad
def some_method
some_num * 10
do_something
end
Example:
# bad
def some_method(some_var)
some_var
do_something
end
Example:
# good
def some_method
do_something
some_num * 10
end
Example:
# good
def some_method(some_var)
do_something
some_var
end
Missing top-level module documentation comment. Open
module Location
- Read upRead up
- Create a ticketCreate a ticket
- 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
Missing top-level class documentation comment. Open
class TextFormat < Format
- Read upRead up
- Create a ticketCreate a ticket
- 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
Empty example group detected. Open
describe Card::Set::All::Text do
- Create a ticketCreate a ticket
- Exclude checks
Prefer Date or Time over DateTime. Open
DateTime.new(acted_at).distance_of_time_in_words_to_now
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for uses of DateTime
that should be replaced by
Date
or Time
.
Example:
# bad - uses `DateTime` for current time
DateTime.now
# good - uses `Time` for current time
Time.now
# bad - uses `DateTime` for modern date
DateTime.iso8601('2016-06-29')
# good - uses `Date` for modern date
Date.iso8601('2016-06-29')
# good - uses `DateTime` with start argument for historical date
DateTime.iso8601('1751-04-23', Date::ENGLAND)
Name your test subject if you need to reference it explicitly. Open
assert_view_select subject, 'del[class="diffdel diff-deleted"]',
- Create a ticketCreate a ticket
- Exclude checks
Replace class var @@options with a class instance var. Open
@@options = { compound_only: true }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.
Missing top-level module documentation comment. Open
module CardClass
- Read upRead up
- Create a ticketCreate a ticket
- 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
Missing top-level class documentation comment. Open
class Cache
- Read upRead up
- Create a ticketCreate a ticket
- 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
Missing top-level class documentation comment. Open
class Mailer < ActionMailer::Base
- Read upRead up
- Create a ticketCreate a ticket
- 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
Empty example group detected. Open
describe Card::Set::All::File do
- Create a ticketCreate a ticket
- Exclude checks
Empty example group detected. Open
describe Card::Format::JsFormat do
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
@html.img src: "item1"
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
r = @a.format.render_core
- Create a ticketCreate a ticket
- Exclude checks
Do not use prefix _
for a variable that is used. Open
text.scan(/[^\w._-]tr[( ]\s*["':](\w+)/).map do |_match|
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Missing top-level class documentation comment. Open
class Path
- Read upRead up
- Create a ticketCreate a ticket
- 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
Empty example group detected. Open
describe Card::Format::CssFormat do
- Create a ticketCreate a ticket
- Exclude checks
Literal false
appeared as a condition. Open
if false # Card::Change.supports_import?
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for literals used as the conditions or as operands in and/or expressions serving as the conditions of if/while/until.
Example:
# bad
if 20
do_something
end
Example:
# bad
if some_var && true
do_something
end
Example:
# good
if some_var && some_condition
do_something
end
Missing top-level class documentation comment. Open
class ActRenderer
- Read upRead up
- Create a ticketCreate a ticket
- 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
Rename is_template?
to template?
. Open
def is_template?
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end