expertiza/expertiza

View on GitHub

Showing 531 of 4,497 total issues

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

  def number_of_comments_greater_than_10_words
    @list_of_reviews.each do |review|
      answers = Answer.where(response_id: review.response_id)
      answers.each do |answer|
        @list_of_rows.each do |row|
Severity: Major
Found in app/models/vm_question_response.rb and 1 other location - About 1 hr to fix
app/models/vm_question_response.rb on lines 185..192

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

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 'checks if create method can be called by the user' do
        allow(AssignmentTeam).to receive(:find_by).and_return(team1)
        allow(team1).to receive(:update_attributes).with(any_args).and_return(true)
        allow(AssignmentTeam).to receive_message_chain(:find_by, :assignment).and_return(assignment1)
        allow(AssignmentParticipant).to receive(:find_by).with(any_args).and_return(participant)
Severity: Major
Found in spec/controllers/advertise_for_partner_controller_spec.rb and 1 other location - About 1 hr to fix
spec/controllers/advertise_for_partner_controller_spec.rb on lines 35..44

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

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 'check if update method can be called by the user' do
        allow(AssignmentTeam).to receive(:find_by).and_return(team1)
        allow(team1).to receive(:update_attributes).with(any_args).and_return(true)
        allow(AssignmentTeam).to receive_message_chain(:find_by, :assignment).and_return(assignment1)
        allow(AssignmentParticipant).to receive(:find_by).with(any_args).and_return(participant)
Severity: Major
Found in spec/controllers/advertise_for_partner_controller_spec.rb and 1 other location - About 1 hr to fix
spec/controllers/advertise_for_partner_controller_spec.rb on lines 24..33

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

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

  describe '#update' do
    context 'when the role is updated successfully' do
      it 'redirects to show' do
        allow(Role).to receive(:find).and_return(student_role)
        allow(student_role).to receive(:update_with_params).and_return(true)
Severity: Major
Found in spec/controllers/roles_controller_spec.rb and 1 other location - About 1 hr to fix
spec/controllers/roles_controller_spec.rb on lines 54..68

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

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

  def number_of_comments_greater_than_20_words
    @list_of_reviews.each do |review|
      answers = Answer.where(response_id: review.response_id)
      answers.each do |answer|
        @list_of_rows.each do |row|
Severity: Major
Found in app/models/vm_question_response.rb and 1 other location - About 1 hr to fix
app/models/vm_question_response.rb on lines 172..179

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

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

  describe '#create' do
    context 'when the role is saved successfully' do
      it 'redirects to list' do
        allow(Role).to receive(:new).and_return(student_role)
        allow(student_role).to receive(:save).and_return(true)
Severity: Major
Found in spec/controllers/roles_controller_spec.rb and 1 other location - About 1 hr to fix
spec/controllers/roles_controller_spec.rb on lines 80..94

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

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_character_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.max_character_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_question_score' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.max_question_score).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 265..278

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

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 'redirects to back and flashes error as there are no participants' do
        allow(course).to receive(:assignments).and_return([assignment])
        allow(assignment).to receive(:reject).and_return(assignment)
        allow(course).to receive(:get_participants).and_return([]) # no participants
        request_params = { course_id: 1 }
Severity: Major
Found in spec/controllers/assessment360_controller_spec.rb and 1 other location - About 1 hr to fix
spec/controllers/assessment360_controller_spec.rb on lines 194..203

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

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_character_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.total_character_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_word_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.min_word_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_character_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.average_character_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_score' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.average_score).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_word_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.max_word_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_question_score' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.min_question_score).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261

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

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 'redirects to back and flashes error as there are no participants' do
        allow(course).to receive(:assignments).and_return([assignment])
        allow(assignment).to receive(:reject).and_return(assignment)
        allow(course).to receive(:get_participants).and_return([]) # no participants
        request_params = { course_id: 1 }
Severity: Major
Found in spec/controllers/assessment360_controller_spec.rb and 1 other location - About 1 hr to fix
spec/controllers/assessment360_controller_spec.rb on lines 326..335

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

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_character_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.min_character_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_word_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.total_word_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 180..193
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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_word_count' do
    context 'there are no answers associated with the response' do
      it 'will return 0' do
        dc = ResponseAnalyticTestDummyClass.new([])
        expect(dc.average_word_count).to eq(0)
Severity: Major
Found in spec/models/response_analytic_spec.rb and 10 other locations - About 1 hr to fix
spec/models/response_analytic_spec.rb on lines 95..108
spec/models/response_analytic_spec.rb on lines 112..125
spec/models/response_analytic_spec.rb on lines 129..142
spec/models/response_analytic_spec.rb on lines 146..159
spec/models/response_analytic_spec.rb on lines 163..176
spec/models/response_analytic_spec.rb on lines 197..210
spec/models/response_analytic_spec.rb on lines 214..227
spec/models/response_analytic_spec.rb on lines 231..244
spec/models/response_analytic_spec.rb on lines 248..261
spec/models/response_analytic_spec.rb on lines 265..278

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

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

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

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

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

Refactorings

Further Reading

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

  describe '#staggered_deadline' do
    context 'when current assignment.staggered_deadlines is nil' do
      it 'sets staggered_deadline attribute of current assignment to false' do
        assignment.staggered_deadline = nil
        expect(assignment_form.staggered_deadline).to be false
Severity: Major
Found in spec/models/assignment_form_spec.rb and 3 other locations - About 1 hr to fix
spec/models/assignment_form_spec.rb on lines 727..740
spec/models/assignment_form_spec.rb on lines 745..758
spec/models/assignment_form_spec.rb on lines 763..776

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

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