consul/consul

View on GitHub

Showing 2,534 of 2,534 total issues

File budget_investments_spec.rb has 1432 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "rails_helper"

describe "Admin budget investments", :admin do
  let(:budget) { create(:budget) }
  let(:administrator) do
Severity: Major
Found in spec/system/admin/budget_investments_spec.rb - About 3 days to fix

    File investments_spec.rb has 1351 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "rails_helper"
    require "sessions_helper"
    
    describe "Budget Investments" do
      let(:author)  { create(:user, :level_two, username: "Isabel") }
    Severity: Major
    Found in spec/system/budgets/investments_spec.rb - About 3 days to fix

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

      require "rails_helper"
      
      describe "Proposals" do
        it_behaves_like "milestoneable", :proposal
      
      
      Severity: Major
      Found in spec/system/proposals_spec.rb - About 3 days to fix

        File investment_spec.rb has 1084 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

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

            describe "/moderation/ screen" do
              before do
                moderator = create(:moderator)
                login_as(moderator.user)
              end
          Severity: Major
          Found in spec/system/moderation/debates_spec.rb and 1 other location - About 2 days to fix
          spec/system/moderation/comments_spec.rb on lines 65..240

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

          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 "/moderation/ screen" do
              before do
                moderator = create(:moderator)
                login_as(moderator.user)
              end
          Severity: Major
          Found in spec/system/moderation/comments_spec.rb and 1 other location - About 2 days to fix
          spec/system/moderation/debates_spec.rb on lines 38..209

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

          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 "Debate index order filters" do
              scenario "Default order is hot_score" do
                best_debate = create(:debate, title: "Best")
                best_debate.update_column(:hot_score, 10)
                worst_debate = create(:debate, title: "Worst")
          Severity: Major
          Found in spec/system/debates_spec.rb and 1 other location - About 2 days to fix
          spec/system/proposals_spec.rb on lines 788..942

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

          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 "Proposal index order filters" do
              scenario "Default order is hot_score" do
                best_proposal = create(:proposal, title: "Best proposal")
                best_proposal.update_column(:hot_score, 10)
                worst_proposal = create(:proposal, title: "Worst proposal")
          Severity: Major
          Found in spec/system/proposals_spec.rb and 1 other location - About 2 days to fix
          spec/system/debates_spec.rb on lines 377..533

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

          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 817 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

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

            require "rails_helper"
            
            describe User do
              describe "#headings_voted_within_group" do
                it "returns the headings voted by a user" do
            Severity: Major
            Found in spec/models/user_spec.rb - About 1 day to fix

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

                describe "#hot_score" do
                  let(:now) { Time.current }
              
                  it "period is correctly calculated to get exact votes per day" do
                    new_proposal = create(:legislation_proposal, created_at: 23.hours.ago)
              Severity: Major
              Found in spec/models/legislation/proposal_spec.rb and 1 other location - About 1 day to fix
              spec/models/proposal_spec.rb on lines 278..351

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

              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 "#hot_score" do
                  let(:now) { Time.current }
              
                  it "period is correctly calculated to get exact votes per day" do
                    new_proposal = create(:proposal, created_at: 23.hours.ago)
              Severity: Major
              Found in spec/models/proposal_spec.rb and 1 other location - About 1 day to fix
              spec/models/legislation/proposal_spec.rb on lines 30..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 353.

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

              require "rails_helper"
              
              describe "Debates" do
                context "Concerns" do
                  it_behaves_like "notifiable in-app", :debate
              Severity: Major
              Found in spec/system/debates_spec.rb - About 1 day to fix

                Class MenuComponent has 70 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class Admin::MenuComponent < ApplicationComponent
                  include LinkListHelper
                  use_helpers :can?
                
                  def links
                Severity: Major
                Found in app/components/admin/menu_component.rb - About 1 day to fix

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

                    require "rails_helper"
                    
                    describe "Users" do
                      context "Regular authentication" do
                        context "Sign up" do
                    Severity: Major
                    Found in spec/system/users_auth_spec.rb - About 1 day to fix

                      File comments_spec.rb has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require "rails_helper"
                      
                      describe "Comments" do
                        factories = [
                          :budget_investment,
                      Severity: Major
                      Found in spec/system/comments_spec.rb - About 1 day to fix

                        File ballots_spec.rb has 530 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require "rails_helper"
                        require "sessions_helper"
                        
                        describe "Ballots" do
                          let(:user)        { create(:user, :level_two) }
                        Severity: Major
                        Found in spec/system/budgets/ballots_spec.rb - About 1 day to fix

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

                            describe "#cleanup_proposals_tags!" do
                              it "does not delete other machine learning generated data" do
                                create(:ml_summary_comment, commentable: create(:proposal))
                                create(:ml_summary_comment, commentable: create(:budget_investment))
                          
                          
                          Severity: Major
                          Found in spec/models/machine_learning_spec.rb and 1 other location - About 7 hrs to fix
                          spec/models/machine_learning_spec.rb on lines 66..118

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

                          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 "#cleanup_investments_tags!" do
                              it "does not delete other machine learning generated data" do
                                create(:ml_summary_comment, commentable: create(:proposal))
                                create(:ml_summary_comment, commentable: create(:budget_investment))
                          
                          
                          Severity: Major
                          Found in spec/models/machine_learning_spec.rb and 1 other location - About 7 hrs to fix
                          spec/models/machine_learning_spec.rb on lines 10..62

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

                          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