fog/fog

Very high overall complexity: 4480

require 'fog/cloudstack/core'
require 'digest/md5'

module Fog
  module Compute

When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

Refactorings

Further Reading

Very high overall complexity: 2613

require 'fog/vcloud_director/core'
require 'fog/vcloud_director/query'

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)

When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

Refactorings

Further Reading

Very high overall complexity: 2499

module Fog
  module Compute
    class VcloudDirector
      class Real
        # List all supported versions.

When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

Refactorings

Further Reading

Complex class definition

require 'fog/cloudstack/core'
require 'digest/md5'

module Fog
  module Compute

    Very high overall complexity: 743

    require 'fog/cloudstack/core'
    require 'digest/md5'
    
    module Fog
      module Compute

    When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

    Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

    Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

    Refactorings

    Further Reading

    Very high overall complexity: 713

    require 'fog/vcloud/core'
    
    module Fog
      module Vcloud
        class Collection < Fog::Collection

    When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

    Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

    Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

    Refactorings

    Further Reading

    Very high overall complexity: 668

    # t.template_str
    # CPU="0.2"
    # VCPU="2"
    # MEMORY="2048"
    # SCHED_REQUIREMENTS="NFS=\"true\""

    When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

    Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

    Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

    Refactorings

    Further Reading

    Very high overall complexity: 655

    require 'fog/internet_archive/core'
    
    module Fog
      module Storage
        class InternetArchive < Fog::Service

    When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

    Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

    Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

    Refactorings

    Further Reading

    Very complex method in #fetch_items

                      {:MediaType=>"application/vnd.vmware.vcloud.tasksList+xml",
                       :ComplexTypeName=>"TasksListType",
                       :SchemaLocation=>
                        "http://#{@host}#{@path}/v1.5/schema/master.xsd"},
                      {:MediaType=>"application/vnd.vmware.admin.amqpSettingsTest+xml",

    Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

    Refactorings

    Read More

    Very high overall complexity: 623

    require 'fog/internet_archive/core'
    
    module Fog
      module Storage
        class InternetArchive < Fog::Service

    When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

    Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

    Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

    Refactorings

    Further Reading

    Very high overall complexity: 576

    require 'fog/cloudstack/core'
    require 'digest/md5'
    
    module Fog
      module Compute

    When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

    Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

    Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

    Refactorings

    Further Reading

    Complex class definition

    require 'fog/vcloud_director/core'
    require 'fog/vcloud_director/query'
    
    class VcloudDirectorParser < Fog::Parsers::Base
      def extract_attributes(attributes_xml)

      Very high overall complexity: 510

      module Fog
        module Generators
          module Compute
            module VcloudDirector
              class EdgeGatewayServiceConfiguration

      When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

      Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

      Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 8 other locations

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
      lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
      lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Very complex method in #generate_xml

                def generate_xml
                  body = Nokogiri::XML::Builder.new do
                    attrs = {
                      :xmlns => 'http://www.vmware.com/vcloud/v1.5',
                      :name  => options[:name]

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Similar code found in 1 other location

      module Fog
        module Compute
          class VcloudDirector
            class Real
              # List all supported versions.
      lib/fog/vcloud_director/requests/compute/get_vm.rb on lines 2..68

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 1 other location

      module Fog
        module Compute
          class VcloudDirector
            class Real
              # List all supported versions.
      lib/fog/vcloud_director/requests/compute/get_template_vm.rb on lines 2..68

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Very complex method in #build_load_balancer_service

                def build_load_balancer_service(xml)
                  lb_config = @configuration[:LoadBalancerService]
                  return unless lb_config
      
                  xml.LoadBalancerService {

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Very complex method in #build_source_items

                def build_source_items(xml)
                  vms = @configuration[:source_vms]
                  vms.each do |vm|
                    xml.SourcedItem {
                      xml.Source(:name =>vm[:name], :href => vm[:href])

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Similar code found in 1 other location

      require 'fog/cloudstack/core'
      require 'digest/md5'
      
      module Fog
        module Compute
      lib/fog/cloudstack/requests/compute/authorize_security_group_egress.rb on lines 2..71

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 1 other location

      require 'fog/cloudstack/core'
      require 'digest/md5'
      
      module Fog
        module Compute
      lib/fog/cloudstack/requests/compute/authorize_security_group_ingress.rb on lines 2..71

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Identical code found in 1 other location

      module Fog
        module Compute
          class VcloudDirector
            class Real
              # List all supported versions.
      lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb on lines 111..129

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Identical code found in 1 other location

      module Fog
        module Compute
          class VcloudDirector
            class Real
              # List all supported versions.
      lib/fog/vcloud_director/requests/compute/put_network.rb on lines 113..131

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Very high overall complexity: 398

      require 'fog/vcloud/models/compute/helpers/status'
      module Fog
        module Vcloud
          class Compute
            class Server < Fog::Vcloud::Model

      When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

      Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

      Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

      Refactorings

      Further Reading

      Very complex method in #template_pool

              def template_pool(filter = { })
      
                templates = ::OpenNebula::TemplatePool.new(client)
                if filter[:id].nil?
                  templates.info!(-2,-1,-1)

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Similar code found in 1 other location

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/put_memory.rb on lines 2..82

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 1 other location

      require 'fog/vcloud_director/core'
      require 'fog/vcloud_director/query'
      
      class VcloudDirectorParser < Fog::Parsers::Base
        def extract_attributes(attributes_xml)
      lib/fog/vcloud_director/requests/compute/put_cpu.rb on lines 2..82

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Very complex method in #list_vms

      # DISK=[
      #     DEV_PREFIX="vd",
      #     DRIVER="qcow2",
      #     IMAGE="base",
      #     IMAGE_ID="355",

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Very complex method in #put_bucket_lifecycle

            request :get_bucket
            request :get_bucket_acl
            request :get_bucket_cors
            request :get_bucket_lifecycle
            request :get_bucket_location

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Very complex method in #vm_allocate

      # SCHED_REQUIREMENTS="NFS=\"true\""
      # SCHED_DS_REQUIREMENTS="NAME=\"local\""
      # DISK=[
      #     DEV_PREFIX="vd",
      #     DRIVER="qcow2",

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Similar code found in 1 other location

      module Fog
        module DNS
          class Rage4
            class Real
              # Updates an existing record
      lib/fog/rage4/requests/dns/create_record.rb on lines 2..54

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 1 other location

      module Fog
        module DNS
          class Rage4
            class Real
              # Updates an existing record
      lib/fog/rage4/requests/dns/update_record.rb on lines 2..54

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Very high overall complexity: 351

      require 'fog/ibm/core'
      
      module Fog
        module Compute
          class IBM < Fog::Service

      When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

      Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

      Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

      Refactorings

      Further Reading

      Very complex method in #save

              def save
                unless persisted?
                  #Lame ...
                  raise RuntimeError, "Should not be here"
                else

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Very complex method in #post_instantiate_vapp_template

            model_path 'fog/vcloud_director/models/compute'
            model      :catalog
            collection :catalogs
            model      :organization
            collection :organizations

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Similar code found in 1 other location

      require 'fog/cloudstack/core'
      require 'digest/md5'
      
      module Fog
        module Compute
      lib/fog/cloudstack/requests/compute/revoke_security_group_egress.rb on lines 2..46

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 1 other location

      require 'fog/cloudstack/core'
      require 'digest/md5'
      
      module Fog
        module Compute
      lib/fog/cloudstack/requests/compute/revoke_security_group_ingress.rb on lines 2..46

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Identical code found in 1 other location

      require 'fog/joyent/core'
      require 'fog/joyent/errors'
      
      module Fog
        module Compute
      lib/fog/joyent/analytics.rb on lines 268..278

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Identical code found in 1 other location

      require 'fog/joyent'
      require 'fog/joyent/errors'
      require 'thread'
      
      module Fog
      lib/fog/joyent/compute.rb on lines 228..238

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Identical code found in 1 other location

      # t.template_str
      # CPU="0.2"
      # VCPU="2"
      # MEMORY="2048"
      # SCHED_REQUIREMENTS="NFS=\"true\""
      lib/fog/opennebula/requests/compute/list_groups.rb on lines 49..61

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Identical code found in 1 other location

      # t.template_str
      # CPU="0.2"
      # VCPU="2"
      # MEMORY="2048"
      # SCHED_REQUIREMENTS="NFS=\"true\""
      lib/fog/opennebula/requests/compute/list_groups.rb on lines 23..35

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Very complex method in #get_bucket

            request :put_object
            request :put_object_acl
            request :put_object_url
            request :put_request_payment
            request :sync_clock

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More