aeolusproject/conductor

View on GitHub

Showing 248 of 368 total issues

Function render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  render: function() {
    $template = $('#instanceCardTemplate');
    if($template.length === 0) return;

    var $instances = this.$('ul.instances-array');
Severity: Minor
Found in src/app/assets/javascripts/backbone/views.js - About 45 mins 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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(instance, assembly_uuids, config_values, deployable_id, deployable_name, config_server)
Severity: Minor
Found in src/app/util/config_server_util.rb - About 45 mins to fix

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

      def create
        @base_image = Tim::BaseImage.new(params[:base_image]) unless defined? @base_image
    
        if params[:back]
          render :edit_xml
    Severity: Minor
    Found in src/app/decorators/controllers/tim/base_images_controller_decorator.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def show
        @provider_realm = ProviderRealm.find(params[:id])
        @title = @provider_realm.name
    
        @tab_captions = [_('Properties'), _('Mapping')]
    Severity: Minor
    Found in src/app/controllers/provider_realms_controller.rb - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

              event4 = Event.new(:source => instance.deployment, :event_time => DateTime.now,
                                 :status_code => "some_stopped", :summary => "Some instances are stopped",
                                 :change_hash => instance.changes) if instance.deployment.events.lifetime.last{|e|e.status_code == :all_running}
    Severity: Major
    Found in src/app/models/instance_observer.rb - About 45 mins to fix

      Method uptime_1st_instance has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def uptime_1st_instance
          return nil if events.empty?
      
          first_running = events.find_last_by_status_code(:first_running)
          if instances.deployed.empty?
      Severity: Minor
      Found in src/app/models/deployment.rb - About 45 mins 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 8 (exceeds 5 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 45 mins 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 transform_credential_definitions_back has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.transform_credential_definitions_back
          ec2 = ProviderType.find_by_codename('ec2')
          CredentialDefinition.all.each do |cred|
            if cred.provider_type != ec2
              if cred.name == 'username'
      Severity: Minor
      Found in src/db/migrate/20110331152400_change_credential_definitions.rb - About 45 mins 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 transform_credential_definitions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.transform_credential_definitions
          ec2 = ProviderType.find_by_codename('ec2')
          CredentialDefinition.all.each do |cred|
            if cred.provider_type != ec2
              if cred.name == 'username'
      Severity: Minor
      Found in src/db/migrate/20110331152400_change_credential_definitions.rb - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                if Role.exists?(params[key])
                  MetadataObject.set(key, Role.find(params[key]))
                end
      Severity: Major
      Found in src/app/controllers/settings_controller.rb - About 45 mins to fix

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

          def show
            @realm = FrontendRealm.find(params[:id])
            @title = @realm.name
            @tab_captions = [_('Properties'), _('Mapping')]
            @details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
        Severity: Minor
        Found in src/app/controllers/frontend_realms_controller.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def multi_destroy
            deleted=[]
            not_deleted=[]
        
            HardwareProfile.find(params[:hardware_profile_selected]).each do |hwp|
        Severity: Minor
        Found in src/app/controllers/hardware_profiles_controller.rb - About 45 mins 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 restful_submit_tag has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def restful_submit_tag(value, action, url, method, options = {})
        Severity: Minor
        Found in src/app/helpers/application_helper.rb - About 35 mins to fix

          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def initialize(name, description, executable, files, parameters)
          Severity: Minor
          Found in src/app/util/deployable_xml.rb - About 35 mins to fix

            Method build_from_deployable has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def self.build_from_deployable(permission_session, user, pool, deployable_xml, frontend_realm = nil)
            Severity: Minor
            Found in src/lib/deployable_matching/assembly_instances_builder.rb - About 35 mins to fix

              Method validate_task has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def validate_task
                  errors.add("created_at", "Task started but does not have the creation time set") if time_started and created_at.nil?
                  # Removed check on time_started exisiting. if time_ended does.  This can now occur, when the task fails before is starts.  e.g. When Over Qutoa
                  #errors.add("time_started", "Task ends but does not have the start time set") if time_ended and time_started.nil?
                  errors.add("time_ended", "Tasks ends before it's started") unless time_ended.nil? or time_started.nil? or time_ended >= time_started
              Severity: Minor
              Found in src/app/models/task.rb - About 35 mins 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 imagefactory_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def imagefactory_info
                  if provider_type.deltacloud_driver == 'openstack'
                    # TODO: We might want to pull this up to the Provider, really
                    acct = provider_accounts.first
                    uri = URI.parse(acct.credentials_hash['glance_url'])
              Severity: Minor
              Found in src/app/models/provider.rb - About 35 mins 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_using_ldap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.authenticate_using_ldap(username, password, ipaddress)
                  if Ldap.valid_ldap_authentication?(username, password)
                    u = User.find_by_username(username) || create_ldap_user!(username)
                    update_login_attributes(u, ipaddress)
                  else
              Severity: Minor
              Found in src/app/models/user.rb - About 35 mins 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 image_valid? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def image_valid?(assembly, modify_perm)
                  edit_xml_path = edit_polymorphic_path([@catalog, @deployable], :edit_xml => true)
              
                  if @missing_images.empty? && assembly[:hwp_name].present?
                    link_hash = {:label => '.images_valid', :class => 'images_valid'}
              Severity: Minor
              Found in src/app/helpers/deployables_helper.rb - About 35 mins 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 create_instance! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.create_instance!(task, match, config_server, config)
                  begin
                    task.state = Task::STATE_PENDING
                    task.save!
              
              
              Severity: Minor
              Found in src/app/util/taskomatic.rb - About 35 mins 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