spec/models/assignment_team_spec.rb
Block has too many lines. [341/25] Open
Open
describe 'AssignmentTeam' do
let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: '') }
let(:team) { build(:assignment_team, id: 1, parent_id: 1) }
let(:assignment) { build(:assignment, id: 1) }
let(:participant1) { build(:participant, id: 1) }
- 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_team_spec.rb
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
describe 'AssignmentTeam' do
let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: '') }
let(:team) { build(:assignment_team, id: 1, parent_id: 1) }
let(:assignment) { build(:assignment, id: 1) }
let(:participant1) { build(:participant, id: 1) }
Useless assignment to variable - new_team
. Open
Open
new_team = AssignmentTeam.create_team_with_users(@assignment.id, [@student.id])
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end