aeolusproject/conductor

View on GitHub

Showing 248 of 368 total issues

Method up has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.up
    return if Role.all.empty?
    Role.transaction do
      role = Role.find_or_initialize_by_name(ROLE_NAME)
      role.update_attributes({:name => ROLE_NAME, :scope => BasePermissionObject.name, :assign_to_owner => ROLE_DEF[0]})
Severity: Minor
Found in src/db/migrate/20111104121803_add_hwp_global_user_role.rb - About 1 hr to fix

    Method multi_destroy has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def multi_destroy
        destroyed = []
        failed = []
        permission_failed = []
        error_messages = []
    Severity: Minor
    Found in src/app/controllers/pools_controller.rb - About 1 hr to fix

      Method load_provider_tabs has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def load_provider_tabs
          @realms = @provider.provider_realms.apply_filters(:preset_filter_id => params[:provider_realms_preset_filter], :search_filter => params[:provider_realms_search])
          #TODO add links to real data for history,properties,permissions
          @tabs = [{ :name => _('Properties'),
                     :view => 'properties',
      Severity: Minor
      Found in src/app/controllers/providers_controller.rb - About 1 hr to fix

        Method up has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.up
            return if Role.all.empty?
            Role.transaction do
              role = Role.find_or_initialize_by_name(ROLE_NAME)
              role.update_attributes({:name => ROLE_NAME, :scope => BasePermissionObject.name, :assign_to_owner => ROLE_DEF[0]})
        Severity: Minor
        Found in src/db/migrate/20111104122143_add_catalog_global_user_role.rb - About 1 hr to fix

          Method destroy has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def destroy
              @hardware_profile = HardwareProfile.find(params[:id])
              require_privilege(Alberich::Privilege::MODIFY, @hardware_profile)
          
              if @hardware_profile.provider_hardware_profile?
          Severity: Minor
          Found in src/app/controllers/hardware_profiles_controller.rb - About 1 hr to fix

            Method valid_actions_for_instance_state has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.valid_actions_for_instance_state(state, instance, user=nil)
                actions = []
                # FIXME: cloud_account won't always be set here, but we're requiring
                #        front end realm for now.
                if cloud_account = instance.provider_account and
            Severity: Minor
            Found in src/app/models/instance_task.rb - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def multi_destroy
                destroyed = []
                errors = []
            
                ids = Array(params[:deployments_selected])
            Severity: Minor
            Found in src/app/controllers/deployments_controller.rb - About 1 hr 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 apply_search_filter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.apply_search_filter(search)
                search, preset_filter_id = search
                if search
                  if preset_filter_id
                    search_fields = PROFILE_PRESET_FILTERS_OPTIONS.select { |item|
            Severity: Minor
            Found in src/app/decorators/models/alberich/derived_permission_decorator.rb - About 1 hr 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 stoppable_inaccessible_instances has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.stoppable_inaccessible_instances(deployments)
                failed_accounts = {}
                res = []
                deployments.each do |d|
                  next unless acc = d.provider_account
            Severity: Minor
            Found in src/app/models/deployment.rb - About 1 hr 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 set_new_form_variables has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def set_new_form_variables
                @base_image ||= Tim::BaseImage.new(params[:base_image])
                # FIXME: remove this:
                @base_image.template ||= Tim::Template.new
            
            

            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 stoppable_inaccessible_instances has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.stoppable_inaccessible_instances(instances)
                failed_accounts = {}
                instances.select do |i|
                  next unless STOPPABLE_INACCESSIBLE_STATES.include?(i.state)
                  next unless i.provider_account
            Severity: Minor
            Found in src/app/models/instance.rb - About 1 hr 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 apply_search_filter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.apply_search_filter(search)
                search, preset_filter_id = search
                if search
                  if preset_filter_id
                    search_fields = PROFILE_PRESET_FILTERS_OPTIONS.select { |item|
            Severity: Minor
            Found in src/app/decorators/models/alberich/permission_decorator.rb - About 1 hr 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 run_provider_account_level_checks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def run_provider_account_level_checks(assembly, provider_account, provider_hwp, provider_image)
                  unless provider_account.provider.enabled?
                    @errors << I18n.t('instances.errors.must_be_enabled', :account_name => provider_account.name)
                  end
            
            
            Severity: Minor
            Found in src/lib/deployable_matching/validator.rb - About 1 hr 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 destroy has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def destroy
                deployable = Deployable.find(params[:id])
                @catalog = Catalog.find(params[:catalog_id]) if params[:catalog_id].present?
                require_privilege(Alberich::Privilege::MODIFY, deployable)
                if deployable.destroy
            Severity: Minor
            Found in src/app/controllers/deployables_controller.rb - About 1 hr 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 show has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def show
                @hardware_profile = HardwareProfile.find(Array(params[:id]).first)
                require_privilege(Alberich::Privilege::VIEW, @hardware_profile)
                @title = if @hardware_profile.provider_hardware_profile?
                           _('%s (Provider)') % @hardware_profile.name
            Severity: Minor
            Found in src/app/controllers/hardware_profiles_controller.rb - About 1 hr 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 show has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def show
                @deployable = Deployable.find(params[:id])
                @catalog = params[:catalog_id].present? ? Catalog.find(params[:catalog_id]) : @deployable.catalogs.first
                require_privilege(Alberich::Privilege::VIEW, @deployable)
                save_breadcrumb(polymorphic_path([@catalog, @deployable]), @deployable.name)
            Severity: Minor
            Found in src/app/controllers/deployables_controller.rb - About 1 hr 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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def update
                @deployable = Deployable.find(params[:id])
                @catalog = Catalog.find(params[:catalog_id]) if params[:catalog_id].present?
                require_privilege(Alberich::Privilege::MODIFY, @deployable)
                params[:deployable].delete(:owner_id) if params[:deployable]
            Severity: Minor
            Found in src/app/controllers/deployables_controller.rb - About 1 hr 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 cost_in_time has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                  def cost_in_time(ref_time, start, stop, instance_hwp=nil)
                    cost = Cost.for_chargeable_and_time(1, id, ref_time)
                    return nil if cost.nil?
            
                    price = 0.0
            Severity: Minor
            Found in src/lib/costengine/mixins.rb - About 1 hr 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

            Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render: function() {
                this.$('h1.pools').text(this.model.get('name'));
            
                var $template = this.template();
                if($template.length === 0) return;
            Severity: Minor
            Found in src/app/assets/javascripts/backbone/views.js - About 1 hr to fix

              Method load_pool_family_tabs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def load_pool_family_tabs
                  @tabs = [{:name => _('Pools'),:view => 'pools', :id => 'pools', :count => @pool_family.pools.count},
                           {:name => _('Accounts'), :view => 'provider_accounts', :id => 'provider_accounts', :count => @pool_family.provider_accounts.count},
                           {:name => _('Images'), :view => 'images', :id => 'images', :count => @all_images.count},
                  ]
              Severity: Minor
              Found in src/app/controllers/pool_families_controller.rb - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language