padrino/padrino-framework

View on GitHub

Showing 56 of 214 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def create_model_file(name, options={})
  model_path = destination_root(options[:app], 'models', "#{name.to_s.underscore}.rb")
  field_tuples = options[:fields].map { |value| value.split(":") }
  column_declarations = field_tuples.map { |field, kind| "field :#{field}, :#{kind}" }.join("\n  ")
  model_contents = DYNAMOID_MODEL.gsub(/!NAME!/, name.to_s.underscore.camelize)
padrino-gen/lib/padrino-gen/generators/components/orms/minirecord.rb on lines 160..166

Duplicated Code

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).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

module Padrino
  module Rendering
    class SlimOutputBuffer < Temple::Generators::StringBuffer
      define_options :buffer_class => 'SafeBuffer'

Severity: Major
Found in padrino-helpers/lib/padrino/rendering/slim_template.rb and 1 other location - About 1 hr to fix
padrino-helpers/lib/padrino/rendering/hamlit_template.rb on lines 1..24

Duplicated Code

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).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

module Padrino
  module Rendering
    class HamlitOutputBuffer < Temple::Generators::StringBuffer
      define_options :buffer_class => 'SafeBuffer'

Severity: Major
Found in padrino-helpers/lib/padrino/rendering/hamlit_template.rb and 1 other location - About 1 hr to fix
padrino-helpers/lib/padrino/rendering/slim_template.rb on lines 1..24

Duplicated Code

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).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def create_model_file(name, options={})
  model_path = destination_root(options[:app], 'models', "#{name.to_s.underscore}.rb")
  field_tuples = options[:fields].map { |value| value.split(":") }
  column_declarations = field_tuples.map { |field, kind| "property :#{field}" }.join("\n  ")
  model_contents = CR_MODEL.gsub(/!NAME!/, name.to_s.underscore.camelize)
padrino-gen/lib/padrino-gen/generators/components/orms/ohm.rb on lines 50..56

Duplicated Code

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).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def create_model_file(name, options={})
    model_path = destination_root(options[:app], 'models', "#{name.to_s.underscore}.rb")
    field_tuples = options[:fields].map { |value| value.split(":") }
    column_declarations = field_tuples.map { |field, kind| "attribute :#{field}" }.join("\n  ")
    model_contents = OHM_MODEL.gsub(/!NAME!/, name.to_s.underscore.camelize)
padrino-gen/lib/padrino-gen/generators/components/orms/couchrest.rb on lines 40..46

Duplicated Code

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).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  Popover.prototype.arrow = function () {
    return this.$arrow = this.$arrow || this.tip().find('.arrow')
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js on lines 336..338

Duplicated Code

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).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  Tooltip.prototype.arrow = function () {
    return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js on lines 72..74

Duplicated Code

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).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js on lines 57..57

Duplicated Code

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).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js on lines 58..58

Duplicated Code

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).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    return $e.attr('data-content')
      || (typeof o.content == 'function' ?
            o.content.call($e[0]) :
            o.content)
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js on lines 326..327

Duplicated Code

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).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    title = $e.attr('data-original-title')
      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js on lines 66..69

Duplicated Code

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).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  $.fn.tab.noConflict = function () {
    $.fn.tab = old
    return this
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js on lines 114..117
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js on lines 77..80
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js on lines 91..94
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js on lines 173..176
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js on lines 142..145
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js on lines 132..135
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js on lines 215..218
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js on lines 137..140

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  $.fn.scrollspy.noConflict = function () {
    $.fn.scrollspy = old
    return this
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js on lines 114..117
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js on lines 77..80
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js on lines 91..94
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js on lines 173..176
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js on lines 142..145
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js on lines 132..135
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js on lines 215..218
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js on lines 111..114

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  $.fn.modal.noConflict = function () {
    $.fn.modal = old
    return this
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js on lines 114..117
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js on lines 77..80
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js on lines 91..94
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js on lines 173..176
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js on lines 142..145
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js on lines 132..135
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js on lines 137..140
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js on lines 111..114

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        $(this).addClass('list-row-action-wrapper-link-active')
          .siblings('.list-row-action-popover-delete-one').first().show()
          .find('.cancel').on('click', function() {

            $(this).parents('.list-row-action-popover-delete-one').hide()
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/application.js on lines 89..98

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  $.fn.alert.noConflict = function () {
    $.fn.alert = old
    return this
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js on lines 114..117
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js on lines 91..94
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js on lines 173..176
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js on lines 142..145
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js on lines 132..135
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js on lines 215..218
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js on lines 137..140
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js on lines 111..114

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  $.fn.carousel.noConflict = function () {
    $.fn.carousel = old
    return this
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js on lines 114..117
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js on lines 77..80
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js on lines 91..94
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js on lines 142..145
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js on lines 132..135
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js on lines 215..218
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js on lines 137..140
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js on lines 111..114

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        $(this).addClass('active')
          .siblings('.list-menu-popover-delete-selected').first().show()
          .find('.cancel').on('click', function() {
          
            // Hide the popover on cancel
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/application.js on lines 38..44

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  $.fn.collapse.noConflict = function () {
    $.fn.collapse = old
    return this
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js on lines 114..117
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js on lines 77..80
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js on lines 91..94
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js on lines 173..176
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js on lines 132..135
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js on lines 215..218
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js on lines 137..140
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js on lines 111..114

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  $.fn.dropdown.noConflict = function () {
    $.fn.dropdown = old
    return this
  }
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js on lines 114..117
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js on lines 77..80
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js on lines 91..94
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js on lines 173..176
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js on lines 142..145
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js on lines 215..218
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js on lines 137..140
padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js on lines 111..114

Duplicated Code

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).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language