Showing 4,066 of 4,066 total issues

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

feature 'Admin shifts' do

  background do
    admin = create(:administrator)
    login_as(admin.user)
Severity: Major
Found in spec/custom/features/admin/poll/shifts_spec.rb and 1 other location - About 2 days to fix
spec/features/admin/poll/shifts_spec.rb on lines 3..189

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

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

require 'rails_helper'

feature 'Admin budget investments' do

  let(:budget) { create(:budget) }
Severity: Major
Found in spec/features/admin/budget_investments_spec.rb - About 2 days to fix

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

    require 'rails_helper'
    
    feature 'Debates' do
    
      before do
    Severity: Major
    Found in spec/features/debates_spec.rb - About 2 days to fix

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

        feature '/moderation/ screen' do
      
          background do
            moderator = create(:moderator)
            login_as(moderator.user)
      Severity: Major
      Found in spec/features/moderation/debates_spec.rb and 2 other locations - About 2 days to fix
      spec/features/moderation/comments_spec.rb on lines 66..217
      spec/features/moderation/proposals_spec.rb on lines 48..199

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

      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

        feature '/moderation/ screen' do
      
          background do
            moderator = create(:moderator)
            login_as(moderator.user)
      Severity: Major
      Found in spec/features/moderation/comments_spec.rb and 2 other locations - About 2 days to fix
      spec/features/moderation/debates_spec.rb on lines 49..200
      spec/features/moderation/proposals_spec.rb on lines 48..199

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

      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

        feature '/moderation/ screen' do
      
          background do
            moderator = create(:moderator)
            login_as(moderator.user)
      Severity: Major
      Found in spec/features/moderation/proposals_spec.rb and 2 other locations - About 2 days to fix
      spec/features/moderation/comments_spec.rb on lines 66..217
      spec/features/moderation/debates_spec.rb on lines 49..200

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

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

      require 'rails_helper'
      
      describe Budget::Investment do
        let(:investment) { build(:budget_investment) }
      
      
      Severity: Major
      Found in spec/models/budget/investment_spec.rb - About 2 days to fix

        File topics_spec.rb has 838 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'rails_helper'
        include ActionView::Helpers::DateHelper
        
        feature 'Commenting topics from proposals' do
          let(:user)     { create :user }
        Severity: Major
        Found in spec/features/comments/topics_spec.rb - About 2 days to fix

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

          describe Legislation::Process do
            let(:process) { create(:legislation_process) }
          
            it "is valid" do
              expect(process).to be_valid
          Severity: Major
          Found in spec/custom/models/legislation/process_spec.rb and 1 other location - About 1 day to fix
          spec/models/legislation/process_spec.rb on lines 3..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 466.

          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 Legislation::Process do
            let(:process) { create(:legislation_process) }
          
            it "is valid" do
              expect(process).to be_valid
          Severity: Major
          Found in spec/models/legislation/process_spec.rb and 1 other location - About 1 day to fix
          spec/custom/models/legislation/process_spec.rb on lines 3..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 466.

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

          require 'rails_helper'
          
          describe Proposal do
            let(:proposal) { build(:proposal) }
          
          
          Severity: Major
          Found in spec/models/proposal_spec.rb - About 1 day to fix

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

                  context "Search by author type" do
            
                    xscenario "Public employee", :js do
                      ana = create :user, official_level: 1
                      john = create :user, official_level: 2
            Severity: Major
            Found in spec/features/proposals_spec.rb and 1 other location - About 1 day to fix
            spec/features/debates_spec.rb on lines 593..706

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

            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 "Search by author type" do
            
                    xscenario "Public employee", :js do
                      ana = create :user, official_level: 1
                      john = create :user, official_level: 2
            Severity: Major
            Found in spec/features/debates_spec.rb and 1 other location - About 1 day to fix
            spec/features/proposals_spec.rb on lines 1042..1155

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

            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 'Recommendations' do
            
                  let!(:best_debate)   { create(:debate, title: 'Best',   cached_votes_total: 10, tag_list: 'Sport') }
                  let!(:medium_debate) { create(:debate, title: 'Medium', cached_votes_total: 5,  tag_list: 'Sport') }
                  let!(:worst_debate)  { create(:debate, title: 'Worst',  cached_votes_total: 1,  tag_list: 'Sport') }
            Severity: Major
            Found in spec/features/debates_spec.rb and 1 other location - About 1 day to fix
            spec/features/proposals_spec.rb on lines 735..854

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

            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 'Recommendations' do
            
                  let!(:best_proposal)   { create(:proposal, title: 'Best',   cached_votes_up: 10, tag_list: 'Sport') }
                  let!(:medium_proposal) { create(:proposal, title: 'Medium', cached_votes_up: 5,  tag_list: 'Sport') }
                  let!(:worst_proposal)  { create(:proposal, title: 'Worst',  cached_votes_up: 1,  tag_list: 'Sport') }
            Severity: Major
            Found in spec/features/proposals_spec.rb and 1 other location - About 1 day to fix
            spec/features/debates_spec.rb on lines 408..527

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

            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 "reorder" do
            
                  it "is able to reorder by hot_score after searching" do
                    lowest_score  = create(:proposal,  title: 'stop corruption', cached_votes_up: 1)
                    highest_score = create(:proposal,  title: 'stop corruption', cached_votes_up: 2)
            Severity: Major
            Found in spec/models/proposal_spec.rb and 1 other location - About 1 day to fix
            spec/models/debate_spec.rb on lines 575..654

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

            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 "reorder" do
            
                  it "is able to reorder by hot_score after searching" do
                    lowest_score  = create(:debate,  title: 'stop corruption', cached_votes_up: 1)
                    highest_score = create(:debate,  title: 'stop corruption', cached_votes_up: 2)
            Severity: Major
            Found in spec/models/debate_spec.rb and 1 other location - About 1 day to fix
            spec/models/proposal_spec.rb on lines 589..668

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

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

            require 'rails_helper'
            
            describe Debate do
              let(:debate) { build(:debate) }
            
            
            Severity: Major
            Found in spec/models/debate_spec.rb - About 1 day to fix

              File legislation_annotations_spec.rb has 543 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'rails_helper'
              include ActionView::Helpers::DateHelper
              
              feature 'Commenting legislation questions' do
                let(:user) { create :user }
              Severity: Major
              Found in spec/features/comments/legislation_annotations_spec.rb - About 1 day to fix

                File user_spec.rb has 541 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'rails_helper'
                
                describe User do
                
                  describe "#debate_votes" do
                Severity: Major
                Found in spec/models/user_spec.rb - About 1 day to fix
                  Severity
                  Category
                  Status
                  Source
                  Language