Showing 4,066 of 4,066 total issues

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

  feature "Moderators" do

    scenario "can create comment as a moderator", :js do
      skip "Feature not implemented yet, review soon"

Severity: Major
Found in spec/features/comments/polls_spec.rb and 1 other location - About 5 hrs to fix
spec/features/comments/polls_spec.rb on lines 373..431

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

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

  feature "Moderators" do
    scenario "can create comment as a moderator", :js do
      moderator = create(:moderator)

      login_as(moderator.user)
Severity: Major
Found in spec/features/comments/budget_investments_spec.rb and 3 other locations - About 5 hrs to fix
spec/features/comments/budget_investments_spec.rb on lines 373..425
spec/features/comments/legislation_questions_spec.rb on lines 346..398
spec/features/comments/legislation_questions_spec.rb on lines 402..454

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

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

require 'rails_helper'

feature 'Users' do

  before do
Severity: Minor
Found in spec/features/users_spec.rb - About 5 hrs to fix

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

      feature "Moderators" do
        scenario "can create comment as a moderator", :js do
          moderator = create(:moderator)
    
          login_as(moderator.user)
    Severity: Major
    Found in spec/features/comments/proposals_spec.rb and 3 other locations - About 5 hrs to fix
    spec/features/comments/debates_spec.rb on lines 315..367
    spec/features/comments/debates_spec.rb on lines 371..423
    spec/features/comments/proposals_spec.rb on lines 358..410

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

    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

      feature "Moderators" do
        scenario "can create comment as a moderator", :js do
          moderator = create(:moderator)
    
          login_as(moderator.user)
    Severity: Major
    Found in spec/features/comments/debates_spec.rb and 3 other locations - About 5 hrs to fix
    spec/features/comments/debates_spec.rb on lines 371..423
    spec/features/comments/proposals_spec.rb on lines 302..354
    spec/features/comments/proposals_spec.rb on lines 358..410

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

    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

      feature "Administrators" do
        scenario "can create comment as an administrator", :js do
          admin = create(:administrator)
    
          login_as(admin.user)
    Severity: Major
    Found in spec/features/comments/debates_spec.rb and 3 other locations - About 5 hrs to fix
    spec/features/comments/debates_spec.rb on lines 315..367
    spec/features/comments/proposals_spec.rb on lines 302..354
    spec/features/comments/proposals_spec.rb on lines 358..410

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

    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

      feature "Administrators" do
        scenario "can create comment as an administrator", :js do
          admin = create(:administrator)
    
          login_as(admin.user)
    Severity: Major
    Found in spec/features/comments/proposals_spec.rb and 3 other locations - About 5 hrs to fix
    spec/features/comments/debates_spec.rb on lines 315..367
    spec/features/comments/debates_spec.rb on lines 371..423
    spec/features/comments/proposals_spec.rb on lines 302..354

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

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

    require 'rails_helper'
    include ActionView::Helpers::DateHelper
    
    feature 'Commenting Budget::Investments' do
    
    
    Severity: Minor
    Found in spec/features/comments/budget_investments_spec.rb - About 5 hrs to fix

      File debates_spec.rb has 385 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'rails_helper'
      include ActionView::Helpers::DateHelper
      
      feature 'Commenting debates' do
        let(:user)   { create :user }
      Severity: Minor
      Found in spec/features/comments/debates_spec.rb - About 5 hrs to fix

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

          context "Filter" do
        
            context "By geozone" do
        
              background do
        Severity: Major
        Found in spec/features/proposals_spec.rb and 1 other location - About 5 hrs to fix
        spec/features/debates_spec.rb on lines 1011..1067

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

        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

          context "Filter" do
        
            context "By geozone" do
        
              background do
        Severity: Major
        Found in spec/features/debates_spec.rb and 1 other location - About 5 hrs to fix
        spec/features/proposals_spec.rb on lines 1584..1640

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

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

        require 'rails_helper'
        include ActionView::Helpers::DateHelper
        
        feature 'Commenting polls' do
          let(:user) { create :user }
        Severity: Minor
        Found in spec/features/comments/polls_spec.rb - About 5 hrs to fix

          File budgets_spec.rb has 376 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'rails_helper'
          
          feature 'Budgets' do
          
            let(:budget)             { create(:budget) }
          Severity: Minor
          Found in spec/features/budgets/budgets_spec.rb - About 5 hrs to fix

            File proposals_spec.rb has 374 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'rails_helper'
            include ActionView::Helpers::DateHelper
            
            feature 'Commenting proposals' do
              let(:user) { create :user }
            Severity: Minor
            Found in spec/features/comments/proposals_spec.rb - About 5 hrs to fix

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

                describe "cache" do
                  let(:proposal) { create(:proposal) }
              
                  it "expires cache when it has a new comment" do
                    expect { create(:comment, commentable: proposal) }
              Severity: Major
              Found in spec/models/proposal_spec.rb and 1 other location - About 4 hrs to fix
              spec/models/debate_spec.rb on lines 334..380

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

              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 "cache" do
                  let(:debate) { create(:debate) }
              
                  it "expires cache when it has a new comment" do
                    expect { create(:comment, commentable: debate) }
              Severity: Major
              Found in spec/models/debate_spec.rb and 1 other location - About 4 hrs to fix
              spec/models/proposal_spec.rb on lines 349..395

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

              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

                describe "phase" do
                  it "is validated" do
                    Budget::Phase::PHASE_KINDS.each do |phase|
                      budget.phase = phase
                      expect(budget).to be_valid
              Severity: Major
              Found in spec/custom/models/budget_spec.rb and 1 other location - About 4 hrs to fix
              spec/models/budget_spec.rb on lines 51..117

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

              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

                describe "phase" do
                  it "is validated" do
                    Budget::Phase::PHASE_KINDS.each do |phase|
                      budget.phase = phase
                      expect(budget).to be_valid
              Severity: Major
              Found in spec/models/budget_spec.rb and 1 other location - About 4 hrs to fix
              spec/custom/models/budget_spec.rb on lines 51..117

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

              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

                context 'Search' do
              
                  background do
                    user  = create(:user, username: 'Elizabeth Bathory', email: 'elizabeth@bathory.com')
                    user2 = create(:user, username: 'Ada Lovelace', email: 'ada@lovelace.com')
              Severity: Major
              Found in spec/features/admin/moderators_spec.rb and 3 other locations - About 4 hrs to fix
              spec/features/admin/administrators_spec.rb on lines 45..89
              spec/features/admin/managers_spec.rb on lines 37..81
              spec/features/admin/valuators_spec.rb on lines 58..102

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

              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

                context 'Search' do
              
                  background do
                    user  = create(:user, username: 'David Foster Wallace', email: 'david@wallace.com')
                    user2 = create(:user, username: 'Steven Erikson', email: 'steven@erikson.com')
              Severity: Major
              Found in spec/features/admin/valuators_spec.rb and 3 other locations - About 4 hrs to fix
              spec/features/admin/administrators_spec.rb on lines 45..89
              spec/features/admin/managers_spec.rb on lines 37..81
              spec/features/admin/moderators_spec.rb on lines 37..81

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

              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