expertiza/expertiza

View on GitHub

Showing 531 of 4,497 total issues

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

    (1..10).each do |i|
      student = create :student, name: 'student' + i.to_s
      create :participant, assignment: @assignment, user: student
      if (i % 3 == 1) && (i != 10)
        instance_variable_set('@team' + (i / 3 + 1).to_s, create(:assignment_team, name: 'team' + i.to_s))
Severity: Major
Found in spec/features/teams_as_reviewers_spec.rb and 1 other location - About 1 hr to fix
spec/features/review_mapping_spec.rb on lines 38..46

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

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

  describe '#max_num_assignment_reviews' do
    context 'there have been no assignments added to a course' do
      it 'should return zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.max_num_assignment_reviews).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 238..251

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

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

  describe '#max_assignment_score' do
    context 'when there are no assignments' do
      it 'returns zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.max_assignment_score).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 221..234
spec/models/course_analytic_spec.rb on lines 238..251

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

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

  describe '#min_assignment_score' do
    context 'when there are no assignments' do
      it 'returns zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.min_assignment_score).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 221..234
spec/models/course_analytic_spec.rb on lines 238..251

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

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

  describe '#total_num_assignment_reviews' do
    context 'there have been no assignments added to a course' do
      it 'should return zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.total_num_assignment_reviews).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 221..234
spec/models/course_analytic_spec.rb on lines 238..251

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

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

  describe '#total_num_assignment_teams' do
    context 'when there are no assignments' do
      it 'returns zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.total_num_assignment_teams).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 221..234
spec/models/course_analytic_spec.rb on lines 238..251

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

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

  describe '#min_num_assignment_reviews' do
    context 'there have been no assignments added to a course' do
      it 'should return zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.min_num_assignment_reviews).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 221..234

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

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

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

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

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

Refactorings

Further Reading

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

      it 'throws an error for missing badge description' do
        @file = fixture_file_upload('app/assets/images/badges/test.png', 'image/png')
        allow(@file).to receive(:original_filename).and_return("test.png")
        session = { user: instructor1 }
        params = {
Severity: Major
Found in spec/controllers/badges_controller_spec.rb and 2 other locations - About 1 hr to fix
spec/controllers/badges_controller_spec.rb on lines 85..101
spec/controllers/badges_controller_spec.rb on lines 125..141

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

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

  describe '#average_assignment_score' do
    context 'when there are no assignments' do
      it 'returns zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.average_assignment_score).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 221..234
spec/models/course_analytic_spec.rb on lines 238..251

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

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

  describe '#average_num_assignment_reviews' do
    context 'there have been no assignments added to a course' do
      it 'should return zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.average_num_assignment_reviews).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 102..115
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 221..234
spec/models/course_analytic_spec.rb on lines 238..251

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

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

  describe '#min_num_assignment_teams' do
    context 'when there are no assignments' do
      it 'returns zero' do
        dc = CourseAnalyticTestDummyClass.new(course, [], [])
        expect(dc.min_num_assignment_teams).to eq(0)
Severity: Major
Found in spec/models/course_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/course_analytic_spec.rb on lines 51..64
spec/models/course_analytic_spec.rb on lines 68..81
spec/models/course_analytic_spec.rb on lines 85..98
spec/models/course_analytic_spec.rb on lines 119..132
spec/models/course_analytic_spec.rb on lines 136..149
spec/models/course_analytic_spec.rb on lines 153..166
spec/models/course_analytic_spec.rb on lines 187..200
spec/models/course_analytic_spec.rb on lines 204..217
spec/models/course_analytic_spec.rb on lines 221..234
spec/models/course_analytic_spec.rb on lines 238..251

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

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..10).each do |i|
      student = create :student, name: 'student' + i.to_s
      create :participant, assignment: @assignment, user: student
      if (i % 3 == 1) && (i != 10)
        instance_variable_set('@team' + (i / 3 + 1).to_s, create(:assignment_team, name: 'team' + i.to_s))
Severity: Major
Found in spec/features/review_mapping_spec.rb and 1 other location - About 1 hr to fix
spec/features/teams_as_reviewers_spec.rb on lines 16..24

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

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

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

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

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

Refactorings

Further Reading

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

        it 'saves the badge successfully' do
        @file = fixture_file_upload('app/assets/images/badges/test.png', 'image/png')
        allow(@file).to receive(:original_filename).and_return("test.png")
        session = { user: instructor1 }
        params = {
Severity: Major
Found in spec/controllers/badges_controller_spec.rb and 2 other locations - About 1 hr to fix
spec/controllers/badges_controller_spec.rb on lines 125..141
spec/controllers/badges_controller_spec.rb on lines 145..161

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

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

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

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

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

Refactorings

Further Reading

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

      it 'throws an error for missing badge name' do
        @file = fixture_file_upload('app/assets/images/badges/test.png', 'image/png')
        allow(@file).to receive(:original_filename).and_return("test.png")
        session = { user: instructor1 }
        params = {
Severity: Major
Found in spec/controllers/badges_controller_spec.rb and 2 other locations - About 1 hr to fix
spec/controllers/badges_controller_spec.rb on lines 85..101
spec/controllers/badges_controller_spec.rb on lines 145..161

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

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 deal with comment is not nil, with one comments greater than 10' do
    # @list_of_rows = [VmQuestionResponseRow.new('', 1, 1, 5, 0)]
    allow(Answer).to receive(:where).with(any_args)
                                    .and_return([double('Answer', question_id: 1, response_id: 1, comments: 'one two three four five six seven eight nine ten eleven'),
                                                 double('Answer', question_id: 1, response_id: 1, comments: '233')])
Severity: Major
Found in spec/models/airbrake_expection_errors_unit_tests_spec.rb and 1 other location - About 1 hr to fix
spec/models/airbrake_expection_errors_unit_tests_spec.rb on lines 28..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 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 :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

  it 'can deal with comment is not nil, with two comments greater than 10' do
    allow(Answer).to receive(:where).with(any_args)
                                    .and_return([double('Answer', question_id: 1, response_id: 1, comments: 'one two three four five six seven eight nine ten eleven'),
                                                 double('Answer', question_id: 1, response_id: 1, comments: 'one two three four five six seven eight nine ten eleven')])
    expect { @return_value = @qs.number_of_comments_greater_than_10_words }.not_to raise_error(NoMethodError)
Severity: Major
Found in spec/models/airbrake_expection_errors_unit_tests_spec.rb and 1 other location - About 1 hr to fix
spec/models/airbrake_expection_errors_unit_tests_spec.rb on lines 17..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 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

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_page_spec.rb and 1 other location - About 1 hr to fix
spec/features/assignment_creation_spec.rb on lines 719..736

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

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

  describe '#action_allowed?' do
    context 'when the role of current user is Super-Admin' do
      # Checking for Super-Admin
      it 'allows certain action' do
        stub_current_user(super_admin, super_admin.role.name, super_admin.role)
Severity: Major
Found in spec/controllers/advice_controller_spec.rb and 2 other locations - About 1 hr to fix
spec/controllers/lock_controller_spec.rb on lines 10..26
spec/controllers/markup_styles_controller_spec.rb on lines 18..34

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

Severity
Category
Status
Source
Language