decko-commons/decko

View on GitHub

Showing 661 of 695 total issues

Missing top-level module documentation comment.
Open

module CarrierWave

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"

Name your test subject if you need to reference it explicitly.
Open

        .to eq "/files/~#{subject.id}/#{subject.last_action_id}-original.gif"

Name your test subject if you need to reference it explicitly.
Open

        expect(subject.format.render_source)

Do not prefix writer method names with set_.
Open

  def set_info notify_change=nil
Severity: Minor
Found in mod/rules/set/rule/quick_editor.rb by rubocop

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)

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)]

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]

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"

Name your test subject if you need to reference it explicitly.
Open

          Card.create! name: "#{subject.name}+*self+*read",

Name your test subject if you need to reference it explicitly.
Open

      expect(subject.content)

Name your test subject if you need to reference it explicitly.
Open

      expect(subject.last_action.comment).to eq "mao2.jpg"

Name your test subject if you need to reference it explicitly.
Open

      small_path = subject.image.small.path

Name your test subject if you need to reference it explicitly.
Open

        expect(subject.attachment.db_content)

Name your test subject if you need to reference it explicitly.
Open

        expect(subject.attachment.db_content)

Do not stub your test subject.
Open

      allow(format).to receive(:view_setting).and_return %i[other modal]

Use let instead of an instance variable.
Open

      @account.send_password_reset_email

Use let instead of an instance variable.
Open

      body = @mail.parts[0].body.raw_source

Start context description with 'when', 'with', or 'without'.
Open

  context "default permissions" do

Name your test subject if you need to reference it explicitly.
Open

          expect(subject.db_content)
Severity
Category
Status
Source
Language