aeolusproject/conductor

View on GitHub

Showing 248 of 368 total issues

Method load_events has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
Open

  def load_events
    @source_type = params[:source_type].nil? ? "" : params[:source_type]
    @pool_select = params[:pool_select].nil? ? "" : params[:pool_select]
    @provider_select =
      params[:provider_select].nil? ? "" : params[:provider_select]
Severity: Minor
Found in src/app/controllers/logs_controller.rb - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File deployment.rb has 533 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'util/deployable_xml'
require 'util/config_server_util'

class Deployment < ActiveRecord::Base
  acts_as_paranoid
Severity: Major
Found in src/app/models/deployment.rb - About 1 day to fix

    Class Deployment has 54 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Deployment < ActiveRecord::Base
      acts_as_paranoid
    
      include Alberich::PermissionedObject
      class << self
    Severity: Major
    Found in src/app/models/deployment.rb - About 7 hrs to fix

      Class Instance has 50 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Instance < ActiveRecord::Base
        acts_as_paranoid
      
        class << self
          include CommonFilterMethods
      Severity: Minor
      Found in src/app/models/instance.rb - About 7 hrs to fix

        File deployments_controller.rb has 433 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class DeploymentsController < ApplicationController
          before_filter :require_user
          before_filter :load_deployments, :only => [:index, :show]
          before_filter :load_deployment, :only => [:edit, :update]
          before_filter :check_inaccessible_instances, :only => :multi_stop
        Severity: Minor
        Found in src/app/controllers/deployments_controller.rb - About 6 hrs to fix

          Method populate_realms has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

            def populate_realms
              reload
          
              # if the provider is not running, mark as unavailable and don't refresh its
              # realms
          Severity: Minor
          Found in src/app/models/provider.rb - About 5 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          File providers_controller.rb has 406 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class ProvidersController < ApplicationController
            before_filter :require_user
            before_filter :load_providers, :only => [:index, :show, :new, :edit, :create, :update]
            before_filter :load_providers_types, :only => [:new, :edit, :update, :create]
            before_filter ResourceLinkFilter.new({ :provider => :provider_type }),
          Severity: Minor
          Found in src/app/controllers/providers_controller.rb - About 5 hrs to fix

            Method path_to has 143 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def path_to(page_name)
                case page_name
            
                when /^the home\s?page$/
                  '/'
            Severity: Major
            Found in src/features/support/paths.rb - About 5 hrs to fix

              File instance.rb has 390 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'util/deployable_xml'
              require 'util/instance_config_xml'
              
              class Instance < ActiveRecord::Base
                acts_as_paranoid
              Severity: Minor
              Found in src/app/models/instance.rb - About 5 hrs to fix

                File pools_controller.rb has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class PoolsController < ApplicationController
                  include QuotaAware
                  before_filter :require_user
                  before_filter :set_params_and_header, :only => [:index, :show]
                  before_filter :load_pools, :only => [:show]
                Severity: Minor
                Found in src/app/controllers/pools_controller.rb - About 5 hrs to fix

                  Class ApplicationController has 38 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ApplicationController < ActionController::Base
                    class ActionError < RuntimeError; end
                    class PartialSuccessError < RuntimeError
                      attr_reader :failures, :successes
                      def initialize(msg, failures={}, successes=[])
                  Severity: Minor
                  Found in src/app/controllers/application_controller.rb - About 5 hrs to fix

                    Method after_update has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def after_update(instance)
                        # This can get stale, so reload it -- if it exists
                        instance.deployment.reload if instance.deployment
                        if instance.state_changed?
                          event = Event.new(:source => instance, :event_time => DateTime.now,
                    Severity: Minor
                    Found in src/app/models/instance_observer.rb - About 4 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Method export_logs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def export_logs
                        load_events
                        load_headers
                    
                        csvm = get_csv_class
                    Severity: Minor
                    Found in src/app/controllers/logs_controller.rb - About 4 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    File hardware_profiles_controller.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    class HardwareProfilesController < ApplicationController
                      before_filter :require_user
                      before_filter :load_hardware_profiles, :only => [:index, :show]
                      before_filter :setup_new_hardware_profile, :only => [:new]
                      before_filter :setup_hardware_profile, :only => [:new, :create, :matching_provider_hardware_profiles, :edit, :update]
                    Severity: Minor
                    Found in src/app/controllers/hardware_profiles_controller.rb - About 4 hrs to fix

                      Method statistics has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def statistics
                          @statistics = Hash.new
                          @providers.each do |provider|
                            @statistics[provider.id] = {
                              "running_instances" => 0,
                      Severity: Major
                      Found in src/app/controllers/providers_controller.rb - About 4 hrs to fix

                        Method create has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def create
                            if params[:cancel]
                              redirect_to polymorphic_path([Catalog.find(Array(params[:catalog_id])[0]), Deployable])
                              return
                            end
                        Severity: Minor
                        Found in src/app/controllers/deployables_controller.rb - About 4 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method multi_destroy has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def multi_destroy
                            deleted = []
                            not_deleted = []
                            not_deleted_perms = []
                        
                        
                        Severity: Minor
                        Found in src/app/controllers/deployables_controller.rb - About 4 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method load_events has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def load_events
                            @source_type = params[:source_type].nil? ? "" : params[:source_type]
                            @pool_select = params[:pool_select].nil? ? "" : params[:pool_select]
                            @provider_select =
                              params[:provider_select].nil? ? "" : params[:provider_select]
                        Severity: Major
                        Found in src/app/controllers/logs_controller.rb - About 3 hrs to fix

                          File application_controller.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'viewstate.rb'
                          require 'util/conductor'
                          require 'will_paginate/array'
                          
                          class ApplicationController < ActionController::Base
                          Severity: Minor
                          Found in src/app/controllers/application_controller.rb - About 3 hrs to fix

                            Method index has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def index
                                clear_breadcrumbs
                                save_breadcrumb(pools_path(:viewstate => viewstate_id))
                            
                                # This is primarily relevant to filter_view, but we check @details_tab in other places:
                            Severity: Minor
                            Found in src/app/controllers/pools_controller.rb - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language