fog/fog-ecloud

View on GitHub

Showing 92 of 165 total issues

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

      def check_href!(opts = {})
        unless href
          opts = { :parent => opts } if opts.is_a?(String)
          msg = ":href missing, call with a :href pointing to #{if opts[:message]
                  opts[:message]
Severity: Minor
Found in lib/fog/compute/ecloud/models/collection.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 validate_create_server_options_copy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def validate_create_server_options_copy(template_uri, options)
          required_opts = [:name, :cpus, :memory, :row, :group, :customization, :network_uri, :source]
          if options[:customization] == :windows
            required_opts.push(:windows_password)
          else
Severity: Minor
Found in lib/fog/compute/ecloud/requests/virtual_machine_copy.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 rnats has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def rnats
          rnats = Fog::Compute::Ecloud::Rnats.new(:service => service, :href => "#{service.base_path}/rnats/environments/#{environment_id}")
          associations = nil
          rnats.each do |rnat|
            if rnats.index(rnat) == 0
Severity: Minor
Found in lib/fog/compute/ecloud/models/server.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def initialize(options = {})
          @base_path               = options[:base_path] || "/cloudapi/ecloud"
          @connections             = {}
          @connection_options      = options[:connection_options] || {}
          @host                    = options[:ecloud_host] || API_URL
Severity: Minor
Found in lib/fog/compute/ecloud.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 virtual_machine_delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def virtual_machine_delete(uri)
          server_id = id_from_uri(uri)

          server = self.data[:servers][server_id]
          self.data[:servers].delete(server_id)
Severity: Minor
Found in lib/fog/compute/ecloud/requests/virtual_machine_delete.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 basic_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

          def basic_request(name, expects = [200], method = :get, headers = {}, body = "")
Severity: Minor
Found in lib/fog/compute/ecloud.rb - About 35 mins to fix

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

            def all
              data = service.get_groups(href).body
              data = if data == ""
                       ""
                     else
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/groups.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(uri)
              data = service.get_row(uri).body
              if data == ""
                nil
              else
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/rows.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 slurp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def self.slurp(error)
              data = nil
              message = nil
              status_code = nil
              minor_code = nil
    Severity: Minor
    Found in lib/fog/compute/ecloud/errors.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 add_ip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def add_ip(options)
              slice_ips = begin
                            ips
                          rescue
                            []
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              data = service.get_group(uri).body
              if data == ""
                nil
              else
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/groups.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 generate_backup_internet_service_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def generate_backup_internet_service_request(data)
              xml = Builder::XmlMarkup.new
              xml.CreateBackupInternetService(:name => data[:name]) do
                xml.Protocol data[:protocol]
                xml.Enabled data[:enabled]
    Severity: Minor
    Found in lib/fog/compute/ecloud/requests/backup_internet_service_create.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 generate_backup_internet_service_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def generate_backup_internet_service_request(data)
              xml = Builder::XmlMarkup.new
              xml.BackupInternetService(:name => data[:name]) do
                xml.Protocol data[:protocol]
                xml.Enabled data[:enabled]
    Severity: Minor
    Found in lib/fog/compute/ecloud/requests/backup_internet_service_edit.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 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              if data = service.get_memory_usage_detail(uri)
                new(data.body)
              end
            rescue ServiceError => e
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/memory_usage_detail_summary.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              if data = service.get_tag(uri)
                new(data.body)
              end
            rescue ServiceError => e
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/tags.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              if data = service.get_role(uri)
                new(data.body)
              end
            rescue ServiceError => e
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/roles.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              if data = service.get_network(uri)
                new(data.body)
              end
            rescue ServiceError => e
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/networks.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              if data = service.get_ssh_key(uri).body
                new(data)
              end
            rescue ServiceError => e
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/ssh_keys.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              if data = service.get_template(uri)
                new(data.body)
              end
            rescue ServiceError => e
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/templates.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def get(uri)
              if data = service.get_login_banner(uri)
                new(data.body)
              end
            rescue ServiceError => e
    Severity: Minor
    Found in lib/fog/compute/ecloud/models/login_banners.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