timcase/echonest

Similar code found in 1 other location

require 'echowrap/base'

module Echowrap
  class Asset < Echowrap::Base
    attr_reader :explicit, :filename, :id, :release, :title, :type, :year
Found in Echowrap::Asset and 1 other location - About 3 hrs to fix
lib/echowrap/feed.rb on lines 3..9

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 'echowrap/base'

module Echowrap
  class Feed < Echowrap::Base
    attr_reader :name, :url, :date_posted, :date_found, :id, :summary, :type
Found in Echowrap::Feed and 1 other location - About 3 hrs to fix
lib/echowrap/asset.rb on lines 3..8

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

Complex method in .attr_reader

    def self.attr_reader(*attrs)
      #@attr_readers ||= []
      #@attr_readers.concat attrs

      mod = Module.new do
Found in Echowrap::Base - 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

Join us for Code Climate
Summit on July 19 in NYC.

Tickets on sale now.