sosedoff/opentable

Complex method in #to_hash

  def to_hash
    {
      "id"                 => record.restaurant_id,
      "name"               => record.name,
      "address"            => record.address,
Found in RestaurantSerializer - 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 #download_to

    def download_to(path, overwrite=false)
      path = File.expand_path(path)

      if File.exists?(path)
        if overwrite
Found in OpenTable::Downloader - 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 class definition

class Restaurant
  COUNTRIES = %w(AE AW CA CH CN CR GP HK KN KY MC MO MX MY PT SA SG SV US VI)
  
  include Mongoid::Document
  include Mongoid::Timestamps
Found in Restaurant - 1 hr to fix