AyuntamientoMadrid/participacion

View on GitHub

Showing 143 of 1,085 total issues

File machine_learning.rb has 412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class MachineLearning
  attr_reader :user, :script, :previous_modified_date
  attr_accessor :job

  SCRIPTS_FOLDER = Rails.root.join("public", "machine_learning", "scripts").freeze
Severity: Minor
Found in app/models/machine_learning.rb - About 5 hrs to fix

    File emails_spec.rb has 410 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "rails_helper"
    
    describe "Emails" do
      before do
        reset_mailer
    Severity: Minor
    Found in spec/system/emails_spec.rb - About 5 hrs to fix

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

      require "rails_helper"
      
      describe "Valuation budget investments" do
        let(:budget) { create(:budget, :valuating) }
        let(:valuator) do
      Severity: Minor
      Found in spec/system/valuation/budget_investments_spec.rb - About 5 hrs to fix

        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 Reportable
            include Imageable
          Severity: Minor
          Found in app/models/budget.rb - About 5 hrs to fix

            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

              Class Stats has 37 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class Budget::Stats
                include Statisticable
                alias_method :budget, :resource
              
                def self.stats_methods
              Severity: Minor
              Found in app/models/budget/stats.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

                  File tenant_spec.rb has 362 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

                    Method defaults has 113 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 users_spec.rb has 350 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

                        Method initialize has 110 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

                          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

                              Class Proposal has 34 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

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

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

                                  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

                                    File investment.rb has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    class Budget
                                      class Investment < ApplicationRecord
                                        SORTING_OPTIONS = { id: "id", supports: "cached_votes_up" }.freeze
                                    
                                        include Measurable
                                    Severity: Minor
                                    Found in app/models/budget/investment.rb - About 4 hrs to fix

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

                                          def initialize(user)
                                            merge Abilities::Everyone.new(user)
                                      
                                            can [:read, :update], User, id: user.id
                                      
                                      
                                      Severity: Major
                                      Found in app/models/abilities/common.rb - About 3 hrs to fix

                                        File stats_spec.rb has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        require "rails_helper"
                                        
                                        describe "Stats", :admin do
                                          context "Summary" do
                                            scenario "General" do
                                        Severity: Minor
                                        Found in spec/system/admin/stats_spec.rb - About 3 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language