gitshowcase/gitshowcase

View on GitHub
spec/services/github_user_service_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage

Block has too many lines. [96/25]
Open

RSpec.describe GithubUserService, type: :service do
  subject(:service) { GithubUserService.new(user) }

  let(:user) { FactoryGirl.create(:user) }
  let(:auth_data) {

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [65/25]
Open

  describe '#sync' do
    context 'without github' do
      after :each do
        exception = "User ##{user.id} does not have github properties"
        expect { service.sync }.to raise_exception(exception)

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [49/25]
Open

    context 'with github' do
      let(:user) { FactoryGirl.create(:user, github_uid: 'uid', github_token: 'token') }

      it 'changes attributes' do
        github_user = double(

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Indent the first parameter one step more than the start of the previous line.
Open

        change(user, :github_uid).to('uid').and \
        change(user, :github_token).to('token').and \
        change(user, :role).to('Jedi Developer')

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

          change(user, :website).to('johndoe.com').and \
          change(user, :location).to('Brazil').and \
          change(user, :display_email).to('contact@johndoe.com').and \
          change(user, :bio).to('Lorem ipsum').and \
          change(user, :company).to('@company').and \

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

          change(user, :display_email).to('contact@johndoe.com').and \
          change(user, :bio).to('Lorem ipsum').and \
          change(user, :company).to('@company').and \
          change(user, :company_website).to('https://github.com/company').and \
          change(user, :hireable).to(true)

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Line is too long. [88/80]
Open

      expect { service.reauth(auth_data) }.to change(user, :github_token).to eq('token')

Bad indentation of the first parameter.
Open

          change(user, :bio).to('Lorem ipsum').and \
          change(user, :company).to('@company').and \
          change(user, :company_website).to('https://github.com/company').and \
          change(user, :hireable).to(true)

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

          change(user, :company_website).to('https://github.com/company').and \
          change(user, :hireable).to(true)

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Indent the first parameter one step more than the start of the previous line.
Open

          change(user, :avatar).to('https://avatars.githubusercontent.com/u/0?s=400').and \
          change(user, :website).to('johndoe.com').and \
          change(user, :location).to('Brazil').and \
          change(user, :display_email).to('contact@johndoe.com').and \
          change(user, :bio).to('Lorem ipsum').and \

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

        change(user, :github_token).to('token').and \
        change(user, :role).to('Jedi Developer')

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

          change(user, :location).to('Brazil').and \
          change(user, :display_email).to('contact@johndoe.com').and \
          change(user, :bio).to('Lorem ipsum').and \
          change(user, :company).to('@company').and \
          change(user, :company_website).to('https://github.com/company').and \

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Avoid using {...} for multi-line blocks.
Open

  let(:auth_data) {

Check for uses of braces or do/end around single line or multi-line blocks.

Example: EnforcedStyle: linecountbased (default)

# bad - single line block
items.each do |item| item / 5 end

# good - single line block
items.each { |item| item / 5 }

# bad - multi-line block
things.map { |thing|
  something = thing.some_method
  process(something)
}

# good - multi-line block
things.map do |thing|
  something = thing.some_method
  process(something)
end

Example: EnforcedStyle: semantic

# Prefer `do...end` over `{...}` for procedural blocks.

# return value is used/assigned
# bad
foo = map do |x|
  x
end
puts (map do |x|
  x
end)

# return value is not used out of scope
# good
map do |x|
  x
end

# Prefer `{...}` over `do...end` for functional blocks.

# return value is not used out of scope
# bad
each { |x|
  x
}

# return value is used/assigned
# good
foo = map { |x|
  x
}
map { |x|
  x
}.inspect

Example: EnforcedStyle: bracesforchaining

# bad
words.each do |word|
  word.flip.flop
end.join("-")

# good
words.each { |word|
  word.flip.flop
}.join("-")

Line is too long. [91/80]
Open

          change(user, :avatar).to('https://avatars.githubusercontent.com/u/0?s=400').and \

Bad indentation of the first parameter.
Open

          change(user, :company).to('@company').and \
          change(user, :company_website).to('https://github.com/company').and \
          change(user, :hireable).to(true)

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

            token: 'token'

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

        change(user, :role).to('Jedi Developer')

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Indent the first parameter one step more than the start of the previous line.
Open

            name: 'John Doe',
            login: 'johndoe',
            avatar_url: 'https://avatars.githubusercontent.com/u/0',
            blog: 'johndoe.com',
            location: 'Brazil',

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Indent the first parameter one step more than the start of the previous line.
Open

        info: double(
            email: 'email'
        ),
        uid: 'uid',
        credentials: double(

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Indent the first parameter one step more than the start of the previous line.
Open

            login: 'johndoe',
            avatar_url: nil,
            name: nil,
            blog: nil,
            location: nil,

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Line is too long. [88/80]
Open

      let(:user) { FactoryGirl.create(:user, github_uid: 'uid', github_token: 'token') }

Bad indentation of the first parameter.
Open

          change(user, :hireable).to(true)

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Bad indentation of the first parameter.
Open

            email: 'email'

This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

Example:

# bad
some_method(
first_param,
second_param)

# good
some_method(
  first_param,
second_param)

Line is too long. [82/80]
Open

      expect { service.auth(auth_data) }.to change(user, :email).to('email').and \

There are no issues that match your filters.

Category
Status