fog/fog

Fog::DNS::Rage4::Real
F

Complex method in #create_record

        def update_record(record_id, name, content, type, options = {})
          path = "/rapi/updaterecord/#{record_id}"
          path << "?name=#{name}&content=#{content}&type=#{type}"

          path << "&priority=#{options[:priority]}" if options[:priority]
Found in Fog::DNS::Rage4::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 #update_record

        def update_record(record_id, name, content, type, options = {})
          path = "/rapi/updaterecord/#{record_id}"
          path << "?name=#{name}&content=#{content}&type=#{type}"

          path << "&priority=#{options[:priority]}" if options[:priority]
Found in Fog::DNS::Rage4::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

Similar code found in 1 other location

module Fog
  module DNS
    class Rage4
      class Real
        # Updates an existing record
Found in Fog::DNS::Rage4::Real and 1 other location - About 2 days to fix
lib/fog/rage4/requests/dns/create_record.rb on lines 2..54

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

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

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

Refactorings

Further Reading

Similar code found in 1 other location

module Fog
  module DNS
    class Rage4
      class Real
        # Updates an existing record
Found in Fog::DNS::Rage4::Real and 1 other location - About 2 days to fix
lib/fog/rage4/requests/dns/update_record.rb on lines 2..54

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

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

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

Refactorings

Further Reading

Similar code found in 1 other location

module Fog
  module DNS
    class Rage4
      class Real
        # Updates an existing record
Found in Fog::DNS::Rage4::Real and 1 other location - About 3 hrs to fix
lib/fog/dreamhost/dns.rb on lines 46..50

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.

module Fog
  module DNS
    class Rage4
      class Real
        # Updates an existing record
        # ==== Parameters
        # * record_id <~Integer> The id of the record you wish to update
        # * name <~String> Name of record, include domain name
        # * content <~String> IP address or Domain name
        # * type <~Integer> The type of record to create see list_record_types
        # * priority <~Integer> - Record prioirity (nullable)
        # * failover <~Boolean> Enable/disable failover default false
        # * failovercontent <~String> Failover value, only valid for A/AAAA records
        # * ttl <~Integer> - Time to live
        # * geozone <~Long> Geo region id, see list_geo_regions
        # * geolock <~Boolean> Lock geo coordinates, default false
        # * geolat <~Double> Geo latitude, (nullable)
        # * geolong <~Double> Geo longitude, (nullable)
        # * udplimit <~Boolean> Limit number of records returned, (nullable, default false)
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #      * 'status'<~Boolean>
        #      * 'id'<~Integer>
        #      * 'error'<~String>

# https://secure.rage4.com/rapi/createrecord/

        def update_record(record_id, name, content, type, options = {})
          path = "/rapi/updaterecord/#{record_id}"
          path << "?name=#{name}&content=#{content}&type=#{type}"

          path << "&priority=#{options[:priority]}" if options[:priority]

          failover = options[:failover] || 'false'
          path << "&failover=#{failover}"

          path << "&failovercontent=#{options[:failovercontent]}" if options[:failovercontent]

          ttl = options[:ttl] || 3600
          path << "&ttl=#{ttl}"

          path << "&geozone=#{options[:geozone]}" if options[:geozone]
          path << "&geolock=#{options[:geolock]}" if options[:geolock]
          path << "&geolat=#{options[:geolat]}"   if options[:geolat]
          path << "&geolong=#{options[:geolong]}" if options[:geolong]
          path << "&udplimit=#{options[:udplimit]}" if options[:udplimit]

          request(
                  :expects  => 200,
                  :method   => 'GET',
                  :path     => path
          )
        end
      end
    end
  end
end

Size

Lines of code
28