decko-commons/decko

View on GitHub

Showing 667 of 699 total issues

Use let instead of an instance variable.
Open

      expect(@signup.format.invitation?).to be(true)

Use let instead of an instance variable.
Open

        Card::Auth.as_bot { r1_members.items = [@joe_user_card.id] }

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

  context "signup (with approval)" do

Use let instead of an instance variable.
Open

      @account = @signup.account

Use let instead of an instance variable.
Open

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

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

        expect(subject.match(/Sign up/)).to be_truthy

Use let instead of an instance variable.
Open

      @card.update! "+*email" => "joe@admin.com",

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

    context "blank password" 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

        @email_card.update content: "boop"

Use let instead of an instance variable.
Open

        expect(@email_card.errors[:content].first)

Missing top-level module documentation comment.
Open

  module Variants
Severity: Minor
Found in cardname/lib/cardname/variants.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

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 "invitation" do

Use let instead of an instance variable.
Open

      expect(@account.email).to eq("wolf@decko.org")

Use let instead of an instance variable.
Open

      account = @signup.account

Use let instead of an instance variable.
Open

      @account = @signup.account

Use let instead of an instance variable.
Open

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

Use let instead of an instance variable.
Open

    @card.delete

Empty example group detected.
Open

RSpec.describe Card::Set::Abstract::Accountable do
Severity
Category
Status
Source
Language