decko-commons/decko

View on GitHub

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"

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

      expect(subject.image.url).to eq "/files/:cerulean_skin_image/bootstrap-original.png"

Variable Card used in void context.
Open

      Card

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"

Use let instead of an instance variable.
Open

      expect(Card::Auth.current_id).to eq(@account.left_id)

Empty example group detected.
Open

describe Card::Set::Right::Delete do

include is used at the top level. Use inside class or module.
Open

include SelectedAction
Severity: Minor
Found in mod/carrierwave/set/type/file.rb by rubocop

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

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

            .to eq "~#{subject.id}/#{subject.last_action_id}.txt"

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

  context "newly created image card" do

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

        expect(subject.format.render!(:source))

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

        current_url = subject.image.versions[:medium].url

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

        subject.update! image: File.new(CarrierWave::TestFile.path("rails.gif"))

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

    expect { subject }.to raise_error(Card::Error)

Missing top-level class documentation comment.
Open

    class CodeLayout < Layout

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

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

Missing top-level class documentation comment.
Open

  class SanitizedFile

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]

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>
Severity
Category
Status
Source
Language