expertiza/expertiza

View on GitHub

Showing 531 of 4,497 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        it 'returns attributes (args), but changes @has_errors value to true since update_attributes method works incorrectly for assignment_questionnaire1' do
          allow(assignment_questionnaire1).to receive(:id).and_return(1)
          allow(assignment_questionnaire1).to receive(:update_attributes).with(aq_attributes1).and_return(false)
          allow(assignment_questionnaire2).to receive(:id).and_return(nil)
          allow(assignment_questionnaire2).to receive(:save).and_return(true)
Severity: Major
Found in spec/models/assignment_form_spec.rb and 1 other location - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 182..189

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '#availability_flag' do
    context 'when current assignment.availability_flag is nil' do
      it 'sets availability_flag attribute of current assignment to false' do
        assignment.availability_flag = nil
        expect(assignment_form.availability_flag).to be false
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 709..722
spec/models/assignment_form_spec.rb on lines 745..758
spec/models/assignment_form_spec.rb on lines 763..776

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '#reviews_visible_to_all' do
    context 'when current assignment.reviews_visible_to_all is nil' do
      it 'sets reviews_visible_to_all attribute of current assignment to false' do
        assignment.reviews_visible_to_all = nil
        expect(assignment_form.reviews_visible_to_all).to be false
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 709..722
spec/models/assignment_form_spec.rb on lines 727..740
spec/models/assignment_form_spec.rb on lines 745..758

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        it 'returns attributes (args), but changes @has_errors value to true since update_attributes method works incorrectly for assignment_questionnaire2' do
          allow(assignment_questionnaire1).to receive(:id).and_return(1)
          allow(assignment_questionnaire1).to receive(:update_attributes).with(aq_attributes1).and_return(true)
          allow(assignment_questionnaire2).to receive(:id).and_return(nil)
          allow(assignment_questionnaire2).to receive(:save).and_return(true)
Severity: Major
Found in spec/models/assignment_form_spec.rb and 1 other location - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 407..414

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '#staggered_deadline' do
    context 'when current assignment.staggered_deadlines is nil' do
      it 'sets staggered_deadline attribute of current assignment to false' do
        assignment.staggered_deadline = nil
        expect(assignment_form.staggered_deadline).to be false
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 727..740
spec/models/assignment_form_spec.rb on lines 745..758
spec/models/assignment_form_spec.rb on lines 763..776

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        it 'returns attributes (args), but changes @has_errors value to true since update_attributes method works incorrectly for assignment_questionnaire2' do
          allow(assignment_questionnaire1).to receive(:id).and_return(1)
          allow(assignment_questionnaire1).to receive(:update_attributes).with(aq_attributes1).and_return(true)
          allow(assignment_questionnaire2).to receive(:id).and_return(nil)
          allow(assignment_questionnaire2).to receive(:save).and_return(true)
Severity: Major
Found in spec/models/assignment_form_spec.rb and 1 other location - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 172..179

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '#micro_task' do
    context 'when current assignment.microtask is nil' do
      it 'sets microtask attribute of current assignment to false' do
        assignment.microtask = nil
        expect(assignment_form.micro_task).to be false
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 709..722
spec/models/assignment_form_spec.rb on lines 727..740
spec/models/assignment_form_spec.rb on lines 763..776

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  describe 'superadmin#edit' do
    it 'superadmin#edit it' do
      allow(AssignmentParticipant).to receive(:find).and_return(participant)
      allow(Participant).to receive(:find_by).and_return(participant)
      allow(User).to receive(:find).and_return(participant)
Severity: Major
Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
spec/controllers/submitted_content_controller_spec.rb on lines 327..336
spec/controllers/submitted_content_controller_spec.rb on lines 343..352

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  describe 'student#edit' do
    it 'student#edit it' do
      allow(AssignmentParticipant).to receive(:find).and_return(participant)
      allow(Participant).to receive(:find_by).and_return(participant)
      allow(User).to receive(:find).and_return(participant)
Severity: Major
Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
spec/controllers/submitted_content_controller_spec.rb on lines 343..352
spec/controllers/submitted_content_controller_spec.rb on lines 359..368

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  describe 'instructor#edit' do
    it 'instructor#edit it' do
      allow(AssignmentParticipant).to receive(:find).and_return(participant)
      allow(Participant).to receive(:find_by).and_return(participant)
      allow(User).to receive(:find).and_return(participant)
Severity: Major
Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
spec/controllers/submitted_content_controller_spec.rb on lines 327..336
spec/controllers/submitted_content_controller_spec.rb on lines 359..368

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '.given_user_can_take_quiz?' do
    it 'returns false if there is no given user' do
      expect(given_user_can_take_quiz?(nil)).to be false
    end

Severity: Major
Found in spec/helpers/authorization_helper_spec.rb and 3 other locations - About 1 hr to fix
spec/helpers/authorization_helper_spec.rb on lines 420..436
spec/helpers/authorization_helper_spec.rb on lines 440..456
spec/helpers/authorization_helper_spec.rb on lines 480..496

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '.given_user_can_review?' do
    it 'returns false if there is no given user' do
      expect(given_user_can_review?(nil)).to be false
    end

