Showing 661 of 695 total issues
Missing top-level module documentation comment. Open
module CarrierWave
- 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
Name your test subject if you need to reference it explicitly. Open
expect(subject.original_filename).to eq "mao2.jpg"
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
.to eq "/files/~#{subject.id}/#{subject.last_action_id}-original.gif"
- 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
Do not prefix writer method names with set_
. Open
def set_info notify_change=nil
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop makes sure that accessor methods are named properly.
Example:
# bad
def set_attribute(value)
end
# good
def attribute=(value)
end
# bad
def get_attribute
end
# good
def attribute
end
Use let
instead of an instance variable. Open
expect(@mail.parts[0].body.raw_source).to include(url)
- Create a ticketCreate a ticket
- Exclude checks
Prefer annotated tokens (like %<foo>s</foo>
) over unannotated tokens (like %s
). Open
"%s/%s/%s" % [local_url_base(opts), file_dir, full_filename(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>
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>
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
Card.create! name: "#{subject.name}+*self+*read",
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect(subject.content)
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect(subject.last_action.comment).to eq "mao2.jpg"
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
small_path = subject.image.small.path
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect(subject.attachment.db_content)
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect(subject.attachment.db_content)
- Create a ticketCreate a ticket
- Exclude checks
Do not stub your test subject. Open
allow(format).to receive(:view_setting).and_return %i[other modal]
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
@account.send_password_reset_email
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
body = @mail.parts[0].body.raw_source
- Create a ticketCreate a ticket
- Exclude checks
Start context description with 'when', 'with', or 'without'. Open
context "default permissions" do
- Create a ticketCreate a ticket
- Exclude checks
Name your test subject if you need to reference it explicitly. Open
expect(subject.db_content)
- Create a ticketCreate a ticket
- Exclude checks