Showing 630 of 1,221 total issues

Method create_event_source_mapping has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def create_event_source_mapping(params={})
          enabled          = params.delete('Enabled')   || false
          batch_size       = params.delete('BatchSize') || 100
          event_source_arn = params.delete('EventSourceArn')
          function_name    = params.delete('FunctionName')
Severity: Minor
Found in lib/fog/aws/requests/lambda/create_event_source_mapping.rb - About 25 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 get_user has a Cognitive Complexity of 6 (exceeds 5 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 25 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 put_scheduled_update_group_action has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def put_scheduled_update_group_action(auto_scaling_group_name, scheduled_action_name, time=nil, options = {})
          # The 'Time' parameter is now an alias for StartTime and needs to be identical if specified.
          time = options['StartTime'].nil? ? time : options['StartTime']
          if !time.nil?
            time = time.class == Time ? time.utc.iso8601 : Time.parse(time).utc.iso8601
Severity: Minor
Found in lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb - About 25 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 describe_spot_price_history has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_spot_price_history(filters = {})
          params = {}

          for key in %w(AvailabilityZone StartTime EndTime MaxResults NextToken)
            if filters.is_a?(Hash) && filters.key?(key)
Severity: Minor
Found in lib/fog/aws/requests/compute/describe_spot_price_history.rb - About 25 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 deregister_container_instance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def deregister_container_instance(params={})
          response = Excon::Response.new
          response.status = 200

          instance_id = params.delete('containerInstance')
Severity: Minor
Found in lib/fog/aws/requests/ecs/deregister_container_instance.rb - About 25 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 detach_internet_gateway has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def detach_internet_gateway(internet_gateway_id, vpc_id)
          response = Excon::Response.new
          if internet_gateway_id && vpc_id
            response.status = 200
            response.body = {
Severity: Minor
Found in lib/fog/aws/requests/compute/detach_internet_gateway.rb - About 25 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 describe_services has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_services(params={})
          response = Excon::Response.new
          response.status = 200

          cluster = params.delete('cluster') || 'default'
Severity: Minor
Found in lib/fog/aws/requests/ecs/describe_services.rb - About 25 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 put_notification_configuration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def put_notification_configuration(auto_scaling_group_name, notification_types, topic_arn)
          unless self.data[:auto_scaling_groups].key?(auto_scaling_group_name)
            raise Fog::AWS::AutoScaling::ValidationError.new("AutoScalingGroup name not found - #{auto_scaling_group_name}")
          end
          if notification_types.to_a.empty?
Severity: Minor
Found in lib/fog/aws/requests/auto_scaling/put_notification_configuration.rb - About 25 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 request_unsigned has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def request_unsigned(params)
          idempotent  = params.delete(:idempotent)
          parser      = params.delete(:parser)

          params['Version'] = '2011-06-15'
Severity: Minor
Found in lib/fog/aws/sts.rb - About 25 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 connection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def connection(scheme, host, port)
          uri = "#{scheme}://#{host}:#{port}"
          if @persistent
            unless uri == @connection_uri
              @connection_uri = uri
Severity: Minor
Found in lib/fog/aws/storage.rb - About 25 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