AyuntamientoMadrid/participacion

View on GitHub

Showing 2,528 of 2,528 total issues

File translatable_spec.rb has 384 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "rails_helper"

describe "Admin edit translatable records", :admin do
  before do
    translatable.main_link_url = "https://consuldemocracy.org" if translatable.is_a?(Budget::Phase)
Severity: Minor
Found in spec/system/admin/translatable_spec.rb - About 5 hrs to fix

    Class Budget has 39 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Budget < ApplicationRecord
      include Measurable
      include Sluggable
      include StatsVersionable
      include Reportable
    Severity: Minor
    Found in app/models/budget.rb - About 5 hrs to fix

      File user.rb has 378 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class User < ApplicationRecord
        include Verification
        attribute :registering_from_web, default: false
      
        devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable,
      Severity: Minor
      Found in app/models/user.rb - About 5 hrs to fix

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

            scenario "Filtering by minimum number of votes" do
              group_1 = create(:budget_group, budget: budget)
              group_2 = create(:budget_group, budget: budget)
              parks   = create(:budget_heading, group: group_1)
              roads   = create(:budget_heading, group: group_2)
        Severity: Major
        Found in spec/system/admin/budget_investments_spec.rb and 1 other location - About 4 hrs to fix
        spec/system/admin/budget_investments_spec.rb on lines 582..615

        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

            scenario "Filtering by maximum number of votes" do
              group_1 = create(:budget_group, budget: budget)
              group_2 = create(:budget_group, budget: budget)
              parks   = create(:budget_heading, group: group_1)
              roads   = create(:budget_heading, group: group_2)
        Severity: Major
        Found in spec/system/admin/budget_investments_spec.rb and 1 other location - About 4 hrs to fix
        spec/system/admin/budget_investments_spec.rb on lines 546..579

        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

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

        require "rails_helper"
        
        describe "Admin budgets", :admin do
          it_behaves_like "nested imageable",
                          "budget",
        Severity: Minor
        Found in spec/system/admin/budgets_spec.rb - About 4 hrs to fix

          File relations_spec.rb has 367 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require "rails_helper"
          
          describe "SDG Relations" do
            before do
              login_as(create(:administrator).user)
          Severity: Minor
          Found in spec/system/sdg_management/relations_spec.rb - About 4 hrs to fix

            Class Poll has 36 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Poll < ApplicationRecord
              require_dependency "poll/answer"
            
              include Imageable
              acts_as_paranoid column: :hidden_at
            Severity: Minor
            Found in app/models/poll.rb - About 4 hrs to fix

              File users_spec.rb has 361 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require "rails_helper"
              
              describe "Users" do
                describe "Show (public page)" do
                  let(:user) { create(:user) }
              Severity: Minor
              Found in spec/system/users_spec.rb - About 4 hrs to fix

                File tenant_spec.rb has 359 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require "rails_helper"
                require "active_storage/service/disk_service"
                
                describe Tenant do
                  describe ".resolve_host" do
                Severity: Minor
                Found in spec/models/tenant_spec.rb - About 4 hrs to fix

                  Class Proposal has 35 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Proposal < ApplicationRecord
                    include Flaggable
                    include Taggable
                    include Conflictable
                    include Measurable
                  Severity: Minor
                  Found in app/models/proposal.rb - About 4 hrs to fix

                    Method defaults has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def defaults
                          {
                            "feature.featured_proposals": nil,
                            "feature.facebook_login": true,
                            "feature.google_login": true,
                    Severity: Major
                    Found in app/models/setting.rb - About 4 hrs to fix

                      File draft_versions_spec.rb has 350 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require "rails_helper"
                      
                      describe "Legislation Draft Versions" do
                        let(:user) { create(:user) }
                        let(:administrator) do
                      Severity: Minor
                      Found in spec/system/legislation/draft_versions_spec.rb - About 4 hrs to fix

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

                        require "rails_helper"
                        
                        describe "Budgets" do
                          let(:budget)             { create(:budget) }
                          let(:level_two_user)     { create(:user, :level_two) }
                        Severity: Minor
                        Found in spec/system/budgets/budgets_spec.rb - About 4 hrs to fix

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

                              context "Debates" do
                                let(:debate)             { create(:debate) }
                                let(:remote_translation) do
                                  create(:remote_translation, remote_translatable: debate, locale: :es)
                                end
                          Severity: Major
                          Found in spec/lib/remote_translations/caller_spec.rb and 1 other location - About 4 hrs to fix
                          spec/lib/remote_translations/caller_spec.rb on lines 113..157

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

                          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 "Budget Investments" do
                                let(:budget_investment)  { create(:budget_investment) }
                                let(:remote_translation) do
                                  create(:remote_translation, remote_translatable: budget_investment, locale: :es)
                                end
                          Severity: Major
                          Found in spec/lib/remote_translations/caller_spec.rb and 1 other location - About 4 hrs to fix
                          spec/lib/remote_translations/caller_spec.rb on lines 15..59

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

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

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

                              def initialize(user)
                                merge Abilities::Moderation.new(user)
                                merge Abilities::SDG::Manager.new(user)
                          
                                can :restore, Comment
                          Severity: Major
                          Found in app/models/abilities/administrator.rb - About 4 hrs to fix

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

                                it "does not delete other machine learning generated data" do
                                  create(:related_content, :proposals, :from_machine_learning)
                                  create(:related_content, :budget_investments, :from_machine_learning)
                            
                                  create(:tagging, tag: create(:tag))
                            Severity: Major
                            Found in spec/models/machine_learning_spec.rb and 1 other location - About 4 hrs to fix
                            spec/models/machine_learning_spec.rb on lines 221..244

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

                            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

                                it "does not delete other machine learning generated data" do
                                  create(:related_content, :proposals, :from_machine_learning)
                                  create(:related_content, :budget_investments, :from_machine_learning)
                            
                                  create(:tagging, tag: create(:tag))
                            Severity: Major
                            Found in spec/models/machine_learning_spec.rb and 1 other location - About 4 hrs to fix
                            spec/models/machine_learning_spec.rb on lines 263..286

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

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

                            require "rails_helper"
                            
                            describe "Legislation" do
                              let!(:administrator) { create(:administrator).user }
                            
                            
                            Severity: Minor
                            Found in spec/system/legislation/processes_spec.rb - About 4 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language