expertiza/expertiza

View on GitHub
spec/factories/factories.rb

Summary

Maintainability
D
3 days
Test Coverage

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

FactoryBot.define do
  factory :institution, class: Institution do
    name 'North Carolina State University'
  end

Severity: Minor
Found in spec/factories/factories.rb by rubocop

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

FactoryBot.define do
  factory :institution, class: Institution do
    name 'North Carolina State University'
  end

Severity: Major
Found in spec/factories/factories.rb - About 1 day to fix

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

      factory :assignment, class: Assignment do
        # Help multiple factory-created assignments get unique names
        # Let the first created assignment have the name 'final2' to avoid breaking some fragile existing tests
        name { (Assignment.last ? ('assignment' + (Assignment.last.id + 1).to_s) : 'final2').to_s }
        directory_path 'final_test'
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    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.

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

      factory :admin, class: User do
        sequence(:name) { |n| "admin#{n}" }
        role { Role.where(name: 'Administrator').first || association(:role_of_administrator) }
        password 'password'
        password_confirmation 'password'
    Severity: Major
    Found in spec/factories/factories.rb and 1 other location - About 1 hr to fix
    spec/factories/factories.rb on lines 73..92

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

    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

      factory :superadmin, class: User do
        sequence(:name) { |n| "superadmin#{n}" }
        role { Role.where(name: 'Super-Administrator').first || association(:role_of_superadministrator) }
        password 'password'
        password_confirmation 'password'
    Severity: Major
    Found in spec/factories/factories.rb and 1 other location - About 1 hr to fix
    spec/factories/factories.rb on lines 51..70

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

    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

      factory :instructor, class: Instructor do
        name 'instructor6'
        role { Role.where(name: 'Instructor').first || association(:role_of_instructor) }
        password 'password'
        password_confirmation 'password'
    Severity: Major
    Found in spec/factories/factories.rb and 1 other location - About 1 hr to fix
    spec/factories/factories.rb on lines 167..186

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

    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

      factory :teaching_assistant, class: Ta do
        name 'teaching_assistant5888'
        role { Role.where(name: 'Teaching Assistant').first || association(:role_of_teaching_assistant) }
        password 'password'
        password_confirmation 'password'
    Severity: Major
    Found in spec/factories/factories.rb and 1 other location - About 1 hr to fix
    spec/factories/factories.rb on lines 145..164

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

    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

      factory :course_participant, class: CourseParticipant do
        can_submit true
        can_review true
        course { Course.first || association(:course) }
        association :user, factory: :student
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 50 mins to fix
    spec/factories/factories.rb on lines 325..339

    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

      factory :participant, class: AssignmentParticipant do
        can_submit true
        can_review true
        assignment { Assignment.first || association(:assignment) }
        association :user, factory: :student
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 50 mins to fix
    spec/factories/factories.rb on lines 342..356

    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

      factory :review_response_map, class: ReviewResponseMap do
        assignment { Assignment.first || association(:assignment) }
        reviewer { AssignmentParticipant.first || association(:participant) }
        reviewee { AssignmentTeam.first || association(:assignment_team) }
        type 'ReviewResponseMap'
    Severity: Major
    Found in spec/factories/factories.rb and 4 other locations - About 30 mins to fix
    spec/factories/factories.rb on lines 519..524
    spec/factories/factories.rb on lines 532..537
    spec/factories/factories.rb on lines 548..553
    spec/factories/factories.rb on lines 751..756

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

      factory :teammate_review_response_map, class: TeammateReviewResponseMap do
        assignment { Assignment.first || association(:assignment) }
        reviewer { AssignmentParticipant.first || association(:participant) }
        reviewee { AssignmentParticipant.first || association(:participant) }
        type 'TeammateReviewResponseMap'
    Severity: Major
    Found in spec/factories/factories.rb and 4 other locations - About 30 mins to fix
    spec/factories/factories.rb on lines 511..516
    spec/factories/factories.rb on lines 532..537
    spec/factories/factories.rb on lines 548..553
    spec/factories/factories.rb on lines 751..756

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

      factory :bookmark_review_response_map, class: BookmarkRatingResponseMap do
        assignment { Assignment.first || association(:assignment) }
        reviewer { AssignmentParticipant.first || association(:participant) }
        reviewee { Bookmark.first || association(:assignment_team) }
        type 'BookmarkRatingResponseMap'
    Severity: Major
    Found in spec/factories/factories.rb and 4 other locations - About 30 mins to fix
    spec/factories/factories.rb on lines 511..516
    spec/factories/factories.rb on lines 519..524
    spec/factories/factories.rb on lines 532..537
    spec/factories/factories.rb on lines 751..756

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

      factory :self_review_response_map, class: SelfReviewResponseMap do
        assignment { Assignment.first || association(:assignment) }
        reviewer { AssignmentParticipant.first || association(:participant) }
        reviewee { AssignmentTeam.first || association(:assignment_team) }
        type 'ReviewResponseMap'
    Severity: Major
    Found in spec/factories/factories.rb and 4 other locations - About 30 mins to fix
    spec/factories/factories.rb on lines 511..516
    spec/factories/factories.rb on lines 519..524
    spec/factories/factories.rb on lines 548..553
    spec/factories/factories.rb on lines 751..756

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

      factory :tag_prompt_deployment, class: TagPromptDeployment do
        tag_prompt { TagPrompt.first || association(:tag_prompt) }
        assignment { Assignment.first || association(:assignment) }
        questionnaire { Questionnaire.first || association(:questionnaire) }
        question_type 'Criterion'
    Severity: Major
    Found in spec/factories/factories.rb and 4 other locations - About 30 mins to fix
    spec/factories/factories.rb on lines 511..516
    spec/factories/factories.rb on lines 519..524
    spec/factories/factories.rb on lines 532..537
    spec/factories/factories.rb on lines 548..553

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

      factory :course_team, class: CourseTeam do
        sequence(:name) { |n| "team#{n}" }
        course { Course.first || association(:course) }
        type 'CourseTeam'
        comments_for_advertisement nil
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 25 mins to fix
    spec/factories/factories.rb on lines 262..270

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

      factory :assignment_questionnaire, class: AssignmentQuestionnaire do
        assignment { Assignment.first || association(:assignment) }
        questionnaire { ReviewQuestionnaire.first || association(:questionnaire) }
        user_id 1
        questionnaire_weight 100
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 25 mins to fix
    spec/factories/factories.rb on lines 493..500

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

      factory :assignment_team, class: AssignmentTeam do
        sequence(:name) { |n| "team#{n}" }
        assignment { Assignment.first || association(:assignment) }
        type 'AssignmentTeam'
        comments_for_advertisement nil
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 25 mins to fix
    spec/factories/factories.rb on lines 273..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 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 2 locations. Consider refactoring.
    Open

      factory :assignment_teammate_questionnaire, class: AssignmentQuestionnaire do
        assignment { Assignment.first || association(:assignment) }
        questionnaire { TeammateReviewQuestionnaire.first || association(:teammate_questionnaire) }
        user_id 1
        questionnaire_weight 100
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 25 mins to fix
    spec/factories/factories.rb on lines 483..490

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

      factory :teammate_questionnaire, class: TeammateReviewQuestionnaire do
        name 'Test questionnaire'
        # Beware: it is fragile to assume that role_id of instructor is 1 (or any other unchanging value)
        instructor { Instructor.first || association(:instructor) }
        private 0
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 20 mins to fix
    spec/factories/factories.rb on lines 434..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 28.

    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

      factory :questionnaire, class: ReviewQuestionnaire do
        name 'Test questionnaire'
        # Beware: it is fragile to assume that role_id of instructor is 1 (or any other unchanging value)
        instructor { Instructor.first || association(:instructor) }
        private 0
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 20 mins to fix
    spec/factories/factories.rb on lines 446..455

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

    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

    Do not use semicolons to terminate expressions.
    Open

        sequence(:name) { |n| n = n % 3; "mentor206#{n + 4}" }
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    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

        due_at DateTime.now.in_time_zone + 1.day
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    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)

    Trailing whitespace detected.
    Open

      end 
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    Extra blank line detected.
    Open

    
      factory :student, class: User do
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    This cops checks for two or more consecutive blank lines.

    Example:

    # bad - It has two empty lines.
    some_method
    # one empty line
    # two empty lines
    some_method
    
    # good
    some_method
    # one empty line
    some_method

    Trailing whitespace detected.
    Open

      end 
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    Do not use semicolons to terminate expressions.
    Open

        sequence(:fullname) { |n| n = n % 3; "206#{n + 4}, student" }
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    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

    Do not use semicolons to terminate expressions.
    Open

        sequence(:name) { |n| n = n % 3; "student206#{n + 4}" }
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    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

        due_at DateTime.now.in_time_zone + 1.day
    Severity: Minor
    Found in spec/factories/factories.rb by rubocop

    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