Block has too many lines. [331/25] Open
describe AssignmentsController do
let(:assignment) do
build(:assignment, id: 1, name: 'test assignment', instructor_id: 6, staggered_deadline: true, directory_path: 'same path',
participants: [build(:participant)], teams: [build(:assignment_team)], course_id: 1)
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. [87/25] Open
describe '#update' do
context 'when params does not have key :assignment_form' do
context 'when assignment is saved successfully' do
it 'shows a note flash message and redirects to tree_display#index page' do
allow(assignment).to receive(:save).and_return(true)
- 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 assignments_controller_spec.rb
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
describe AssignmentsController do
let(:assignment) do
build(:assignment, id: 1, name: 'test assignment', instructor_id: 6, staggered_deadline: true, directory_path: 'same path',
participants: [build(:participant)], teams: [build(:assignment_team)], course_id: 1)
end
Block has too many lines. [60/25] Open
describe '#action_allowed?' do
context 'when params action is edit or update' do
before(:each) do
controller.params = {id: '1', action: 'edit'}
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. [57/25] Open
context 'when params has key :assignment_form' do
before(:each) do
assignment_questionnaire = double('AssignmentQuestionnaire')
allow(AssignmentQuestionnaire).to receive(:new).with(any_args).and_return(assignment_questionnaire)
allow(assignment_questionnaire).to receive(:save).and_return(true)
- 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. [54/25] Open
describe '#create' do
before(:each) do
allow(AssignmentForm).to receive(:new).with(any_args).and_return(assignment_form)
@params = {
button: '',
- 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. [42/25] Open
context 'when params action is edit or update' do
before(:each) do
controller.params = {id: '1', action: 'edit'}
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. [39/25] Open
describe '#copy' do
let(:new_assignment) { build(:assignment, id: 2, name: 'new assignment', directory_path: 'different path') }
let(:new_assignment2) { build(:assignment, id: 2, name: 'new assignment', directory_path: 'same path') }
context 'when new assignment id fetches successfully' 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. [34/25] Open
before(:each) do
assignment_questionnaire = double('AssignmentQuestionnaire')
allow(AssignmentQuestionnaire).to receive(:new).with(any_args).and_return(assignment_questionnaire)
allow(assignment_questionnaire).to receive(:save).and_return(true)
@params = {
- 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 '#delete' do
context 'when assignment is deleted successfully' do
it 'shows a success flash message and redirects to tree_display#list page' do
assignment_form = AssignmentForm.new
allow(AssignmentForm).to receive(:new).and_return(assignment_form)
- 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. [31/25] Open
before(:each) do
allow(AssignmentForm).to receive(:new).with(any_args).and_return(assignment_form)
@params = {
button: '',
assignment_form: {
- 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 params does not have key :assignment_form' do
context 'when assignment is saved successfully' do
it 'shows a note flash message and redirects to tree_display#index page' do
allow(assignment).to receive(:save).and_return(true)
params = {
- 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.
Line is too long. [284/160] Open
{"id" => "", "parent_id" => "", "round" => "1", "deadline_type_id" => "2", "due_at" => "2017/12/02 00:00", "submission_allowed_id" => "1", "review_allowed_id" => "3", "teammate_review_allowed_id" => "3", "review_of_review_allowed_id" => "1", "threshold" => "1"}],
- Exclude checks
Align .and_return
with .with
on line 158. Open
.and_return([double('AssignmentQuestionnaire', questionnaire_id: 666, used_in_round: 1)])
- Read upRead up
- Exclude checks
This cop checks the indentation of the method name part in method calls that span more than one line.
Example: EnforcedStyle: aligned
# bad
while myvariable
.b
# do something
end
# good
while myvariable
.b
# do something
end
# good
Thing.a
.b
.c
Example: EnforcedStyle: indented
# good
while myvariable
.b
# do something
end
Example: EnforcedStyle: indentedrelativeto_receiver
# good
while myvariable
.a
.b
# do something
end
# good
myvariable = Thing
.a
.b
.c
Line is too long. [283/160] Open
due_date: [{"id" => "", "parent_id" => "", "round" => "1", "deadline_type_id" => "1", "due_at" => "2017/12/05 00:00", "submission_allowed_id" => "3", "review_allowed_id" => "1", "teammate_review_allowed_id" => "3", "review_of_review_allowed_id" => "1", "threshold" => "1"},
- Exclude checks