expertiza/expertiza

View on GitHub

Showing 537 of 4,502 total issues

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

    it 'the order should be 2-3-1 if the order of comment volume is 2 > 3 > 1' do
      @response_1 = create(:response, response_map: @response_map_1, additional_comment: 'good')
      @response_2 = create(:response, response_map: @response_map_2, additional_comment: 'Good job with clear code')
      @response_3 = create(:response, response_map: @response_map_3, additional_comment: 'goodclear code')

Severity: Major
Found in spec/helpers/review_mapping_helper_spec.rb and 2 other locations - About 55 mins to fix
spec/helpers/review_mapping_helper_spec.rb on lines 485..494
spec/helpers/review_mapping_helper_spec.rb on lines 497..506

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 46.

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

        before(:each) do
          allow(assignment_questionnaire1).to receive(:id).and_return(1)
          allow(AssignmentQuestionnaire).to receive(:where).with(assignment_id: assignment.id).and_return(
            [assignment_questionnaire1]
          )
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 55 mins to fix
spec/models/assignment_form_spec.rb on lines 146..152
spec/models/assignment_form_spec.rb on lines 201..207
spec/models/assignment_form_spec.rb on lines 429..435

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 46.

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

        before(:each) do
          allow(assignment_questionnaire2).to receive(:id).and_return(2)
          allow(AssignmentQuestionnaire).to receive(:where).with(assignment_id: assignment.id).and_return(
            [assignment_questionnaire2]
          )
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 55 mins to fix
spec/models/assignment_form_spec.rb on lines 146..152
spec/models/assignment_form_spec.rb on lines 201..207
spec/models/assignment_form_spec.rb on lines 381..387

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 46.

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

    it 'the order should be 1-2-3 if the comment volume is 1 = 2 = 3' do
      @response_1 = create(:response, response_map: @response_map_1, additional_comment: 'good job')
      @response_2 = create(:response, response_map: @response_map_2, additional_comment: 'clear code')
      @response_3 = create(:response, response_map: @response_map_3, additional_comment: 'nice bro')

Severity: Major
Found in spec/helpers/review_mapping_helper_spec.rb and 2 other locations - About 55 mins to fix
spec/helpers/review_mapping_helper_spec.rb on lines 473..482
spec/helpers/review_mapping_helper_spec.rb on lines 485..494

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 46.

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 'contains only unique display_names, code_names and database_encodings' do
      display_names = Locale.available_locale_preferences.map(&:display_name)
      expect(display_names.uniq.length).to eq(display_names.length)
      code_names = Locale.available_locale_preferences.map(&:code_name)
      expect(code_names.uniq.length).to eq(code_names.length)
Severity: Minor
Found in spec/models/locale_spec.rb and 1 other location - About 55 mins to fix
spec/models/locale_spec.rb on lines 8..14

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 46.

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 'contains only unique display_names, code_names and database_encodings' do
      display_names = Locale.available_locales.map(&:display_name)
      expect(display_names.uniq.length).to eq(display_names.length)
      code_names = Locale.available_locales.map(&:code_name)
      expect(code_names.uniq.length).to eq(code_names.length)
Severity: Minor
Found in spec/models/locale_spec.rb and 1 other location - About 55 mins to fix
spec/models/locale_spec.rb on lines 22..28

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 46.

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 'should edit quiz number available to students' do
    fill_assignment_form
    check('assignment_form_assignment_require_quiz')
    click_button 'Save'
    fill_in 'assignment_form_assignment_num_quiz_questions', with: 5
Severity: Minor
Found in spec/features/assignment_creation_general_tab_spec.rb and 1 other location - About 55 mins to fix
spec/features/assignment_creation_spec.rb on lines 379..393

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 45.

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 'should edit quiz number available to students' do
      fill_assignment_form
      check('assignment_form_assignment_require_quiz')
      click_button 'Save'
      fill_in 'assignment_form_assignment_num_quiz_questions', with: 5
