aeolusproject/conductor

View on GitHub

Showing 248 of 368 total issues

Method validate_hwp has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def validate_hwp
    case name
    when MEMORY
      unless unit == UNIT_MB
        errors.add(:unit, "Memory must be specified in MB")
Severity: Minor
Found in src/app/models/hardware_profile_property.rb - About 1 hr to fix

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

      render: function() {
        var $template = this.template();
    
        if (this.currentView() == 'table') {
          var $table = this.$('table.checkbox_table > tbody');
    Severity: Minor
    Found in src/app/assets/javascripts/backbone/views.js - About 1 hr to fix

      Method add_provider_accounts has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def add_provider_accounts
          @pool_family = PoolFamily.find(params[:id])
          require_privilege(Alberich::Privilege::MODIFY, @pool_family)
      
          if ProviderAccount.count == 0
      Severity: Minor
      Found in src/app/controllers/pool_families_controller.rb - About 1 hr to fix

        Method update_cost has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method send_launch_requests has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def send_launch_requests(all_inst_match, instance_ids, config_server_id, user_id)
              user = User.find(user_id)
              instances = instance_ids.map{|instance_id| Instance.find(instance_id)}
          
              if config_server_id.nil?
          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 remove_provider_accounts has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def remove_provider_accounts
              @pool_family = PoolFamily.find(params[:id])
              require_privilege(Alberich::Privilege::MODIFY, @pool_family)
              removed=[]
              not_removed=[]
          Severity: Minor
          Found in src/app/controllers/pool_families_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 index has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def index
              clear_breadcrumbs
              save_breadcrumb(logs_path)
          
              params[:view] = "filter" if params[:view].nil?
          Severity: Minor
          Found in src/app/controllers/logs_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 generate_override_property_value has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.generate_override_property_value(front_end_property, back_end_property)
              case back_end_property.kind
                when "fixed"
                  return back_end_property.value
                when "range"
          Severity: Minor
          Found in src/app/models/hardware_profile.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_stop has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def multi_stop
              notices = []
              errors = []
          
              @instances_to_stop.each do |instance|
          Severity: Minor
          Found in src/app/controllers/instances_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 build_assembly_match has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def build_assembly_match
                @assembly_matches = []
                assembly_level_warnings = []
                @errors = []
          
          
          Severity: Minor
          Found in src/lib/deployable_matching/assembly_matches_builder.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 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def update
              @title = _('Edit User')
              @user = params[:id] ? User.find(params[:id]) : current_user
              require_privilege(Alberich::Privilege::MODIFY, User) unless @user == current_user
              # A user should not be able to edit their own quota:
          Severity: Minor
          Found in src/app/controllers/users_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_cost has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def update_cost
              redirect_to hardware_profiles_path unless params[:id]
          
              @hardware_profile = HardwareProfile.find(params[:id])
              require_privilege(Alberich::Privilege::MODIFY, @hardware_profile)
          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 launch_time_params has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def launch_time_params
              @title = _('New Deployment')
          
              @deployment = Deployment.new(params[:deployment])
              @pool = @deployment.pool
          Severity: Minor
          Found in src/app/controllers/deployments_controller.rb - About 1 hr to fix

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

              def destroy
                deployment = Deployment.find(params[:id])
                cant_stop = false
                errors = []
                begin
            Severity: Minor
            Found in src/app/controllers/deployments_controller.rb - About 1 hr to fix

              Method after_update has 34 lines of code (exceeds 25 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 1 hr to fix

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

                  def up
                    create_table :alberich_entities do |t|
                      t.string :name
                      t.references :entity_target, :polymorphic => true, :null => false
                
                
                Severity: Minor
                Found in src/db/migrate/20130329040263_create_alberich_entities.alberich.rb - About 1 hr to fix

                  Method up has 34 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)
                  Severity: Minor
                  Found in src/db/migrate/20110623142949_pool_self_service_role.rb - About 1 hr to fix

                    Method add_members has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def add_members
                        @user_group = UserGroup.find(params[:id])
                        require_privilege(Alberich::Privilege::MODIFY, User)
                    
                        unless @user_group.membership_source == UserGroup::MEMBERSHIP_SOURCE_LOCAL
                    Severity: Minor
                    Found in src/app/controllers/user_groups_controller.rb - About 1 hr to fix

                      Method index has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def index
                          clear_breadcrumbs
                          if params[:catalog_id].present?
                            save_breadcrumb(catalog_deployables_path(:viewstate => @viewstate ? @viewstate.id : nil))
                            @catalog = Catalog.find(params[:catalog_id])
                      Severity: Minor
                      Found in src/app/controllers/deployables_controller.rb - About 1 hr to fix

                        Method create has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def create
                            @title = _('New Provider')
                            require_privilege(Alberich::Privilege::CREATE, Provider)
                            @provider = Provider.new(params[:provider])
                        
                        
                        Severity: Minor
                        Found in src/app/controllers/providers_controller.rb - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language