Fog::Compute::VcloudDirector::Real
F

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)
Found in Fog::Compute::VcloudDirector::Real - About 3 wks to fix

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 #post_instantiate_vapp_template

      model_path 'fog/vcloud_director/models/compute'
      model      :catalog
      collection :catalogs
      model      :organization
      collection :organizations
Found in Fog::Compute::VcloudDirector::Real - About 2 days to fix

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_guest_customization_section_vapp

      collection :organizations
      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_execute_query

      collection :tasks
      model      :vm
      collection :vms
      model      :vm_customization
      collection :vm_customizations
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_catalogs_from_query

      collection :organizations
      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_disks_from_query

      collection :organizations
      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_groups_from_query

      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
      model      :template_vm
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_medias_from_query

      collection :organizations
      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_organizations_from_query

      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
      model      :template_vm
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_users_from_query

      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
      model      :template_vm
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_vapp_templates_from_query

      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
      model      :template_vm
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_vapps_in_lease_from_query

      collection :organizations
      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_vdcs_from_query

      collection :organizations
      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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 #get_vms_in_lease_from_query

      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
      model      :template_vm
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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_network_connection_system_section_vapp


      secrets :vcloud_director_password

      model_path 'fog/vcloud_director/models/compute'
      model      :catalog
Found in Fog::Compute::VcloudDirector::Real - About 1 day to fix

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

Complex method in #post_capture_vapp

    class VcloudDirector < Fog::Service
      module Defaults
        PATH        = '/api'
        PORT        = 443
        SCHEME      = 'https'
Found in Fog::Compute::VcloudDirector::Real - About 5 hrs to fix

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

Complex method in #get_edge_gateway

        attributes[attribute.localname.to_sym] = attribute.value
      end
    end
    attributes
  end
Found in Fog::Compute::VcloudDirector::Real - About 4 hrs to fix

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

Complex method in #do_request

        def do_request(params)
          headers = {
            'Accept' => "application/*+xml;version=#{@api_version}",
            'x-vcloud-authorization' => vcloud_token
          }
Found in Fog::Compute::VcloudDirector::Real - About 3 hrs to fix

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

Complex method in #post_upload_disk


      requires :vcloud_director_username, :vcloud_director_password, :vcloud_director_host
      recognizes :vcloud_director_api_version, :vcloud_director_show_progress, :path, :vcloud_token

      secrets :vcloud_director_password
Found in Fog::Compute::VcloudDirector::Real - About 3 hrs to fix

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

Complex method in #post_clone_vapp

      module Defaults
        PATH        = '/api'
        PORT        = 443
        SCHEME      = 'https'
        API_VERSION = '5.1'
Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #post_update_catalog_item_metadata

        attribute = attributes_xml.shift
        attributes[attribute.localname.to_sym] = attribute.value
      end
    end
    attributes
Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #post_update_disk_metadata

        attribute = attributes_xml.shift
        attributes[attribute.localname.to_sym] = attribute.value
      end
    end
    attributes
Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #post_update_media_metadata

        attribute = attributes_xml.shift
        attributes[attribute.localname.to_sym] = attribute.value
      end
    end
    attributes
Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #post_update_vapp_metadata

        attribute = attributes_xml.shift
        attributes[attribute.localname.to_sym] = attribute.value
      end
    end
    attributes
Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #post_update_vapp_template_metadata

        attribute = attributes_xml.shift
        attributes[attribute.localname.to_sym] = attribute.value
      end
    end
    attributes
Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #login

        def login
          @vcloud_token ||= ENV['FOG_VCLOUD_TOKEN']
          if @vcloud_token
            response = get_current_session
            session_org = response.body[:org]
Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #generate_instantiate_vapp_template_request

      requires :vcloud_director_username, :vcloud_director_password, :vcloud_director_host
      recognizes :vcloud_director_api_version, :vcloud_director_show_progress, :path, :vcloud_token

      secrets :vcloud_director_password

Found in Fog::Compute::VcloudDirector::Real - About 2 hrs to fix

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

Complex method in #initialize

        def initialize(options={})
          @vcloud_director_password = options[:vcloud_director_password]
          @vcloud_director_username = options[:vcloud_director_username]
          @connection_options = options[:connection_options] || {}
          @connection_options[:omit_default_port] = Fog::Compute::VcloudDirector::Defaults::OMIT_DEFAULT_PORT unless @connection_options[:omit_default_port]
Found in Fog::Compute::VcloudDirector::Real - About 1 hr to fix

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

Complex method in #post_create_catalog_item

class NonLoaded
end

module Fog
  module Compute
Found in Fog::Compute::VcloudDirector::Real - About 1 hr to fix

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 8 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 days to fix
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

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 2 days to fix
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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 2 days to fix
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