Severity: Minor
Found in spec/features/assignment_creation_spec.rb and 1 other location - About 55 mins to fix
spec/features/assignment_creation_general_tab_spec.rb on lines 35..49

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 45.

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 5 locations. Consider refactoring.
Open

      request_params = {
        user: { name: 'lily2',
                crypted_password: 'password',
                role_id: 1,
                password_salt: 1,
Severity: Major
Found in spec/controllers/conference_controller_spec.rb and 4 other locations - About 55 mins to fix
spec/controllers/conference_controller_spec.rb on lines 108..129
spec/controllers/users_controller_spec.rb on lines 199..220
spec/controllers/users_controller_spec.rb on lines 229..250
spec/controllers/users_controller_spec.rb on lines 260..281

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 44.

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 5 locations. Consider refactoring.
Open

      request_params = {
        user: { name: 'lily',
                crypted_password: 'password',
                role_id: 2,
                password_salt: 1,
Severity: Major
Found in spec/controllers/users_controller_spec.rb and 4 other locations - About 55 mins to fix
spec/controllers/conference_controller_spec.rb on lines 108..129
spec/controllers/conference_controller_spec.rb on lines 138..159
spec/controllers/users_controller_spec.rb on lines 229..250
spec/controllers/users_controller_spec.rb on lines 260..281

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 44.

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 5 locations. Consider refactoring.
Open

      request_params = {
        user: { name: 'lily',
                crypted_password: 'password',
                role_id: 1,
                password_salt: 1,
Severity: Major
Found in spec/controllers/conference_controller_spec.rb and 4 other locations - About 55 mins to fix
spec/controllers/conference_controller_spec.rb on lines 138..159
spec/controllers/users_controller_spec.rb on lines 199..220
spec/controllers/users_controller_spec.rb on lines 229..250
spec/controllers/users_controller_spec.rb on lines 260..281

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 44.

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 5 locations. Consider refactoring.
Open

      request_params = {
        user: { name: 'instructor6',
                crypted_password: 'password',
                role_id: 2,
                password_salt: 1,
Severity: Major
Found in spec/controllers/users_controller_spec.rb and 4 other locations - About 55 mins to fix
spec/controllers/conference_controller_spec.rb on lines 108..129
spec/controllers/conference_controller_spec.rb on lines 138..159
spec/controllers/users_controller_spec.rb on lines 199..220
spec/controllers/users_controller_spec.rb on lines 229..250

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 44.

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 5 locations. Consider refactoring.
Open

      request_params = {
        user: { name: 'instructor6',
                crypted_password: 'password',
                role_id: 2,
                password_salt: 1,
Severity: Major
Found in spec/controllers/users_controller_spec.rb and 4 other locations - About 55 mins to fix
spec/controllers/conference_controller_spec.rb on lines 108..129
spec/controllers/conference_controller_spec.rb on lines 138..159
spec/controllers/users_controller_spec.rb on lines 199..220
spec/controllers/users_controller_spec.rb on lines 260..281

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 44.

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 5 locations. Consider refactoring.
Open

  describe '#delete' do
    it 'deletes the assignment_participant and redirects to #review_mapping/list_mappings page' do
      allow(Participant).to receive(:find).with('1').and_return(participant)
      allow(participant).to receive(:destroy).and_return(true)
      params = { id: 1 }
Severity: Major
Found in spec/controllers/participants_controller_spec.rb and 4 other locations - About 50 mins to fix
spec/controllers/courses_controller_spec.rb on lines 41..48
spec/controllers/participants_controller_spec.rb on lines 41..48
spec/controllers/participants_controller_spec.rb on lines 52..59
spec/controllers/participants_controller_spec.rb on lines 145..152

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 43.

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 5 locations. Consider refactoring.
Open

  describe '#destroy' do
    it 'deletes the participant and redirects to #list page' do
      allow(Participant).to receive(:find).with('1').and_return(course_participant)
      allow(course_participant).to receive(:destroy).and_return(true)
      request_params = { id: 1 }
Severity: Major
Found in spec/controllers/participants_controller_spec.rb and 4 other locations - About 50 mins to fix
spec/controllers/courses_controller_spec.rb on lines 41..48
spec/controllers/participants_controller_spec.rb on lines 52..59
spec/controllers/participants_controller_spec.rb on lines 145..152
spec/controllers/participants_controller_spec.rb on lines 188..195

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 43.

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 'returns attributes (args) and does not change @has_errors value since save and update_attributes methods work correctly' do
          allow(assignment_questionnaire1).to receive(:save).and_return(true)
          allow(assignment_questionnaire1).to receive(:update_attributes).with(aq_attributes1).and_return(true)
          allow(assignment_questionnaire1).to receive(:update_attributes).with(aq_attributes2).and_return(true)
          expect(assignment_form.update_assignment_questionnaires(attributes)).to eq(attributes)
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 50 mins to fix
spec/models/assignment_form_spec.rb on lines 210..215
spec/models/assignment_form_spec.rb on lines 256..261
spec/models/assignment_form_spec.rb on lines 438..443

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 43.

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 5 locations. Consider refactoring.
Open

  describe '#delete' do
    it 'deletes the course and redirects to tree_display#list page' do
      allow(Course).to receive(:find).with('1').and_return(course)
      allow(course).to receive(:destroy).and_return(true)
      request_params = { id: 1 }
Severity: Major
Found in spec/controllers/courses_controller_spec.rb and 4 other locations - About 50 mins to fix
spec/controllers/participants_controller_spec.rb on lines 41..48
spec/controllers/participants_controller_spec.rb on lines 52..59
spec/controllers/participants_controller_spec.rb on lines 145..152
spec/controllers/participants_controller_spec.rb on lines 188..195

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 43.

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 'should edit number of members per team ' do
    fill_assignment_form
    check('assignment_form_assignment_show_teammate_reviews')
    fill_in 'assignment_form_assignment_max_team_size', with: 5
    click_button 'Save'
Severity: Minor
Found in spec/features/assignment_creation_general_tab_spec.rb and 1 other location - About 50 mins to fix
spec/features/assignment_creation_spec.rb on lines 396..409

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 43.

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 'should edit number of members per team ' do
      fill_assignment_form
      check('assignment_form_assignment_show_teammate_reviews')
      fill_in 'assignment_form_assignment_max_team_size', with: 5
      click_button 'Save'
Severity: Minor
Found in spec/features/assignment_creation_spec.rb and 1 other location - About 50 mins to fix
spec/features/assignment_creation_general_tab_spec.rb on lines 52..65

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 43.

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' do
          allow(assignment_questionnaire1).to receive(:save).and_return(true)
          allow(assignment_questionnaire1).to receive(:update_attributes).with(aq_attributes1).and_return(false)
          allow(assignment_questionnaire1).to receive(:update_attributes).with(aq_attributes2).and_return(false)
          expect(assignment_form.update_assignment_questionnaires(attributes)).to eq(attributes)
Severity: Minor
Found in spec/models/assignment_form_spec.rb and 1 other location - About 50 mins to fix
spec/models/assignment_form_spec.rb on lines 491..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 43.

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