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) {
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
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 \
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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')
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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 \
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
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 \
- Read upRead up
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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 \
- Exclude checks
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)
- Read upRead up
- Exclude checks
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'
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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,
- Read upRead up
- Exclude checks
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') }
- Exclude checks
Bad indentation of the first parameter. Open
change(user, :hireable).to(true)
- Read upRead up
- Exclude checks
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'
- Read upRead up
- Exclude checks
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 \
- Exclude checks