Showing 661 of 695 total issues
Name your test subject if you need to reference it explicitly. Open
expect(subject.original_filename).to eq "file1.txt"
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
eq "/files/~#{subject.id}/#{subject.last_action_id}.txt"
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect(subject.image.url).to eq "/files/:cerulean_skin_image/bootstrap-original.png"
- Create a ticketCreate a ticket
- Exclude checks
Variable Card
used in void context. Open
Card
- 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
Use let
instead of an instance variable. Open
@account.email_card.update! content: "joe2@user.com"
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
expect(Card::Auth.current_id).to eq(@account.left_id)
- Create a ticketCreate a ticket
- Exclude checks
Empty example group detected. Open
describe Card::Set::Right::Delete do
- Create a ticketCreate a ticket
- Exclude checks
include
is used at the top level. Use inside class
or module
. Open
include SelectedAction
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that include
, extend
and prepend
exists at
the top level.
Using these at the top level affects the behavior of Object
.
There will not be using include
, extend
and prepend
at
the top level. Let's use it inside class
or module
.
Example:
# bad
include M
class C
end
# bad
extend M
class C
end
# bad
prepend M
class C
end
# good
class C
include M
end
# good
class C
extend M
end
# good
class C
prepend M
end
Start context description with 'when', 'with', or 'without'. Open
context "protected" do
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
.to eq "~#{subject.id}/#{subject.last_action_id}.txt"
- Create a ticketCreate a ticket
- Exclude checks
Start context description with 'when', 'with', or 'without'. Open
context "newly created image card" do
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect(subject.format.render!(:source))
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
current_url = subject.image.versions[:medium].url
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
subject.update! image: File.new(CarrierWave::TestFile.path("rails.gif"))
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect { subject }.to raise_error(Card::Error)
- Create a ticketCreate a ticket
- Exclude checks
Missing top-level class documentation comment. Open
class CodeLayout < Layout
- 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 RuleSetRadio
- 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
RSpec.describe Card::Set::Type::Set::HtmlViews do
- Create a ticketCreate a ticket
- Exclude checks
Missing top-level class documentation comment. Open
class SanitizedFile
- 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
Prefer annotated tokens (like %<foo>s</foo>
) over unannotated tokens (like %s
). Open
"%s/%s" % [file_dir, url_filename]
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Use a consistent style for named format string tokens.
Note:
unannotated
style cop only works for strings
which are passed as arguments to those methods:
sprintf
, format
, %
.
The reason is that unannotated format is very similar
to encoded URLs or Date/Time formatting strings.
Example: EnforcedStyle: annotated (default)
# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')
# good
format('%<greeting>s', greeting: 'Hello')</greeting>
Example: EnforcedStyle: template
# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')
# good
format('%{greeting}', greeting: 'Hello')</greeting>
Example: EnforcedStyle: unannotated
# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')
# good
format('%s', 'Hello')</greeting>