Showing 4,066 of 4,066 total issues

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

  scenario 'Creation date works differently in roots and in child comments, even when sorting by confidence_score' do
    old_root = create(:comment, commentable: legislation_question, created_at: Time.current - 10)
    new_root = create(:comment, commentable: legislation_question, created_at: Time.current)
    old_child = create(:comment, commentable: legislation_question, parent_id: new_root.id, created_at: Time.current - 10)
    new_child = create(:comment, commentable: legislation_question, parent_id: new_root.id, created_at: Time.current)
Severity: Major
Found in spec/features/comments/legislation_questions_spec.rb and 1 other location - About 3 hrs to fix
spec/features/comments/budget_investments_spec.rb on lines 106..125

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

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

  scenario 'Comment order' do
    c1 = create(:comment, :with_confidence_score, commentable: legislation_question, cached_votes_up: 100,
                                                  cached_votes_total: 120, created_at: Time.current - 2)
    c2 = create(:comment, :with_confidence_score, commentable: legislation_question, cached_votes_up: 10,
                                                  cached_votes_total: 12, created_at: Time.current - 1)
Severity: Major
Found in spec/features/comments/legislation_questions_spec.rb and 1 other location - About 3 hrs to fix
spec/features/comments/budget_investments_spec.rb on lines 82..103

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

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

  scenario 'Creation date works differently in roots and in child comments, when sorting by confidence_score' do
   old_root = create(:comment, commentable: investment, created_at: Time.current - 10)
   new_root = create(:comment, commentable: investment, created_at: Time.current)
   old_child = create(:comment, commentable: investment, parent_id: new_root.id, created_at: Time.current - 10)
   new_child = create(:comment, commentable: investment, parent_id: new_root.id, created_at: Time.current)
Severity: Major
Found in spec/features/comments/budget_investments_spec.rb and 1 other location - About 3 hrs to fix
spec/features/comments/legislation_questions_spec.rb on lines 107..126

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

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

  scenario 'Comment order' do
    c1 = create(:comment, :with_confidence_score, commentable: investment, cached_votes_up: 100,
                                                  cached_votes_total: 120, created_at: Time.current - 2)
    c2 = create(:comment, :with_confidence_score, commentable: investment, cached_votes_up: 10,
                                                  cached_votes_total: 12, created_at: Time.current - 1)
Severity: Major
Found in spec/features/comments/budget_investments_spec.rb and 1 other location - About 3 hrs to fix
spec/features/comments/legislation_questions_spec.rb on lines 83..104

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

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

  scenario 'Collapsable comments', :js do
    parent_comment = create(:comment, body: "Main comment", commentable: legislation_question)
    child_comment  = create(:comment, body: "First subcomment", commentable: legislation_question, parent: parent_comment)
    grandchild_comment = create(:comment, body: "Last subcomment", commentable: legislation_question, parent: child_comment)

Severity: Major
Found in spec/features/comments/legislation_questions_spec.rb and 1 other location - About 3 hrs to fix
spec/features/comments/budget_investments_spec.rb on lines 56..79

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

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

  scenario 'Collapsable comments', :js do
    parent_comment = create(:comment, body: "Main comment", commentable: investment)
    child_comment  = create(:comment, body: "First subcomment", commentable: investment, parent: parent_comment)
    grandchild_comment = create(:comment, body: "Last subcomment", commentable: investment, parent: child_comment)

Severity: Major
Found in spec/features/comments/budget_investments_spec.rb and 1 other location - About 3 hrs to fix
spec/features/comments/legislation_questions_spec.rb on lines 57..80

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

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

File users_auth_spec.rb has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rails_helper'

feature 'Users' do

  context 'Regular authentication' do