Similar code found in 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/post_update_catalog_item_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_media_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_vapp_template_metadata.rb on lines 2..47

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/post_update_catalog_item_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_disk_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_media_metadata.rb on lines 2..47

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/post_update_catalog_item_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_disk_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_vapp_template_metadata.rb on lines 2..47

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/post_update_disk_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_media_metadata.rb on lines 2..47
lib/fog/vcloud_director/requests/compute/post_update_vapp_template_metadata.rb on lines 2..47

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 1 day to fix
lib/fog/vcloud_director/requests/compute/get_disk_owner.rb on lines 2..65

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 1 day to fix
lib/fog/vcloud_director/requests/compute/get_media_owner.rb on lines 2..65

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/put_media_metadata_item_metadata.rb on lines 2..45
lib/fog/vcloud_director/requests/compute/put_vapp_template_metadata_item_metadata.rb on lines 2..45

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/put_catalog_item_metadata_item_metadata.rb on lines 2..45
lib/fog/vcloud_director/requests/compute/put_media_metadata_item_metadata.rb on lines 2..45

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/put_catalog_item_metadata_item_metadata.rb on lines 2..45
lib/fog/vcloud_director/requests/compute/put_vapp_template_metadata_item_metadata.rb on lines 2..45

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/get_current_session.rb on lines 74..78
lib/fog/vcloud_director/requests/compute/get_organization.rb on lines 91..95
lib/fog/vcloud_director/requests/compute/get_organizations.rb on lines 43..47

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/get_current_session.rb on lines 74..78
lib/fog/vcloud_director/requests/compute/get_organization.rb on lines 91..95
lib/fog/vcloud_director/requests/compute/get_vcloud.rb on lines 67..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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/post_detach_disk.rb on lines 2..34
lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb on lines 2..34

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/post_detach_disk.rb on lines 2..34
lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb on lines 2..34

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 1 day to fix
lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb on lines 2..34
lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb on lines 2..34

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 6 hrs to fix
lib/fog/vcloud_director/requests/compute/post_create_catalog_item.rb on lines 37..51

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 6 hrs to fix
lib/fog/vcloud_director/requests/compute/post_instantiate_vapp_template.rb on lines 114..128

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/vcloud_director/core'
require 'fog/vcloud_director/query'

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 6 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb on lines 29..31

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 6 hrs to fix
lib/fog/vcloud_director/requests/compute/post_compose_vapp.rb on lines 2..40
lib/fog/vcloud_director/requests/compute/post_create_snapshot.rb on lines 2..16

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 6 hrs to fix
lib/fog/vcloud_director/requests/compute/post_create_snapshot.rb on lines 2..16
lib/fog/vcloud_director/requests/compute/post_recompose_vapp.rb on lines 2..16

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 6 hrs to fix
lib/fog/vcloud_director/requests/compute/post_compose_vapp.rb on lines 2..40
lib/fog/vcloud_director/requests/compute/post_recompose_vapp.rb on lines 2..16

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/vcloud_director/core'
require 'fog/vcloud_director/query'

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 5 hrs to fix
lib/fog/vcloud_director/requests/compute/get_organizations.rb on lines 39..41

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/vcloud_director/core'
require 'fog/vcloud_director/query'

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 5 hrs to fix
lib/fog/vcloud_director/requests/compute/get_task.rb on lines 144..147

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/post_reconfigure_vm.rb on lines 71..77

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/post_reconfigure_vm.rb on lines 62..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

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/post_clone_media.rb on lines 28..36

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb on lines 2..20

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)
Found in Fog::Compute::VcloudDirector::Real and 8 other locations - About 4 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb on lines 2..23

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb on lines 4..22
lib/fog/vcloud_director/requests/compute/get_vm_pending_question.rb on lines 4..29

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb on lines 4..22
lib/fog/vcloud_director/requests/compute/get_vms_disk_attached_to.rb on lines 4..22

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/generators/compute/disks.rb on lines 157..157

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vm_customization.rb on lines 4..26
lib/fog/vcloud_director/requests/compute/get_vm_network.rb on lines 4..26

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vm_disks.rb on lines 4..26
lib/fog/vcloud_director/requests/compute/get_vm_network.rb on lines 4..26

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/delete_catalog_item_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_disk_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_vapp_template_metadata_item_metadata.rb on lines 2..21

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/delete_catalog_item_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_disk_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_media_metadata_item_metadata.rb on lines 2..20

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/delete_catalog_item_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_media_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_vapp_template_metadata_item_metadata.rb on lines 2..21

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 3 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 3 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/delete_disk_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_media_metadata_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/delete_vapp_template_metadata_item_metadata.rb on lines 2..21

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb on lines 4..31

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/post_clone_media.rb on lines 73..78

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_entity.rb on lines 24..33

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_task_list.rb on lines 90..99

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_execute_query.rb on lines 227..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

