aeolusproject/conductor

View on GitHub

Showing 248 of 368 total issues

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 update_quota has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def update_quota(state_from, state_to, an_instance)
        pool = an_instance.pool
        pool_family = pool.pool_family
        user = an_instance.owner
        provider_account = an_instance.provider_account
    Severity: Minor
    Found in src/app/models/instance_observer.rb - About 1 hr to fix

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

          def build_assembly_instance(assembly, permission_session, user)
            assembly_hwp = HardwareProfile.find_allowed_frontend_hwp_by_name(permission_session, user, assembly.hwp)
      
            assembly_errors = Validator.errors_for_assembly(assembly, assembly_hwp)
            if assembly_errors.any?
      Severity: Minor
      Found in src/lib/deployable_matching/assembly_instances_builder.rb - About 1 hr to fix

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

          def self.up
            create_table :hardware_profile_properties do |t|
              t.string  :name, :null => false
              t.string  :kind, :null => false
              t.string  :unit, :null => false
        Severity: Minor
        Found in src/db/migrate/20090804135630_create_hardware_profiles.rb - About 1 hr to fix

          Method update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def update
              @provider_account = ProviderAccount.find(params[:id])
              require_privilege(Alberich::Privilege::MODIFY, @provider_account.provider)
              require_privilege(Alberich::Privilege::MODIFY, @provider_account)
              credentials_hash = credentials_hash_prepare
          Severity: Minor
          Found in src/app/controllers/provider_accounts_controller.rb - About 1 hr to fix

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

              def self.up
                add_column :permissions, :entity_id, :integer
                add_column :derived_permissions, :entity_id, :integer
            
                Permission.reset_column_information
            Severity: Minor
            Found in src/db/migrate/20120520151500_change_permission_user.rb - About 1 hr to fix

              Method remove_members has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def remove_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 multi_destroy has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

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

                    Method multi_destroy has 29 lines of code (exceeds 25 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

                      Method update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def update
                          transform_quota_param(:pool)
                          @pool = Pool.find(params[:id])
                          require_privilege(Alberich::Privilege::MODIFY, @pool)
                          @catalogs = @pool.catalogs.list_for_user(current_session, current_user,
                      Severity: Minor
                      Found in src/app/controllers/pools_controller.rb - About 1 hr to fix

                        Method setup_viewstate_routes has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def setup_viewstate_routes(action)
                                @@viewstate_routes ||= []
                                self.send(:define_method, "get_viewstate_#{action}")  { get_viewstate_body(action) }
                                self.send(:define_method, "put_viewstate_#{action}") { put_viewstate_body(action) }
                                self.send(:define_method, "post_viewstate_#{action}") { post_viewstate_body(action) }
                        Severity: Minor
                        Found in src/lib/viewstate.rb - About 1 hr to fix

                          Method match_hardware_profile_property has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def self.match_hardware_profile_property(front_end_property, back_end_property)
                              # if the front_end_property is nil, we don't care about it, so everything matches:
                              return true if front_end_property.nil? || front_end_property.value.to_s.empty?
                              # if the back_end_property is nil, it only matches if front-end is also nil:
                              return false if back_end_property.nil? || back_end_property.value.to_s.empty?
                          Severity: Minor
                          Found in src/app/models/hardware_profile.rb - About 1 hr to fix

                            Method pool_for_mustache has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def pool_for_mustache(pool)
                                pool_statistics = pool.statistics
                                user_can_access_pool_family =
                                  check_privilege(Alberich::Privilege::VIEW, pool.pool_family)
                            
                            
                            Severity: Minor
                            Found in src/app/helpers/mustache_helper.rb - About 1 hr to fix

                              Method load_hardware_profiles has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def load_hardware_profiles
                                  sort_order = sort_direction
                                  sort_field = sort_column(HardwareProfile, 'name')
                                  if sort_field == "name"
                                    @hardware_profiles = HardwareProfile.where('provider_id IS NULL', {}).
                              Severity: Minor
                              Found in src/app/controllers/hardware_profiles_controller.rb - About 1 hr to fix

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

                                  def create
                                    transform_quota_param(:pool)
                                    @title = _('New Pool')
                                    @pool = Pool.new(params[:pool])
                                    @pool.quota = Quota.new(params[:pool][:quota_attributes])
                                Severity: Minor
                                Found in src/app/controllers/pools_controller.rb - About 1 hr to fix

                                  Method show has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def show
                                      @deployment = Deployment.find(params[:id])
                                      @title = _('%s Deployment') % @deployment.name
                                      require_privilege(Alberich::Privilege::VIEW, @deployment)
                                      init_new_deployment_attrs
                                  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 connection_valid? has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def connection_valid?
                                      if status.untested? or (changed? and (changes.keys & @@status_fields).empty?)
                                        error_str = nil
                                        begin
                                          response = test_connection
                                  Severity: Minor
                                  Found in src/app/models/config_server.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 authenticate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def self.authenticate(username, password, ipaddress)
                                      username = username.strip unless username.nil?
                                      return unless u = User.find_by_username(username)
                                      # FIXME: this is because of tests - encrypted password is submitted,
                                      # don't know how to get unencrypted version (from factorygirl)
                                  Severity: Minor
                                  Found in src/app/models/user.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_reboot has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def multi_reboot
                                      notices = []
                                      errors = []
                                      Instance.find(params[:instance_selected] || []).each do |instance|
                                        begin
                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language