expertiza/expertiza

View on GitHub
spec/models/course_analytic_spec.rb

Summary

Maintainability
F
3 days
Test Coverage

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

describe CourseAnalytic do
  let(:course) { build(:course, id: 1, name: 'ECE517') }
  let(:participant) { build(:participant, user: build(:student, name: 'Jane', fullname: 'Doe, Jane', id: 1)) }
  let(:participant2) { build(:participant, user: build(:student, name: 'John', fullname: 'Doe, John', id: 2)) }
  let(:participant3) { build(:participant, can_review: false, user: build(:student, name: 'King', fullname: 'Titan, King', id: 3)) }
Severity: Minor
Found in spec/models/course_analytic_spec.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 course_analytic_spec.rb has 320 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class CourseAnalyticTestDummyClass
  attr_accessor :course, :participants, :assignments
  require 'analytic/course_analytic'
  include CourseAnalytic

Severity: Minor
Found in spec/models/course_analytic_spec.rb - About 3 hrs to fix

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

      describe '#assignment_review_counts' do
        context 'there have been no assignments added to a course' do
          it 'should return zero' do
            dc = CourseAnalyticTestDummyClass.new(course, [], [])
            expect(dc.assignment_review_counts).to eq([0])
    Severity: Major
    Found in spec/models/course_analytic_spec.rb and 4 other locations - About 1 hr to fix
    spec/models/course_analytic_spec.rb on lines 255..268
    spec/models/course_analytic_spec.rb on lines 272..285
    spec/models/course_analytic_spec.rb on lines 289..302
    spec/models/course_analytic_spec.rb on lines 306..319

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe '#assignment_average_scores' do
        context 'there have been no assignments added to a course' do
          it 'should return zero' do
            dc = CourseAnalyticTestDummyClass.new(course, [], [])
            expect(dc.assignment_average_scores).to eq([0])
    Severity: Major
    Found in spec/models/course_analytic_spec.rb and 4 other locations - About 1 hr to fix
    spec/models/course_analytic_spec.rb on lines 170..183
    spec/models/course_analytic_spec.rb on lines 255..268
    spec/models/course_analytic_spec.rb on lines 289..302
    spec/models/course_analytic_spec.rb on lines 306..319

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe '#assignment_min_scores' do
        context 'there have been no assignments added to a course' do
          it 'should return zero' do
            dc = CourseAnalyticTestDummyClass.new(course, [], [])
            expect(dc.assignment_min_scores).to eq([0])
    Severity: Major
    Found in spec/models/course_analytic_spec.rb and 4 other locations - About 1 hr to fix
    spec/models/course_analytic_spec.rb on lines 170..183
    spec/models/course_analytic_spec.rb on lines 255..268
    spec/models/course_analytic_spec.rb on lines 272..285
    spec/models/course_analytic_spec.rb on lines 289..302

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe '#assignment_max_scores' do
        context 'there have been no assignments added to a course' do
          it 'should return zero' do
            dc = CourseAnalyticTestDummyClass.new(course, [], [])
            expect(dc.assignment_max_scores).to eq([0])
    Severity: Major
    Found in spec/models/course_analytic_spec.rb and 4 other locations - About 1 hr to fix
    spec/models/course_analytic_spec.rb on lines 170..183
    spec/models/course_analytic_spec.rb on lines 255..268
    spec/models/course_analytic_spec.rb on lines 272..285
    spec/models/course_analytic_spec.rb on lines 306..319

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe '#assignment_team_count' do
        context 'there have been no assignments added to a course' do
          it 'should return zero' do
            dc = CourseAnalyticTestDummyClass.new(course, [], [])
            expect(dc.assignment_team_counts).to eq([0])
    Severity: Major
    Found in spec/models/course_analytic_spec.rb and 4 other locations - About 1 hr to fix
    spec/models/course_analytic_spec.rb on lines 170..183
    spec/models/course_analytic_spec.rb on lines 272..285
    spec/models/course_analytic_spec.rb on lines 289..302
    spec/models/course_analytic_spec.rb on lines 306..319

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

    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_teams' do
        context 'when there are no assignments' do
          it 'returns zero' do
            dc = CourseAnalyticTestDummyClass.new(course, [], [])
            expect(dc.average_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 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 '#max_num_assignment_teams' do
        context 'when there are no assignments' do
          it 'returns zero' do
            dc = CourseAnalyticTestDummyClass.new(course, [], [])
            expect(dc.max_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 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 '#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 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

    There are no issues that match your filters.

    Category
    Status