Showing 630 of 1,221 total issues

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

          def end_element(name)
            case name
            when 'Date'
              @event[name] = DateTime.parse(value.strip)
            when 'Message', 'SourceIdentifier', 'SourceType'
Severity: Minor
Found in lib/fog/aws/parsers/rds/event_list.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'StreamingDistributionSummary'
              @response['StreamingDistributionSummary'] << @distribution_summary
              @distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
Severity: Minor
Found in lib/fog/aws/parsers/cdn/get_streaming_distribution_list.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'DistributionSummary'
              @response['DistributionSummary'] << @distribution_summary
              @distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
Severity: Minor
Found in lib/fog/aws/parsers/cdn/get_distribution_list.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 flagged_resources has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def flagged_resources(lazy=true)
          if attributes[:flagged_resources].nil?
            populate_extended_attributes(lazy)

            if attributes[:flagged_resources]
Severity: Minor
Found in lib/fog/aws/models/support/trusted_advisor_check.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case @configuration
            when 'topic'
              case name
              when 'Id', 'Event', 'Topic'
Severity: Minor
Found in lib/fog/aws/parsers/storage/get_bucket_notification.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
              when 'member'
                if @parse_stack.last[:type] != :object
                  @parse_stack.last[:value] << value
Severity: Minor
Found in lib/fog/aws/parsers/beanstalk/parser.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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def get(file_name=nil)
          if file_name
            matches = self.select {|log_file| log_file.name.upcase == file_name.upcase}
            return matches.first unless matches.empty?
          end
Severity: Minor
Found in lib/fog/aws/models/rds/log_files.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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def initialize(attributes={})
          if attributes[:subnet_ids] ||= attributes['Subnets']
            attributes[:availability_zones] ||= attributes['AvailabilityZones']
          else
            attributes[:availability_zones] ||= attributes['AvailabilityZones']  || %w(us-east-1a us-east-1b us-east-1c us-east-1d)
Severity: Minor
Found in lib/fog/aws/models/elb/load_balancer.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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def save
          requires :alarm_name
          requires :comparison_operator
          requires :evaluation_periods
          requires :metric_name
Severity: Minor
Found in lib/fog/aws/models/cloud_watch/alarm_datum.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'member'
              if @in_availability_zones && @in_load_balancer_addresses
                @availability_zone['LoadBalancerAddresses'] << @load_balancer_addresses
Severity: Minor
Found in lib/fog/aws/parsers/elbv2/describe_load_balancers.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 canonical_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def canonical_path(path)
        unless @service == 's3' #S3 implements signature v4 different - paths are not canonialized
          #leading and trailing repeated slashes are collapsed, but not ones that appear elsewhere
          path = path.gsub(%r{\A/+},'/').gsub(%r{/+\z},'/')
          components = path.split('/',-1)
Severity: Minor
Found in lib/fog/aws/signaturev4.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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def save
          if source_snapshot_id
            requires :id
            data = service.restore_db_instance_from_db_snapshot(source_snapshot_id, id, attributes_to_params)
            merge_attributes(data.body['RestoreDBInstanceFromDBSnapshotResult']['DBInstance'])
Severity: Minor
Found in lib/fog/aws/models/rds/server.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'member'
              if @in_policy_attribute_types
                @policy_type['PolicyAttributeTypeDescriptions'] << @policy_attribute_type_description
Severity: Minor
Found in lib/fog/aws/parsers/elb/describe_load_balancer_policy_types.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'UserName', 'PolicyName'
              @response['Policy'][name] = value
            when 'PolicyDocument'
Severity: Minor
Found in lib/fog/aws/parsers/iam/get_user_policy.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'instanceId'
              @instance[name] = value
            when 'item'
Severity: Minor
Found in lib/fog/aws/parsers/compute/terminate_instances.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'SummaryMap'
              @stack.pop
            when 'key'
Severity: Minor
Found in lib/fog/aws/parsers/iam/get_account_summary.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            if @in_tag_set
              case name
              when 'item'
                @snapshot['tagSet'][@tag['key']] = @tag['value']
Severity: Minor
Found in lib/fog/aws/parsers/compute/describe_snapshots.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 send_email has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def send_email(source, destination, message, options = {})
          params = {
            'Source' => source
          }

Severity: Minor
Found in lib/fog/aws/requests/ses/send_email.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 end_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'RoleName', 'PolicyName'
              @response['Policy'][name] = value
            when 'PolicyDocument'
Severity: Minor
Found in lib/fog/aws/parsers/iam/get_role_policy.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 upload_part_copy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def upload_part_copy(target_bucket_name, target_object_name, upload_id, part_number, options = {})
          validate_options!(options)

          copy_source = options['x-amz-copy-source']
          copy_range = options['x-amz-copy-source-range']
Severity: Minor
Found in lib/fog/aws/requests/storage/upload_part_copy.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