Similar code found in 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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 23 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 23 other locations - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_org_settings.rb on lines 2..33
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb on lines 2..21
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb on lines 2..20
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb on lines 2..24
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb on lines 2..19

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_shadow_vm.rb on lines 2..19

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vapp_template.rb on lines 2..20

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 2 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 2 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/put_network.rb on lines 56..63
lib/fog/vcloud_director/requests/compute/put_vm.rb on lines 26..33

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb on lines 2..23

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 16 other locations

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
Found in Fog::Compute::VcloudDirector::Real and 16 other locations - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb on lines 2..23
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb on lines 2..25
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb on lines 2..19
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb on lines 2..22
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb on lines 2..28
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb on lines 2..28

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/delete_vapp_template.rb on lines 2..22

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/delete_shadow_vm.rb on lines 2..25

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/get_organization.rb on lines 30..32

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vapp_ovf_descriptor.rb on lines 2..19

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)
Found in Fog::Compute::VcloudDirector::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vapp_template_ovf_descriptor.rb on lines 2..19

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

There are no issues that match your filters.

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

class VcloudDirectorParser < Fog::Parsers::Base
  def extract_attributes(attributes_xml)
    attributes = {}
    until attributes_xml.empty?
      if attributes_xml.first.is_a?(Array)
        until attributes_xml.first.empty?
          attribute = attributes_xml.first.shift
          attributes[attribute.localname.to_sym] = attribute.value
        end
      else
        attribute = attributes_xml.shift
        attributes[attribute.localname.to_sym] = attribute.value
      end
    end
    attributes
  end
end

class NonLoaded
end

