AyuntamientoMadrid/participacion

View on GitHub

Showing 1,876 of 1,876 total issues

File budget_investments_spec.rb has 1425 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 1316 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 1264 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 1010 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/comments_spec.rb and 1 other location - About 2 days to fix
          spec/system/moderation/debates_spec.rb on lines 38..203

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 544.

          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/debates_spec.rb and 1 other location - About 2 days to fix
          spec/system/moderation/comments_spec.rb on lines 65..234

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

          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 759..913

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

          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 375..531

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

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

          require "rails_helper"
          
          describe "Commenting topics from proposals" do
            let(:user)     { create :user }
            let(:proposal) { create :proposal }
          Severity: Major
          Found in spec/system/comments/topics_spec.rb - About 1 day to fix

            File proposal_spec.rb has 814 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 661 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 276..349

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

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

                    require "rails_helper"
                    
                    describe "Commenting legislation questions" do
                      let(:user) { create :user }
                      let(:legislation_annotation) { create :legislation_annotation, author: user }
                    Severity: Major
                    Found in spec/system/comments/legislation_annotations_spec.rb - About 1 day to fix

                      File users_auth_spec.rb has 514 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 ballots_spec.rb has 509 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