Block has too many lines. [369/25] Open
describe AssignmentParticipant do
let(:response) { build(:response) }
let(:team) { build(:assignment_team, id: 1) }
let(:team2) { build(:assignment_team, id: 2) }
let(:response_map) { build(:review_response_map, reviewer_id: 2, response: [response]) }
- 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.
File assignment_particpant_spec.rb
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
describe AssignmentParticipant do
let(:response) { build(:response) }
let(:team) { build(:assignment_team, id: 1) }
let(:team2) { build(:assignment_team, id: 2) }
let(:response_map) { build(:review_response_map, reviewer_id: 2, response: [response]) }
Block has too many lines. [44/25] Open
describe '#scores' do
before(:each) do
allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: 1)
.and_return(double('AssignmentQuestionnaire', used_in_round: 1))
allow(review_questionnaire).to receive(:symbol).and_return(:review)
- 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. [41/25] Open
describe ".import" do
context 'when record is empty' do
it 'raises an ArgumentError' do
expect { AssignmentParticipant.import({}, nil, nil, nil) }.to raise_error(ArgumentError, 'No user id has been specified.')
end
- 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. [34/25] Open
context 'when no user is found by offered username' do
context 'when the record has less than 4 items' do
it 'raises an ArgumentError' do
row = {name: 'no one', fullname: 'no one', email: 'no_one@email.com'}
expect { AssignmentParticipant.import(row, nil, nil, nil) }.to raise_error('The record containing no one does not have enough items.')
- 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. [32/25] Open
describe '#compute_assignment_score' do
before(:each) do
allow(review_questionnaire).to receive(:symbol).and_return(:review)
allow(assignment).to receive(:compute_total_score).with(any_args).and_return(100)
end
- 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. [26/25] Open
context 'when the record has more than 4 items' do
let(:row) do
{name: 'no one', fullname: 'no one', email: 'name@email.com', role:'user_role_name', parent: 'user_parent_name'}
end
let(:attributes) do
- 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. [26/25] Open
describe '#stage_deadline' do
context 'when stage of current assignment is not Finished' do
it 'returns current stage' do
allow(SignedUpTeam).to receive(:topic_id).with(1, 2).and_return(5)
allow(assignment).to receive(:stage_deadline).with(5).and_return('submission')
- 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.
Interpolation in single quoted string detected. Use double quoted strings if you need interpolation. Open
it 'record the result as review#{n} scores' do
- Read upRead up
- Exclude checks
This cop checks for interpolation in a single quoted string.
Example:
# bad
foo = 'something with #{interpolation} inside'
Example:
# good
foo = "something with #{interpolation} inside"
Space missing after colon. Open
{name: 'no one', fullname: 'no one', email: 'name@email.com', role:'user_role_name', parent: 'user_parent_name'}
- Read upRead up
- Exclude checks
Checks for colon (:) not followed by some kind of space. N.B. this cop does not handle spaces after a ternary operator, which are instead handled by Layout/SpaceAroundOperators.
Example:
# bad
def f(a:, b:2); {a:3}; end
# good
def f(a:, b: 2); {a: 3}; end