expertiza/expertiza

View on GitHub
spec/features/assignment_creation_spec.rb

Summary

Maintainability
F
5 days
Test Coverage

Block has too many lines. [600/25]
Open

describe 'assignment function' do
  before(:each) do
    create(:deadline_type, name: 'submission')
    create(:deadline_type, name: 'review')
    create(:deadline_type, name: 'metareview')

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. [227/25]
Open

  describe 'creation page', js: true do
    before(:each) do
      (1..3).each do |i|
        create(:course, name: "Course #{i}")
      end

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_creation_spec.rb has 632 lines of code (exceeds 250 allowed). Consider refactoring.
Open

def questionnaire_options(type)
  questionnaires = Questionnaire.where(['private = 0 or instructor_id = ?', session[:user].id]).order('name')
  options = []
  questionnaires.select { |x| x.type == type }.each do |questionnaire|
    options << [questionnaire.name, questionnaire.id]
Severity: Major
Found in spec/features/assignment_creation_spec.rb - About 1 day to fix

    Block has too many lines. [81/25]
    Open

      describe 'topics tab', js: true do
        before(:each) do
          (1..3).each do |i|
            create(:course, name: "Course #{i}")
          end

    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. [75/25]
    Open

      describe 'general tab', js: true do
        before(:each) do
          (1..3).each do |i|
            create(:course, name: "Course #{i}")
          end

    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. [71/25]
    Open

      describe 'rubrics tab', js: true do
        before(:each) do
          @assignment = create(:assignment)
          create_list(:participant, 3)
          # Create an assignment due date

    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. [50/25]
    Open

        describe 'Edit review rubric' do
          it 'updates review questionnaire' do
            within(:css, 'tr#questionnaire_table_ReviewQuestionnaire') do
              select 'ReviewQuestionnaire2', from: 'assignment_form[assignment_questionnaire][][questionnaire_id]'
              uncheck('dropdown')

    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 'Due dates tab', js: true do
        before(:each) do
          @assignment = create(:assignment, name: 'public assignment for test')
          login_as('instructor6')
          visit "/assignments/#{@assignment.id}/edit"

    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. [28/25]
    Open

      describe 'review strategy tab', js: true do
        before(:each) do
          create(:assignment, name: 'public assignment for test')
          @assignment_id = Assignment.where(name: 'public assignment for test').first.id
        end

    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 'deadlines', js: true do
        before(:each) do
          @assignment = create(:assignment, name: 'public assignment for test')
          login_as('instructor6')
          visit "/assignments/#{@assignment.id}/edit"

    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.

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

        describe 'Edit review rubric' do
          it 'updates review questionnaire' do
            within(:css, 'tr#questionnaire_table_ReviewQuestionnaire') do
              select 'ReviewQuestionnaire2', from: 'assignment_form[assignment_questionnaire][][questionnaire_id]'
              uncheck('dropdown')
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 4 hrs to fix
    spec/features/assignment_creation_rubrics_spec.rb on lines 29..84

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

    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 'set the deadline for an assignment review' do
          sleep 3
          fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'
          page.find('#set_rounds').click
          fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime('%Y/%m/%d %H:%M')
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 2 hrs to fix
    spec/features/assignment_creation_deadlines_spec.rb on lines 14..35

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

    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 'set the deadline for an assignment review' do
          fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'
          click_button 'set_rounds'
          fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime('%Y/%m/%d %H:%M')
          fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime('%Y/%m/%d %H:%M')
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 2 hrs to fix
    spec/features/assignment_creation_dates_spec.rb on lines 32..52

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

    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 'is able to create a public assignment' do
          login_as('instructor6')
          visit '/assignments/new?private=0'
    
          fill_in 'assignment_form_assignment_name', with: 'public assignment for test'
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 2 hrs to fix
    spec/features/assignment_creation_page_spec.rb on lines 13..37

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

    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 'Delete existing topic', js: true do
          create(:assignment_due_date, deadline_type: DeadlineType.where(name: 'submission').first, due_at: DateTime.now.in_time_zone + 1.day)
          click_link 'Due date'
          fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'
          click_button 'set_rounds'
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 2 hrs to fix
    spec/features/assignment_creation_topics_spec.rb on lines 91..107

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

    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 'check to find if the assignment can be added to a course', js: true do
        create(:assignment, course: nil, name: 'Test Assignment')
        create(:course, name: 'Test Course')
    
        course_id = Course.where(name: 'test Course')[0].id
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 1 hr to fix
    spec/features/assignment_creation_page_spec.rb on lines 204..221

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

    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 'check to see if participants can be added' do
          student = create(:student)
          login_as('instructor6')
          assignment_id = Assignment.where(name: 'participants Assignment').first.id
          visit "/participants/list?id=#{assignment_id}&model=Assignment"
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 1 hr to fix
    spec/features/assignment_creation_participants_spec.rb on lines 13..25

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

    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 'Add new topic' do
          click_link 'New topic'
          click_button 'OK'
          fill_in 'topic_topic_identifier', with: '1'
          fill_in 'topic_topic_name', with: 'Test'
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 1 hr to fix
    spec/features/assignment_creation_topics_spec.rb on lines 72..88

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

    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 'is able to create with quiz' do
          login_as('instructor6')
          visit '/assignments/new?private=1'
    
          fill_in 'assignment_form_assignment_name', with: 'private assignment for test'
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 1 hr to fix
    spec/features/assignment_creation_spec.rb on lines 107..124

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

    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 'is able to create with teams' do
          login_as('instructor6')
          visit '/assignments/new?private=1'
    
          fill_in 'assignment_form_assignment_name', with: 'private assignment for test'
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 1 hr to fix
    spec/features/assignment_creation_spec.rb on lines 127..143

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

    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 'auto selects' do
          login_as('instructor6')
          visit "/assignments/#{@assignment_id}/edit"
          find_link('ReviewStrategy').click
          select 'Auto-Selected', from: 'assignment_form_assignment_review_assignment_strategy'
    Severity: Major
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 1 hr to fix
    spec/features/assignment_creation_review_strategy_spec.rb on lines 12..25

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

    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

    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

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

        it 'is able to create public micro-task assignment' do
          login_as('instructor6')
          visit '/assignments/new?private=0'
    
          fill_in 'assignment_form_assignment_name', with: 'public assignment for test'
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 45 mins to fix
    spec/features/assignment_creation_spec.rb on lines 207..220

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

    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 'is able to create calibrated public assignment' do
          login_as('instructor6')
          visit '/assignments/new?private=0'
    
          fill_in 'assignment_form_assignment_name', with: 'public assignment for test'
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 45 mins to fix
    spec/features/assignment_creation_spec.rb on lines 192..205

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

    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 assignment available to students' do
          fill_assignment_form
          check('assignment_form_assignment_microtask')
          check('assignment_form_assignment_is_calibrated')
          click_button 'Save'
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 45 mins to fix
    spec/features/assignment_creation_general_tab_spec.rb on lines 19..32

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

    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 'can edit topics properties - unCheck' do
          uncheck('assignment_form_assignment_allow_suggestions')
          uncheck('assignment_form_assignment_is_intelligent')
          uncheck('assignment_form_assignment_can_review_same_topic')
          uncheck('assignment_form_assignment_can_choose_topic_to_review')
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 40 mins to fix
    spec/features/assignment_creation_topics_spec.rb on lines 55..69

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

    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 'can edit topics properties - Check' do
          check('assignment_form_assignment_allow_suggestions')
          check('assignment_form_assignment_is_intelligent')
          check('assignment_form_assignment_can_review_same_topic')
          check('assignment_form_assignment_can_choose_topic_to_review')
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 40 mins to fix
    spec/features/assignment_creation_topics_spec.rb on lines 38..52

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

    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 review visible to all other reviewers' do
          fill_assignment_form
          check 'assignment_form_assignment_reviews_visible_to_all'
          click_button 'Save'
          assignment = Assignment.where(name: 'edit assignment for test').first
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 35 mins to fix
    spec/features/assignment_creation_general_tab_spec.rb on lines 69..79

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

    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

    def questionnaire_options(type)
      questionnaires = Questionnaire.where(['private = 0 or instructor_id = ?', session[:user].id]).order('name')
      options = []
      questionnaires.select { |x| x.type == type }.each do |questionnaire|
        options << [questionnaire.name, questionnaire.id]
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 35 mins to fix
    app/helpers/assignment_helper.rb on lines 37..43

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

    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

    def get_selected_id(finder_var)
      if finder_var == 'ReviewQuestionnaire2'
        ReviewQuestionnaire.find_by(name: finder_var).id
      elsif finder_var == 'AuthorFeedbackQuestionnaire2'
        AuthorFeedbackQuestionnaire.find_by(name: finder_var).id
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 30 mins to fix
    spec/features/helpers/assignment_creation_helper.rb on lines 10..17

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

    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 'is able show tab rubrics' do
          login_as('instructor6')
          visit '/assignments/new?private=0'
          fill_in 'assignment_form_assignment_name', with: 'public assignment for test'
          select('Course 2', from: 'assignment_form_assignment_course_id')
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 3 other locations - About 25 mins to fix
    spec/features/assignment_creation_spec.rb on lines 222..230
    spec/features/assignment_creation_spec.rb on lines 233..241
    spec/features/assignment_creation_spec.rb on lines 283..291

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

    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 'is able show tab review strategy' do
          login_as('instructor6')
          visit '/assignments/new?private=0'
          fill_in 'assignment_form_assignment_name', with: 'public assignment for test'
          select('Course 2', from: 'assignment_form_assignment_course_id')
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 3 other locations - About 25 mins to fix
    spec/features/assignment_creation_spec.rb on lines 233..241
    spec/features/assignment_creation_spec.rb on lines 272..280
    spec/features/assignment_creation_spec.rb on lines 283..291

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

    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 'is able show tab due deadlines' do
          login_as('instructor6')
          visit '/assignments/new?private=0'
          fill_in 'assignment_form_assignment_name', with: 'public assignment for test'
          select('Course 2', from: 'assignment_form_assignment_course_id')
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 3 other locations - About 25 mins to fix
    spec/features/assignment_creation_spec.rb on lines 222..230
    spec/features/assignment_creation_spec.rb on lines 272..280
    spec/features/assignment_creation_spec.rb on lines 283..291

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

    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 'is able show attributes in rubrics' do
          login_as('instructor6')
          visit '/assignments/new?private=0'
          fill_in 'assignment_form_assignment_name', with: 'public assignment for test'
          select('Course 2', from: 'assignment_form_assignment_course_id')
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 3 other locations - About 25 mins to fix
    spec/features/assignment_creation_spec.rb on lines 222..230
    spec/features/assignment_creation_spec.rb on lines 233..241
    spec/features/assignment_creation_spec.rb on lines 272..280

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

    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

          (1..3).each do |i|
            create(:questionnaire, name: "ReviewQuestionnaire#{i}")
            create(:questionnaire, name: "AuthorFeedbackQuestionnaire#{i}", type: 'AuthorFeedbackQuestionnaire')
            create(:questionnaire, name: "TeammateReviewQuestionnaire#{i}", type: 'TeammateReviewQuestionnaire')
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 25 mins to fix
    spec/features/assignment_creation_rubrics_spec.rb on lines 18..21

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

    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 'sets number of reviews by each student' do
          pending('review section not yet completed')
          login_as('instructor6')
          visit '/assignments/1/edit'
          find_link('ReviewStrategy').click
    Severity: Minor
    Found in spec/features/assignment_creation_spec.rb and 1 other location - About 15 mins to fix
    spec/features/assignment_creation_review_strategy_spec.rb on lines 29..37

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

    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

    Prefer Date or Time over DateTime.
    Open

          create :assignment_due_date, due_at: (DateTime.now.in_time_zone + 1), deadline_type: @review_deadline_type

    This cop checks for uses of DateTime that should be replaced by Date or Time.

    Example:

    # bad - uses `DateTime` for current time
    DateTime.now
    
    # good - uses `Time` for current time
    Time.now
    
    # bad - uses `DateTime` for modern date
    DateTime.iso8601('2016-06-29')
    
    # good - uses `Date` for modern date
    Date.iso8601('2016-06-29')
    
    # good - uses `DateTime` with start argument for historical date
    DateTime.iso8601('1751-04-23', Date::ENGLAND)

    Do not use semicolons to terminate expressions.
    Open

          expect { click_button 'Add', match: :first; sleep(1) }.to change { Participant.count }.by 1

    This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.

    Example:

    # bad
    foo = 1; bar = 2;
    baz = 3;
    
    # good
    foo = 1
    bar = 2
    baz = 3

    Prefer Date or Time over DateTime.
    Open

          create :assignment_due_date, due_at: (DateTime.now.in_time_zone - 1)

    This cop checks for uses of DateTime that should be replaced by Date or Time.

    Example:

    # bad - uses `DateTime` for current time
    DateTime.now
    
    # good - uses `Time` for current time
    Time.now
    
    # bad - uses `DateTime` for modern date
    DateTime.iso8601('2016-06-29')
    
    # good - uses `Date` for modern date
    Date.iso8601('2016-06-29')
    
    # good - uses `DateTime` with start argument for historical date
    DateTime.iso8601('1751-04-23', Date::ENGLAND)

    Prefer Date or Time over DateTime.
    Open

          create(:assignment_due_date, deadline_type: DeadlineType.where(name: 'submission').first, due_at: DateTime.now.in_time_zone + 1.day)

    This cop checks for uses of DateTime that should be replaced by Date or Time.

    Example:

    # bad - uses `DateTime` for current time
    DateTime.now
    
    # good - uses `Time` for current time
    Time.now
    
    # bad - uses `DateTime` for modern date
    DateTime.iso8601('2016-06-29')
    
    # good - uses `Date` for modern date
    Date.iso8601('2016-06-29')
    
    # good - uses `DateTime` with start argument for historical date
    DateTime.iso8601('1751-04-23', Date::ENGLAND)

    There are no issues that match your filters.

    Category
    Status