Severity: Minor
Found in spec/custom/features/users_auth_spec.rb - About 3 hrs to fix

    Function editorConfig has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    CKEDITOR.editorConfig = function( config )
    {
      config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
      config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
      config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
    Severity: Major
    Found in app/assets/javascripts/ckeditor/config.js - About 3 hrs to fix

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

        scenario 'Collapsable comments', :js do
          parent_comment = create(:comment, body: "Main comment", commentable: poll)
          child_comment  = create(:comment, body: "First subcomment", commentable: poll, parent: parent_comment)
          grandchild_comment = create(:comment, body: "Last subcomment", commentable: poll, parent: child_comment)
      
      
      Severity: Major
      Found in spec/features/comments/polls_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/debates_spec.rb on lines 42..65
      spec/features/comments/proposals_spec.rb on lines 41..64

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

      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

        scenario 'Collapsable comments', :js do
          parent_comment = create(:comment, body: "Main comment", commentable: debate)
          child_comment  = create(:comment, body: "First subcomment", commentable: debate, parent: parent_comment)
          grandchild_comment = create(:comment, body: "Last subcomment", commentable: debate, parent: child_comment)
      
      
      Severity: Major
      Found in spec/features/comments/debates_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/polls_spec.rb on lines 43..66
      spec/features/comments/proposals_spec.rb on lines 41..64

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

      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

        scenario 'Collapsable comments', :js do
          parent_comment = create(:comment, body: "Main comment", commentable: proposal)
          child_comment  = create(:comment, body: "First subcomment", commentable: proposal, parent: parent_comment)
          grandchild_comment = create(:comment, body: "Last subcomment", commentable: proposal, parent: child_comment)
      
      
      Severity: Major
      Found in spec/features/comments/proposals_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/debates_spec.rb on lines 42..65
      spec/features/comments/polls_spec.rb on lines 43..66

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

      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

        scenario 'Comment order' do
          c1 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 100,
                                                        cached_votes_total: 120, created_at: Time.current - 2)
          c2 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 10,
                                                        cached_votes_total: 12, created_at: Time.current - 1)
      Severity: Major
      Found in spec/features/comments/debates_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/polls_spec.rb on lines 69..90
      spec/features/comments/proposals_spec.rb on lines 67..88

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 110.

      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

        scenario 'Comment order' do
          c1 = create(:comment, :with_confidence_score, commentable: poll, cached_votes_up: 100,
                                                        cached_votes_total: 120, created_at: Time.current - 2)
          c2 = create(:comment, :with_confidence_score, commentable: poll, cached_votes_up: 10,
                                                        cached_votes_total: 12, created_at: Time.current - 1)
      Severity: Major
      Found in spec/features/comments/polls_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/debates_spec.rb on lines 68..89
      spec/features/comments/proposals_spec.rb on lines 67..88

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 110.

      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

        scenario 'Creation date works differently in roots and in child comments, even when sorting by confidence_score' do
          old_root = create(:comment, commentable: debate, created_at: Time.current - 10)
          new_root = create(:comment, commentable: debate, created_at: Time.current)
          old_child = create(:comment, commentable: debate, parent_id: new_root.id, created_at: Time.current - 10)
          new_child = create(:comment, commentable: debate, parent_id: new_root.id, created_at: Time.current)
      Severity: Major
      Found in spec/features/comments/debates_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/polls_spec.rb on lines 93..112
      spec/features/comments/proposals_spec.rb on lines 91..110

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

      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

        scenario 'Creation date works differently in roots and in child comments, when sorting by confidence_score' do
         old_root = create(:comment, commentable: poll, created_at: Time.current - 10)
         new_root = create(:comment, commentable: poll, created_at: Time.current)
         old_child = create(:comment, commentable: poll, parent_id: new_root.id, created_at: Time.current - 10)
         new_child = create(:comment, commentable: poll, parent_id: new_root.id, created_at: Time.current)
      Severity: Major
      Found in spec/features/comments/polls_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/debates_spec.rb on lines 92..111
      spec/features/comments/proposals_spec.rb on lines 91..110

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

      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

        scenario 'Creation date works differently in roots and in child comments, when sorting by confidence_score' do
         old_root = create(:comment, commentable: proposal, created_at: Time.current - 10)
         new_root = create(:comment, commentable: proposal, created_at: Time.current)
         old_child = create(:comment, commentable: proposal, parent_id: new_root.id, created_at: Time.current - 10)
         new_child = create(:comment, commentable: proposal, parent_id: new_root.id, created_at: Time.current)
      Severity: Major
      Found in spec/features/comments/proposals_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/debates_spec.rb on lines 92..111
      spec/features/comments/polls_spec.rb on lines 93..112

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

      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

        scenario 'Comment order' do
          c1 = create(:comment, :with_confidence_score, commentable: proposal, cached_votes_up: 100,
                                                        cached_votes_total: 120, created_at: Time.current - 2)
          c2 = create(:comment, :with_confidence_score, commentable: proposal, cached_votes_up: 10,
                                                        cached_votes_total: 12, created_at: Time.current - 1)
      Severity: Major
      Found in spec/features/comments/proposals_spec.rb and 2 other locations - About 3 hrs to fix
      spec/features/comments/debates_spec.rb on lines 68..89
      spec/features/comments/polls_spec.rb on lines 69..90

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

      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

          scenario "Reorder results maintaing search", :js do
            proposal1 = create(:proposal, title: "Show you got",      cached_votes_up: 10,  created_at: 1.week.ago)
            proposal2 = create(:proposal, title: "Show what you got", cached_votes_up: 1,   created_at: 1.month.ago)
            proposal3 = create(:proposal, title: "Show you got",      cached_votes_up: 100, created_at: Time.current)
            proposal4 = create(:proposal, title: "Do not display",    cached_votes_up: 1,   created_at: 1.week.ago)
      Severity: Major
      Found in spec/features/proposals_spec.rb and 1 other location - About 3 hrs to fix
      spec/features/debates_spec.rb on lines 921..937

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

      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

          scenario "Reorder results maintaing search", :js do
            debate1 = create(:debate, title: "Show you got",      cached_votes_up: 10,  created_at: 1.week.ago)
            debate2 = create(:debate, title: "Show what you got", cached_votes_up: 1,   created_at: 1.month.ago)
            debate3 = create(:debate, title: "Show you got",      cached_votes_up: 100, created_at: Time.current)
            debate4 = create(:debate, title: "Do not display",    cached_votes_up: 1,   created_at: 1.week.ago)
      Severity: Major
      Found in spec/features/debates_spec.rb and 1 other location - About 3 hrs to fix
      spec/features/proposals_spec.rb on lines 1375..1391

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

      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

      Method initialize has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def initialize(user)
            merge Abilities::Everyone.new(user)
      
            can [:read, :update], User, id: user.id
      
      
      Severity: Major
      Found in app/models/custom/abilities/common.rb - About 2 hrs to fix
        Severity
        Category
        Status
        Source
        Language