thoughtbot/administrate

Similar code found in 2 other locations

require "rails/generators/base"

module Administrate
  module Generators
    module Assets
lib/generators/administrate/assets/javascripts_generator.rb on lines 3..12
lib/generators/administrate/assets/stylesheets_generator.rb on lines 3..12

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 "rails/generators/base"

module Administrate
  module Generators
    module Assets
lib/generators/administrate/assets/images_generator.rb on lines 3..12
lib/generators/administrate/assets/stylesheets_generator.rb on lines 3..12

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 "rails/generators/base"

module Administrate
  module Generators
    module Assets
lib/generators/administrate/assets/images_generator.rb on lines 3..12
lib/generators/administrate/assets/javascripts_generator.rb on lines 3..12

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

Expected '===' and instead saw '=='.

    if (event.type=="click" ||

Why do I see this error?

This is a bit of a catch-all JSHint error that needs to be explained on a case by case basis. In the case of equality operators, for example, you may see Expected '==' and instead saw '===' - please see this article for more details about JavaScript and equality.

Expected '===' and instead saw '=='.

        event.keyCode == keycodes.space ||

Why do I see this error?

This is a bit of a catch-all JSHint error that needs to be explained on a case by case basis. In the case of equality operators, for example, you may see Expected '==' and instead saw '===' - please see this article for more details about JavaScript and equality.

Expected '===' and instead saw '=='.

        event.keyCode == keycodes.enter) {

Why do I see this error?

This is a bit of a catch-all JSHint error that needs to be explained on a case by case basis. In the case of equality operators, for example, you may see Expected '==' and instead saw '===' - please see this article for more details about JavaScript and equality.

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

Tickets on sale now.