decko-commons/decko

View on GitHub

Showing 661 of 695 total issues

Use let instead of an instance variable.
Open

      expect(@mail).to be_truthy

Use let instead of an instance variable.
Open

          @email_card.update! content: "QuIrE@example.com"

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

  context "invitation" do

Use let instead of an instance variable.
Open

      expect(@read_rules).to be_member(Card.fetch("*all+*read").id)

Use let instead of an instance variable.
Open

        expect(ids.length).to eq(@read_rules.size + 11)

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

  context "+*account+*email" do

Use let instead of an instance variable.
Open

        expect(@format.render_raw).to eq("u1@user.com")

Use let instead of an instance variable.
Open

        expect(@email_card.errors[:content].first).to match(/must be unique/)

Use match? instead of =~ when MatchData is not used.
Open

        next if part =~ /^_/ # this removes relative parts.  why?
Severity: Minor
Found in cardname/lib/cardname/contextual.rb by rubocop

In Ruby 2.4, String#match?, Regexp#match? and Symbol#match? have been added. The methods are faster than match. Because the methods avoid creating a MatchData object or saving backref. So, when MatchData is not used, use match? instead of match.

Example:

# bad
def foo
  if x =~ /re/
    do_something
  end
end

# bad
def foo
  if x.match(/re/)
    do_something
  end
end

# bad
def foo
  if /re/ === x
    do_something
  end
end

# good
def foo
  if x.match?(/re/)
    do_something
  end
end

# good
def foo
  if x =~ /re/
    do_something(Regexp.last_match)
  end
end

# good
def foo
  if x.match(/re/)
    do_something($~)
  end
end

# good
def foo
  if /re/ === x
    do_something($~)
  end
end

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

    context "do not stabilize" do
Severity: Minor
Found in cardname/spec/lib/cardname_spec.rb by rubocop

Use let instead of an instance variable.
Open

        expect(body).to include(@signup.name)

Use let instead of an instance variable.
Open

      @account = @signup.account

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

  context "<User>+*email" do

Use let instead of an instance variable.
Open

      expect(@mail.parts[0].body.raw_source).to include(msg)

Use let instead of an instance variable.
Open

      expect(@signup.type_id).to eq(Card::SignupID)

Use let instead of an instance variable.
Open

      expect(@signup.type_id).to eq(Card::SignupID)

Use let instead of an instance variable.
Open

      expect(@account.salt).not_to eq("")

Use let instead of an instance variable.
Open

    open_view = @card.format.render_open

Use let instead of an instance variable.
Open

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

Missing top-level class documentation comment.
Open

class Object
Severity: Minor
Found in cardname/lib/core_ext.rb by rubocop

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