module Fog
  module Compute
    class VcloudDirector < Fog::Service
      module Defaults
        PATH        = '/api'
        PORT        = 443
        SCHEME      = 'https'
        API_VERSION = '5.1'
        OMIT_DEFAULT_PORT = true
      end

      class ServiceError < Fog::VcloudDirector::Errors::ServiceError; end

      class BadRequest < Fog::VcloudDirector::Errors::BadRequest; end
      class Unauthorized < Fog::VcloudDirector::Errors::Unauthorized; end
      class Forbidden < Fog::VcloudDirector::Errors::Forbidden; end
      class Conflict < Fog::VcloudDirector::Errors::Conflict; end
      class MalformedResponse < Fog::VcloudDirector::Errors::MalformedResponse; end

      class DuplicateName < Fog::VcloudDirector::Errors::DuplicateName; end
      class TaskError < Fog::VcloudDirector::Errors::TaskError; end

      requires :vcloud_director_username, :vcloud_director_password, :vcloud_director_host
      recognizes :vcloud_director_api_version, :vcloud_director_show_progress, :path, :vcloud_token

      secrets :vcloud_director_password

      model_path 'fog/vcloud_director/models/compute'
      model      :catalog
      collection :catalogs
      model      :organization
      collection :organizations
      model      :catalog_item
      collection :vapp_templates
      model      :vapp_template
      collection :template_vms
      model      :template_vm
      collection :catalog_items
      model      :custom_field
      collection :custom_fields
      model      :vdc
      collection :vdcs
      model      :vapp
      collection :vapps
      model      :task
      collection :tasks
      model      :vm
      collection :vms
      model      :vm_customization
      collection :vm_customizations
      model      :network
      collection :networks
      model      :disk
      collection :disks
      model      :vm_network
      collection :vm_networks
      model      :tag # this is called metadata in vcloud
      collection :tags
      model      :media
      collection :medias # sic

      request_path 'fog/vcloud_director/requests/compute'
      request :delete_catalog_item
      request :delete_catalog_item_metadata_item_metadata
      request :delete_disk
      request :delete_disk_metadata_item_metadata
      request :delete_logout
      request :delete_media
      request :delete_media_metadata_item_metadata
      request :delete_network
      request :delete_shadow_vm
      request :delete_vapp
      request :delete_vapp_metadata_item_metadata
      request :delete_vapp_template
      request :delete_vapp_template_metadata_item_metadata
      request :get_allocated_ip_addresses
      request :get_catalog
      request :get_catalog_item
      request :get_catalog_item_metadata
      request :get_catalog_item_metadata_item_metadata
      request :get_catalog_metadata
      request :get_catalog_metadata_item_metadata
      request :get_catalogs_from_query
      request :get_control_access_params_catalog
      request :get_control_access_params_vapp
      request :get_cpu_rasd_item
      request :get_current_session
      request :get_disk
      request :get_disk_metadata
      request :get_disk_metadata_item_metadata
      request :get_disk_owner
      request :get_disks_from_query
      request :get_disks_rasd_items_list
      request :get_edge_gateway
      request :get_entity
      request :get_execute_query
      request :get_groups_from_query
      request :get_guest_customization_system_section_vapp
      request :get_guest_customization_system_section_vapp_template
      request :get_href # this is used for manual testing
      request :get_lease_settings_section_vapp
      request :get_lease_settings_section_vapp_template
      request :get_media
      request :get_media_drives_rasd_items_list
      request :get_media_metadata
      request :get_media_metadata_item_metadata
      request :get_media_owner
      request :get_medias_from_query
      request :get_memory_rasd_item
      request :get_metadata
      request :get_network
      request :get_network_cards_items_list
      request :get_network_complete
      request :get_network_config_section_vapp
      request :get_network_config_section_vapp_template
      request :get_network_connection_system_section_vapp
      request :get_network_connection_system_section_vapp_template
      request :get_network_metadata
      request :get_network_metadata_item_metadata
      request :get_network_section_vapp
      request :get_network_section_vapp_template
      request :get_operating_system_section
      request :get_org_settings
      request :get_org_vdc_gateways
      request :get_organization
      request :get_organization_metadata
      request :get_organization_metadata_item_metadata
      request :get_organizations
      request :get_organizations_from_query
      request :get_product_sections_vapp
      request :get_product_sections_vapp_template
      request :get_request # this is used for manual testing
      request :get_runtime_info_section_type
      request :get_serial_ports_items_list
      request :get_shadow_vm
      request :get_snapshot_section
      request :get_startup_section
      request :get_supported_systems_info
      request :get_supported_versions
      request :get_task
      request :get_task_list
      request :get_template_vm
      request :get_template_vms
      request :get_thumbnail
      request :get_users_from_query
      request :get_vapp
      request :get_vapp_metadata
      request :get_vapp_metadata_item_metadata
      request :get_vapp_ovf_descriptor
      request :get_vapp_owner
      request :get_vapp_template
      request :get_vapp_template_customization_system_section
      request :get_vapp_template_metadata
      request :get_vapp_template_metadata_item_metadata
      request :get_vapp_template_ovf_descriptor
      request :get_vapp_template_owner
      request :get_vapp_templates_from_query
      request :get_vapps_in_lease_from_query
      request :get_vcloud
      request :get_vdc
      request :get_vdc_metadata
      request :get_vdc_metadata_item_metadata
      request :get_vdc_storage_class
      request :get_vdc_storage_class_metadata
      request :get_vdc_storage_class_metadata_item_metadata
      request :get_vdcs_from_query
      request :get_virtual_hardware_section
      request :get_vm
      request :get_vm_capabilities
      request :get_vm_compliance_results
      request :get_vm_customization
      request :get_vm_disks
      request :get_vm_network
      request :get_vm_pending_question
      request :get_vms
      request :get_vms_by_metadata
      request :get_vms_disk_attached_to
      request :get_vms_in_lease_from_query
      request :instantiate_vapp_template # to be deprecated
      request :post_acquire_ticket
      request :post_answer_vm_pending_question
      request :post_attach_disk
      request :post_cancel_task
      request :post_capture_vapp
      request :post_check_vm_compliance
      request :post_clone_media
      request :post_clone_vapp
      request :post_clone_vapp_template
      request :post_configure_edge_gateway_services
      request :post_consolidate_vm_vapp
      request :post_consolidate_vm_vapp_template
      request :post_create_catalog_item
      request :post_create_org_vdc_network
      request :post_deploy_vapp
      request :post_compose_vapp
      request :post_recompose_vapp
      request :post_detach_disk
      request :post_disable_nested_hv
      request :post_disable_vapp_template_download
      request :post_discard_vapp_state
      request :post_eject_cd_rom
      request :post_enable_nested_hv
      request :post_enable_vapp_template_download
      request :post_enter_maintenance_mode
      request :post_exit_maintenance_mode
      request :post_insert_cd_rom
      request :post_install_vmware_tools
      request :post_instantiate_vapp_template
      request :post_login_session
      request :post_power_off_vapp
      request :post_power_on_vapp
      request :post_reboot_vapp
      request :post_reconfigure_vm
      request :post_remove_all_snapshots
      request :post_reset_vapp
      request :post_revert_snapshot
      request :post_shutdown_vapp
      request :post_suspend_vapp
      request :post_undeploy_vapp
      request :post_update_catalog_item_metadata
      request :post_update_disk_metadata
      request :post_update_media_metadata
      request :post_update_vapp_metadata
      request :post_update_vapp_template_metadata
      request :post_upgrade_hw_version
      request :post_upload_disk
      request :post_upload_media
      request :post_upload_vapp_template
      request :post_create_snapshot
      request :put_catalog_item_metadata_item_metadata
      request :put_cpu
      request :put_disk_metadata_item_metadata
      request :put_disks
      request :put_guest_customization_section_vapp
      request :put_media_metadata_item_metadata
      request :put_memory
      request :put_metadata_value # deprecated
      request :put_network
      request :put_network_connection_system_section_vapp
      request :put_product_sections
      request :put_vapp_metadata_item_metadata
      request :put_vapp_name_and_description
      request :put_vapp_template_metadata_item_metadata
      request :put_vm
      request :put_vm_capabilities

      class Model < Fog::Model
        def initialize(attrs={})
          super(attrs)
          lazy_load_attrs.each do |attr|
            attributes[attr]= NonLoaded if attributes[attr].nil?
            make_lazy_load_method(attr)
          end
          self.class.attributes.each {|attr| make_attr_loaded_method(attr)}
        end

        def lazy_load_attrs
          @lazy_load_attrs ||= self.class.attributes - attributes.keys
        end

        def make_lazy_load_method(attr)
          self.class.instance_eval do
            define_method(attr) do
              reload if attributes[attr] == NonLoaded and !@inspecting
              attributes[attr]
            end
          end
        end

        # it adds an attr_loaded? method to know if the value has been loaded
        # yet or not: ie description_loaded?
        def make_attr_loaded_method(attr)
          self.class.instance_eval do
            define_method("#{attr}_loaded?") do
              attributes[attr] != NonLoaded
            end
          end
        end

        def inspect
          @inspecting = true
          out = super
          @inspecting = false
          out
        end
      end

      class Collection < Fog::Collection
        def all(lazy_load=true)
          lazy_load ? index : get_everyone
        end

        def get(item_id)
          item = get_by_id(item_id)
          return nil unless item
          new(item)
        end

        def get_by_name(item_name)
          item_found = item_list.find {|item| item[:name] == item_name}
          return nil unless item_found
          get(item_found[:id])
        end

        def index
          load(item_list)
        end

        def get_everyone
          items = item_list.map {|item| get_by_id(item[:id])}
          load(items)
        end
      end

      class Real
        extend Fog::Deprecation
        deprecate :auth_token, :vcloud_token

        attr_reader :end_point, :api_version, :show_progress
        alias_method :show_progress?, :show_progress

        def initialize(options={})
          @vcloud_director_password = options[:vcloud_director_password]
          @vcloud_director_username = options[:vcloud_director_username]
          @connection_options = options[:connection_options] || {}
          @connection_options[:omit_default_port] = Fog::Compute::VcloudDirector::Defaults::OMIT_DEFAULT_PORT unless @connection_options[:omit_default_port]
          @host       = options[:vcloud_director_host]
          @path       = options[:path]        || Fog::Compute::VcloudDirector::Defaults::PATH
          @persistent = options[:persistent]  || false
          @port       = options[:port]        || Fog::Compute::VcloudDirector::Defaults::PORT
          @scheme     = options[:scheme]      || Fog::Compute::VcloudDirector::Defaults::SCHEME
          @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
          @end_point = "#{@scheme}://#{@host}#{@path}/"
          @api_version = options[:vcloud_director_api_version] || Fog::Compute::VcloudDirector::Defaults::API_VERSION
          @show_progress = options[:vcloud_director_show_progress]
          @show_progress = $stdin.tty? if @show_progress.nil?
          @vcloud_token  = options[:vcloud_token]
        end

        def vcloud_token
          login if @vcloud_token.nil?
          @vcloud_token
        end

        def org_name
          login if @org_name.nil?
          @org_name
        end

        def user_name
          login if @user_name.nil?
          @user_name
        end

        def reload
          @connection.reset
        end

        def request(params)
          begin
            do_request(params)
          rescue EOFError
            # This error can occur if Vcloud receives a request from a network
            # it deems to be unauthorized; no HTTP response is sent, but the
            # connection is sent a signal to terminate early.
            raise(
              MalformedResponse, "Connection unexpectedly terminated by vcloud"
            )
          # this is to know if Excon::Errors::Unauthorized really happens
          #rescue Excon::Errors::Unauthorized
          #  login
          #  do_request(params)
          end
        end

        # @api private
        def do_request(params)
          headers = {
            'Accept' => "application/*+xml;version=#{@api_version}",
            'x-vcloud-authorization' => vcloud_token
          }
          if params[:path]
            if params[:override_path] == true
              path = params[:path]
            else
              path = "#{@path}/#{params[:path]}"
            end
          else
            path = "#{@path}"
          end
          @connection.request({
            :body       => params[:body],
            :expects    => params[:expects],
            :headers    => headers.merge!(params[:headers] || {}),
            :idempotent => params[:idempotent],
            :method     => params[:method],
            :parser     => params[:parser],
            :path       => path,
            :query      => params[:query]
          })
        rescue Excon::Errors::HTTPStatusError => error
          raise case error
          when Excon::Errors::BadRequest   then BadRequest.slurp(error);
          when Excon::Errors::Unauthorized then Unauthorized.slurp(error);
          when Excon::Errors::Forbidden    then Forbidden.slurp(error);
          when Excon::Errors::Conflict     then Conflict.slurp(error);
          else                                  ServiceError.slurp(error)
          end
        end

        def process_task(response_body)
          task = make_task_object(response_body)
          wait_and_raise_unless_success(task)
          true
        end

        def make_task_object(task_response)
          task_response[:id] = task_response[:href].split('/').last
          tasks.new(task_response)
        end

        def wait_and_raise_unless_success(task)
          task.wait_for { non_running? }
          raise TaskError.new "status: #{task.status}, error: #{task.error}" unless task.success?
        end

        def add_id_from_href!(data={})
          data[:id] = data[:href].split('/').last
        end

        # Compensate for Fog::ToHashDocument shortcomings.
        # @api private
        # @param [Hash] hash
        # @param [String,Symbol] key1
        # @param [String,Symbol] key2
        # @return [Hash]
        def ensure_list!(hash, key1, key2=nil)
          if key2.nil?
            hash[key1] ||= []
            hash[key1] = [hash[key1]] if hash[key1].is_a?(Hash)
          else
            hash[key1] ||= {key2 => []}
            hash[key1] = {key2 => []} if hash[key1].empty?
            hash[key1][key2] = [hash[key1][key2]] if hash[key1][key2].is_a?(Hash)
          end
          hash
        end

        private

        def login
          @vcloud_token ||= ENV['FOG_VCLOUD_TOKEN']
          if @vcloud_token
            response = get_current_session
            session_org = response.body[:org]
            session_user = response.body[:user]

            check_session_matches_credentials(session_org, session_user)
          else
            response = post_login_session
            x_vcloud_authorization = response.headers.keys.find do |key|
              key.downcase == 'x-vcloud-authorization'
            end
            @vcloud_token = response.headers[x_vcloud_authorization]
          end

          @org_name = response.body[:org]
          @user_name = response.body[:user]
        end

        # @note This isn't needed.
        def logout
          delete_logout
          @vcloud_token = nil
          @org_name = nil
        end

        def check_session_matches_credentials(session_org, session_user)
          fog_credential_org = @vcloud_director_username.split('@').last
          fog_credential_user = @vcloud_director_username.split('@')[0...-1].join('@')

          if session_org != fog_credential_org
            raise Fog::Errors::Error.new "FOG_CREDENTIAL specified is for vCloud organisation '#{fog_credential_org}' but " +
              "your current session is for '#{session_org}'. You should generate a new FOG_VCLOUD_TOKEN."
          end

          if session_user != fog_credential_user
            raise Fog::Errors::Error.new "FOG_CREDENTIAL specified is for user '#{fog_credential_user}' but " +
              "your current session is for '#{session_user}'. You should generate a new FOG_VCLOUD_TOKEN."
          end
        end
      end

      class Mock
        attr_reader :end_point, :api_version

        # This is used in some mocks so it's a method rather than a variable
        def default_network_uuid
          @default_network_uuid ||= uuid
        end

        def data
          @@data ||= Hash.new do |hash, key|

            vdc1_uuid = uuid
            vdc2_uuid = uuid
            uplink_network_uuid  = uuid
            isolated_vdc1_network_uuid = uuid
            isolated_vdc2_network_uuid = uuid
            vapp1_id = "vapp-#{uuid}"
            vapp2_id = "vapp-#{uuid}"
            vapp1vm1_id = "vm-#{uuid}"
            vapp2vm1_id = "vm-#{uuid}"
            vapp2vm2_id = "vm-#{uuid}"
            catalog_uuid = uuid
            template_uuid = uuid

            hash[key] = {
              :catalogs => {
                catalog_uuid => {
                  :name => 'Default Catalog'
                }
              },
              :catalog_items => {
                uuid => {
                  :type    => 'vAppTemplate',
                  :name    => 'vAppTemplate 1',
                  :catalog => catalog_uuid,
                  :template_id => template_uuid
                }
              },
              :disks => {
                uuid => {
                  :name => 'Hard Disk 1',
                  :capacity => 10240,
                  :parent_vm => vapp1vm1_id
                }
              },
              :edge_gateways => {
                uuid => {
                  :name => 'MockEdgeGateway',
                  :networks => [uplink_network_uuid, default_network_uuid],
                  :vdc => vdc1_uuid,
                  :Configuration => {
                    :GatewayBackingConfig => "compact",
                    :GatewayInterfaces => {
                      :GatewayInterface => []},
                    :EdgeGatewayServiceConfiguration => {
                      :FirewallService => {
                        :IsEnabled => "true",
                        :DefaultAction => "drop",
                        :LogDefaultAction => "false",
                        :FirewallRule => []
                      },
                      :NatService => {:IsEnabled => "true"}},
                    :HaEnabled => "false",
                    :UseDefaultRouteForDnsRelay => "false"
                  }
                }
              },

              :medias => {},

              :networks => {

                default_network_uuid => {
                  :IsShared => true,
                  :vdc => vdc1_uuid,
                  :FenceMode => 'natRouted',
                  :ApplyRateLimit => "false",
                  :Description => 'Org Network for mocking',
                  :Dns1 => '8.8.8.8',
                  :Dns2 => '8.8.4.4',
                  :DnsSuffix => 'example.com',
                  :Gateway => '192.168.1.1',
                  :InterfaceType => "internal",
                  :IpRanges => [{
                    :StartAddress=>'192.168.1.2',
                    :EndAddress=>'192.168.1.254'
                  }],
                  :IsInherited => false,
                  :Netmask => '255.255.255.0',
                  :name => 'vDC1 Default Network',
                  :SubnetParticipation => {
                      :Gateway => "192.168.1.0",
                      :Netmask => "255.255.0.0",
                      :IpAddress => "192.168.1.0"
                  },
                  :UseForDefaultRoute => "false"
                },

                isolated_vdc1_network_uuid => {
                  :IsShared => false,
                  :vdc => vdc1_uuid,
                  :ApplyRateLimit => "false",
                  :FenceMode => 'isolated',
                  :Description => 'Org Network for mocking',
                  :Dns1 => '8.8.8.8',
                  :Dns2 => '8.8.4.4',
                  :DnsSuffix => 'example.com',
                  :InterfaceType => "internal",
                  :IpRanges => [{
                    :StartAddress=>'10.1.0.100',
                    :EndAddress=>'10.1.0.200'
                  }],
                  :IsInherited => false,
                  :Netmask => '255.255.255.0',
                  :name => 'vDC1 backend network',
                  :SubnetParticipation => {
                      :Gateway => "192.168.1.0",
                      :Netmask => "255.255.0.0",
                      :IpAddress => "192.168.1.0"
                  },
                  :UseForDefaultRoute => "false"
                },

                isolated_vdc2_network_uuid => {
                  :IsShared => false,
                  :vdc => vdc2_uuid,
                  :ApplyRateLimit => "false",
                  :Description => 'Org Network for mocking',
                  :Dns1 => '8.8.8.8',
                  :Dns2 => '8.8.4.4',
                  :DnsSuffix => 'example.com',
                  :InterfaceType => "internal",
                  :IpRanges => [{
                    :StartAddress=>'10.2.0.100',
                    :EndAddress=>'10.2.0.200'
                  }],
                  :IsInherited => false,
                  :Netmask => '255.255.255.0',
                  :name => 'vDC2 backend network',
                  :SubnetParticipation => {
                      :Gateway => "192.168.1.0",
                      :Netmask => "255.255.0.0",
                      :IpAddress => "192.168.1.0"
                  },
                  :UseForDefaultRoute => "false"
                },

                uplink_network_uuid => {
                  :IsShared => false,
                  :vdc => vdc1_uuid,
                  :ApplyRateLimit => "false",
                  :FenceMode => 'bridged',
                  :Description => 'Uplink Network for mocking',
                  :Dns1 => '8.8.8.8',
                  :Dns2 => '8.8.4.4',
                  :DnsSuffix => 'example.com',
                  :Gateway => '198.51.100.1',
                  :InterfaceType => "uplink",
                  :IpRanges => [{
                    :StartAddress=>'198.51.100.2',
                    :EndAddress=>'198.51.100.254'
                  }],
                  :IsInherited => false,
                  :Netmask => '255.255.255.0',
                  :name => 'uplink Network',
                  :SubnetParticipation => {
                    :Gateway => "198.51.100.81",
                    :Netmask => "255.255.255.248",
                    :IpAddress => "198.51.100.83",
                    :IpRanges => {
                      :IpRange => {
                        :StartAddress => "198.51.100.84",
                        :EndAddress => "198.51.100.86"
                      }
                    }
                  },
                  :UseForDefaultRoute => "true"
                }

              },
              :org => {
                :description => 'Organization for mocking',
                :full_name => 'Mock Organization',
                :name => org_name,
                :uuid => uuid
              },
              
              :tags => {},
              
              :tasks => {},

              :vapps => {
                vapp1_id => {
                  :name => 'mock-vapp-1',
                  :vdc_id => vdc1_uuid,
                  :description => "Mock vApp 1",
                  :networks => [
                    { :parent_id => default_network_uuid, },
                  ],
                },
                vapp2_id => {
                  :name => 'mock-vapp-2',
                  :vdc_id => vdc2_uuid,
                  :description => "Mock vApp 2",
                  :networks => [
                    { :parent_id => default_network_uuid },
                  ]
                },
              },

              :vdc_storage_classes => {
                uuid => {
                  :default => true,
                  :enabled => true,
                  :limit => 2 * 1024 * 1024,
                  :name => 'DefaultMockStorageClass',
                  :units => 'MB',
                  :vdc => vdc1_uuid,
                }
              },

              :vdcs => {
                vdc1_uuid => {
                  :description => 'vDC1 for mocking',
                  :name => 'MockVDC 1'
                },
                vdc2_uuid => {
                  :description => 'vDC2 for mocking',
                  :name => 'MockVDC 2'
                },
              },

              :vms => {
                vapp1vm1_id => {
                  :name => 'mock-vm-1-1',
                  :parent_vapp => vapp1_id,
                  :nics => [
                    {
                      :network_name => 'Default Network',
                      :mac_address => "00:50:56:aa:bb:01",
                      :ip_address => "192.168.1.33",
                    },
                  ],
                },
                vapp2vm1_id => {
                  :name => 'mock-vm-2-1',
                  :parent_vapp => vapp2_id,
                  :nics => [
                    {
                      :network_name => 'Default Network',
                      :mac_address => "00:50:56:aa:bb:02",
                      :ip_address => "192.168.1.34",
                    },
                  ],
                },
                vapp2vm2_id => {
                  :name => 'mock-vm-2-2',
                  :parent_vapp => vapp2_id,
                  :nics => [
                    {
                      :network_name => 'Default Network',
                      :mac_address => "00:50:56:aa:bb:03",
                      :ip_address => "192.168.1.35",
                    },
                  ],
                },
              },

            }
          end[@vcloud_director_username]
        end

        def initialize(options={})
          @vcloud_director_password = options[:vcloud_director_password]
          @vcloud_director_username = options[:vcloud_director_username]
          #@connection_options = options[:connection_options] || {}
          @host = options[:vcloud_director_host]
          @path = options[:path] || Fog::Compute::VcloudDirector::Defaults::PATH
          @persistent = options[:persistent] || false
          @port = options[:port] || Fog::Compute::VcloudDirector::Defaults::PORT
          @scheme = options[:scheme] || Fog::Compute::VcloudDirector::Defaults::SCHEME
          #@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
          @end_point    = "#{@scheme}://#{@host}#{@path}/"
          @api_version  = options[:vcloud_director_api_version] || Fog::Compute::VcloudDirector::Defaults::API_VERSION
          @vcloud_token = options[:vcloud_token]
        end

        def vcloud_token
          @vcloud_token || Fog::Mock.random_base64(32)
        end

        def org_name
          @org_name ||=
            begin
              username = @vcloud_director_username.split('@')
              if username.size >= 2 # may be 'email_address@org_name'
                username.last
              else
                Fog::Logger.warning('vcloud_director_username should be in the form user@org_name')
                'vcd_org_name'
              end
            end
        end

        def user_name
          @user_name ||= @vcloud_director_username.split('@').first
        end

        def user_uuid
          @user_uuid ||= uuid
        end

        def uuid
          [8,4,4,4,12].map {|i| Fog::Mock.random_hex(i)}.join('-')
        end

        # Create a task.
        #
        # @param [String] operation A message describing the operation that is
        #   tracked by this task.
        # @param [String] operation_name The short name of the operation that
        #   is tracked by this task.
        # @param [Hash] owner Reference to the owner of the task. This is
        #   typically the object that the task is creating or updating.
        #   * :href<~String> - Contains the URI to the entity.
        #   * :type<~String> - Contains the MIME type of the entity.
        # @return [String] Object identifier of the task.
        def enqueue_task(operation, operation_name, owner, options={})
          task_id = uuid
          now = DateTime.now

          data[:tasks][task_id] = {
            :cancel_requested => false,
            :details => '',
            :expiry_time => now + 86400, # in 24 hours
            :name => 'task',
            :progress => 1,
            :service_namespace => 'com.vmware.vcloud',
            :start_time => now,
            :end_time => now + 86400,
            :status => 'running',
          }.merge(options).merge(
            :operation => operation,
            :operation_name => operation_name,
            :owner => owner
          )

          task_id
        end

        # @note As far as this method is concerned, the only possible task
        #   states are 'running' and 'success'.
        #
        # @param [Hash] response_body
        # @return [Boolean]
        def process_task(response_body)
          task_id = response_body[:href].split('/').last
          task = data[:tasks][task_id]

          if task[:status] == 'running'
            task[:end_time] = DateTime.now
            task[:progress] = 100
            task[:status] = 'success'

            if task[:on_success]
              task[:on_success].call
              task.delete(:on_success)
            end
          end

          return true if task[:status] == 'success'
          raise TaskError.new "status: #{task[:status]}, error: #{task[:Error]}"
        end

        def add_id_from_href!(data={})
          data[:id] = data[:href].split('/').last
        end

        private

        def make_href(path)
          "#{@end_point}#{path}"
        end

        def xmlns
          'http://www.vmware.com/vcloud/v1.5'
        end

        def xmlns_xsi
          'http://www.w3.org/2001/XMLSchema-instance'
        end

        def xsi_schema_location
          "http://www.vmware.com/vcloud/v1.5 http://#{@host}#{@path}/v1.5/schema/master.xsd"
        end
      end
    end
  end
end

Size

Lines of code
800