Severity: Major
Found in spec/helpers/authorization_helper_spec.rb and 3 other locations - About 1 hr to fix
spec/helpers/authorization_helper_spec.rb on lines 420..436
spec/helpers/authorization_helper_spec.rb on lines 460..476
spec/helpers/authorization_helper_spec.rb on lines 480..496

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '.given_user_can_read?' do
    it 'returns false if there is no given user' do
      expect(given_user_can_read?(nil)).to be false
    end

Severity: Major
Found in spec/helpers/authorization_helper_spec.rb and 3 other locations - About 1 hr to fix
spec/helpers/authorization_helper_spec.rb on lines 420..436
spec/helpers/authorization_helper_spec.rb on lines 440..456
spec/helpers/authorization_helper_spec.rb on lines 460..476

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  describe '.given_user_can_submit?' do
    it 'returns false if there is no given user' do
      expect(given_user_can_submit?(nil)).to be false
    end

Severity: Major
Found in spec/helpers/authorization_helper_spec.rb and 3 other locations - About 1 hr to fix
spec/helpers/authorization_helper_spec.rb on lines 440..456
spec/helpers/authorization_helper_spec.rb on lines 460..476
spec/helpers/authorization_helper_spec.rb on lines 480..496

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    it 'true if review is done by teaching assistant' do
      allow(Response).to receive(:find).with(1).and_return(response)
      allow(ResponseMap).to receive(:find).with(1).and_return(review_response_map)
      allow(Participant).to receive(:find).with(1).and_return(participant)
      allow(User).to receive(:find).with(1).and_return(user)
Severity: Major
Found in spec/models/response_spec.rb and 1 other location - About 1 hr to fix
spec/models/response_spec.rb on lines 331..337

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    it 'true if review is done by Instructor' do
      allow(Response).to receive(:find).with(1).and_return(response)
      allow(ResponseMap).to receive(:find).with(1).and_return(review_response_map)
      allow(Participant).to receive(:find).with(1).and_return(participant)
      allow(User).to receive(:find).with(1).and_return(user)
Severity: Major
Found in spec/models/response_spec.rb and 1 other location - About 1 hr to fix
spec/models/response_spec.rb on lines 340..346

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    it 'deletes all topics for not private assignment and redirects to edit assignment page' do
      create(:topic, id: 2, assignment_id: 3)
      create(:topic, id: 3, assignment_id: 3)
      request_params = { assignment_id: 3 }
      post :delete_all_topics_for_assignment, params: request_params.merge(format: :html)
Severity: Major
Found in spec/controllers/sign_up_sheet_controller_spec.rb and 3 other locations - About 1 hr to fix
spec/controllers/sign_up_sheet_controller_spec.rb on lines 356..364
spec/controllers/sign_up_sheet_controller_spec.rb on lines 402..410
spec/controllers/sign_up_sheet_controller_spec.rb on lines 413..421

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    it 'deletes all topics for the private assignment and redirects to edit assignment page' do
      create(:topic, id: 2, assignment_id: 2)
      create(:topic, id: 3, assignment_id: 2)
      request_params = { assignment_id: 2 }
      post :delete_all_topics_for_assignment, params: request_params.merge(format: :html)
Severity: Major
Found in spec/controllers/sign_up_sheet_controller_spec.rb and 3 other locations - About 1 hr to fix
spec/controllers/sign_up_sheet_controller_spec.rb on lines 367..375
spec/controllers/sign_up_sheet_controller_spec.rb on lines 402..410
spec/controllers/sign_up_sheet_controller_spec.rb on lines 413..421

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    it 'deletes all topics for the microtask assignment and redirects to edit assignment page' do
      create(:topic, id: 6000, assignment_id: 6000)
      create(:topic, id: 7000, assignment_id: 6000)
      request_params = { assignment_id: 6000 }
      post :delete_all_topics_for_assignment, params: request_params.merge(format: :html)
Severity: Major
Found in spec/controllers/sign_up_sheet_controller_spec.rb and 3 other locations - About 1 hr to fix
spec/controllers/sign_up_sheet_controller_spec.rb on lines 356..364
spec/controllers/sign_up_sheet_controller_spec.rb on lines 367..375
spec/controllers/sign_up_sheet_controller_spec.rb on lines 413..421

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    it 'deletes all topics for not microtask assignment and redirects to edit assignment page' do
      create(:topic, id: 6000, assignment_id: 7000)
      create(:topic, id: 7000, assignment_id: 7000)
      request_params = { assignment_id: 7000 }
      post :delete_all_topics_for_assignment, params: request_params.merge(format: :html)
Severity: Major
Found in spec/controllers/sign_up_sheet_controller_spec.rb and 3 other locations - About 1 hr to fix
spec/controllers/sign_up_sheet_controller_spec.rb on lines 356..364
spec/controllers/sign_up_sheet_controller_spec.rb on lines 367..375
spec/controllers/sign_up_sheet_controller_spec.rb on lines 402..410

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language