Showing 630 of 1,221 total issues

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

        def create_mount_target(file_system_id, subnet_id, options={})
          response               = Excon::Response.new
          default_security_group = mock_compute.data[:security_groups].find do |_, sg|
            sg['groupDescription'] == 'default_elb security group'
          end
Severity: Minor
Found in lib/fog/aws/requests/efs/create_mount_target.rb - About 1 hr to fix

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

            def get_user(username = nil, options = {})
              response  = Excon::Response.new
              user_body = nil
    
              if username.nil? # show current user
    Severity: Minor
    Found in lib/fog/aws/requests/iam/get_user.rb - About 1 hr to fix

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

              def bootstrap(new_attributes = {})
                spot_request = service.spot_requests.new(new_attributes)
      
                unless new_attributes[:key_name]
                  # first or create fog_#{credential} keypair
      Severity: Minor
      Found in lib/fog/aws/models/compute/spot_requests.rb - About 1 hr to fix

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

                  def end_element(name)
                    case name
                    when 'Name', 'Value'
                      @dimension[name] = value
                    when 'Period', 'EvaluationPeriods'
        Severity: Minor
        Found in lib/fog/aws/parsers/cloud_watch/describe_alarms_for_metric.rb - About 1 hr to fix

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

                    def end_element(name)
                      if @in_tag_set
                        case name
                          when 'item'
                            @vpc['tagSet'][@tag['key']] = @tag['value']
          Severity: Minor
          Found in lib/fog/aws/parsers/compute/create_internet_gateway.rb - About 1 hr to fix

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

                    def describe_orderable_db_instance_options(engine=nil, opts={})
                      instance_options = []
                      response = Excon::Response.new
                      if engine
                        (opts[:db_instance_class] || %w(db.m2.xlarge db.m1.large)).each do |size|
            Severity: Minor
            Found in lib/fog/aws/requests/rds/describe_orderable_db_instance_options.rb - About 1 hr to fix

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

                      def put_bucket_versioning(bucket_name, status)
                        response = Excon::Response.new
                        bucket = self.data[:buckets][bucket_name]
              
                        if bucket
              Severity: Minor
              Found in lib/fog/aws/requests/storage/put_bucket_versioning.rb - About 1 hr to fix

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

                    def self.parse_security_group_options(group_name, options)
                      options ||= Hash.new
                      if group_name.is_a?(Hash)
                        options = group_name
                      elsif group_name
                Severity: Minor
                Found in lib/fog/aws.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 end_element has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                          def end_element(name)
                            case name
                            when 'AvailabilityZone', 'ClusterIdentifier', 'ClusterStatus', 'ClusterSubnetGroupName', 'DBName',
                              'MasterUsername', 'ModifyStatus', 'PreferredMaintenanceWindow', 'VpcId'
                              @cluster[name] = value
                Severity: Minor
                Found in lib/fog/aws/parsers/redshift/cluster_parser.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 _setup_bootstrap has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                        def _setup_bootstrap(server)
                          unless server.key_name
                            # first or create fog_#{credential} keypair
                            name = Fog.respond_to?(:credential) && Fog.credential || :default
                            unless server.key_pair = service.key_pairs.get("fog_#{name}")
                Severity: Minor
                Found in lib/fog/aws/models/compute/servers.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 delete_multiple_objects has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                        def delete_multiple_objects(bucket_name, object_names, options = {})
                          headers = options.dup
                          data = "<Delete>"
                          data << "<Quiet>true</Quiet>" if headers.delete(:quiet)
                          version_ids = headers.delete('versionId')
                Severity: Minor
                Found in lib/fog/aws/requests/storage/delete_multiple_objects.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 end_element has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                          def end_element(name)
                            super
                            case name
                            when 'clusterName', 'clusterArn', 'status'
                              @cluster[name] = value
                Severity: Minor
                Found in lib/fog/aws/parsers/ecs/describe_clusters.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 list_keys has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                        def list_keys(options={})
                          limit  = options[:limit]
                          marker = options[:marker]
                
                          if limit
                Severity: Minor
                Found in lib/fog/aws/requests/kms/list_keys.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 create_load_balancer_policy has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                        def create_load_balancer_policy(lb_name, name, type_name, attributes = {})
                          if load_balancer = self.data[:load_balancers][lb_name]
                            raise Fog::AWS::ELB::DuplicatePolicyName, name if policy = load_balancer['Policies']['Proper'].find { |p| p['PolicyName'] == name }
                            raise Fog::AWS::ELB::PolicyTypeNotFound, type_name unless policy_type = self.data[:policy_types].find { |pt| pt['PolicyTypeName'] == type_name }
                
                
                Severity: Minor
                Found in lib/fog/aws/requests/elb/create_load_balancer_policy.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 start_task has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                        def start_task(params={})
                          response = Excon::Response.new
                          response.status = 200
                
                          unless task_def_id = params.delete('taskDefinition')
                Severity: Minor
                Found in lib/fog/aws/requests/ecs/start_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 update_account_password_policy has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def update_account_password_policy(minimum_password_length, max_password_age, password_reuse_prevention,require_symbols,require_numbers,require_uppercase_characters, require_lowercase_characters,allow_users_to_change_password, hard_expiry, expire_passwords)
                Severity: Major
                Found in lib/fog/aws/requests/iam/update_account_password_policy.rb - About 1 hr to fix

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

                          def request_spot_instances(image_id, instance_type, spot_price, options = {})
                            if block_device_mapping = options.delete('LaunchSpecification.BlockDeviceMapping')
                              block_device_mapping.each_with_index do |mapping, index|
                                for key, value in mapping
                                  options.merge!({ format("LaunchSpecification.BlockDeviceMapping.%d.#{key}", index) => value })
                  Severity: Minor
                  Found in lib/fog/aws/requests/compute/request_spot_instances.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_account_password_policy has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def update_account_password_policy(minimum_password_length, max_password_age, password_reuse_prevention,require_symbols,require_numbers,require_uppercase_characters, require_lowercase_characters,allow_users_to_change_password, hard_expiry, expire_passwords)
                  Severity: Major
                  Found in lib/fog/aws/requests/iam/update_account_password_policy.rb - About 1 hr to fix

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

                            def list_policies(options={})
                              limit  = options['MaxItems']
                              marker = options['Marker']
                    
                              if limit
                    Severity: Minor
                    Found in lib/fog/aws/requests/iam/list_policies.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 domain_metadata has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def domain_metadata(domain_name)
                              response = Excon::Response.new
                              if domain = self.data[:domains][domain_name]
                                response.status = 200
                    
                    
                    Severity: Minor
                    Found in lib/fog/aws/requests/simpledb/domain_metadata.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