CMDBrew/adminterface

View on GitHub

Showing 82 of 93 total issues

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

  if (clearFilterBtn) {
    clearFilterBtn.addEventListener('click', Filters._clearForm)
    adminterface.addObserver(clearFilterBtn, { events: { click: Filters._clearForm } }, 'filters.clear')
  }
Severity: Major
Found in app/javascript/adminterface/initializers/filters.js and 2 other locations - About 50 mins to fix
app/javascript/adminterface/initializers/filters.js on lines 14..17
app/javascript/adminterface/initializers/per_page.js on lines 7..11

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 4 locations. Consider refactoring.
Open

class BooleanInputTest < ActiveAdmin::InputTestCase
  setup do
    @form = build_form do |f|
      f.inputs do
        f.input :accept, as: :boolean
Severity: Major
Found in test/lib/extensions/inputs/boolean_input_test.rb and 3 other locations - About 50 mins to fix
test/lib/extensions/inputs/color_input_test.rb on lines 3..25
test/lib/extensions/inputs/range_input_test.rb on lines 3..25
test/lib/extensions/inputs/switch_input_test.rb on lines 3..25

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

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 4 locations. Consider refactoring.
Open

class SwitchInputTest < ActiveAdmin::InputTestCase
  setup do
    @form = build_form do |f|
      f.inputs do
        f.input :accept, as: :switch
Severity: Major
Found in test/lib/extensions/inputs/switch_input_test.rb and 3 other locations - About 50 mins to fix
test/lib/extensions/inputs/boolean_input_test.rb on lines 3..25
test/lib/extensions/inputs/color_input_test.rb on lines 3..25
test/lib/extensions/inputs/range_input_test.rb on lines 3..25

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

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 3 locations. Consider refactoring.
Open

  if (target) {
    target.addEventListener('change', PerPage._update)

    adminterface.addObserver(target, { events: { change: PerPage._update } }, 'perPage')
  }
Severity: Major
Found in app/javascript/adminterface/initializers/per_page.js and 2 other locations - About 50 mins to fix
app/javascript/adminterface/initializers/filters.js on lines 9..12
app/javascript/adminterface/initializers/filters.js on lines 14..17

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 3 locations. Consider refactoring.
Open

  if (filterForm) {
    filterForm.addEventListener('submit', Filters._disableEmptyInputFields)
    adminterface.addObserver(filterForm, { events: { submit: Filters._disableEmptyInputFields } }, 'filters.submit')
  }
Severity: Major
Found in app/javascript/adminterface/initializers/filters.js and 2 other locations - About 50 mins to fix
app/javascript/adminterface/initializers/filters.js on lines 9..12
app/javascript/adminterface/initializers/per_page.js on lines 7..11

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

  tooltipTriggerList.map((el) => {
    const instance = new Tooltip(el)
    adminterface.addObserver(el, instance, instance.constructor.name)
    return instance
  })
Severity: Minor
Found in app/javascript/adminterface/initializers/bootstrap.js and 1 other location - About 50 mins to fix
app/javascript/adminterface/initializers/bootstrap.js on lines 8..12

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

  popoverTriggerList.map((el) => {
    const instance = new Popover(el)
    adminterface.addObserver(el, instance, instance.constructor.name)
    return instance
  })
Severity: Minor
Found in app/javascript/adminterface/initializers/bootstrap.js and 1 other location - About 50 mins to fix
app/javascript/adminterface/initializers/bootstrap.js on lines 14..18

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 4 locations. Consider refactoring.
Open

class RangeInputTest < ActiveAdmin::InputTestCase
  setup do
    @form = build_form do |f|
      f.inputs do
        f.input :volume, as: :range
Severity: Major
Found in test/lib/extensions/inputs/range_input_test.rb and 3 other locations - About 50 mins to fix
test/lib/extensions/inputs/boolean_input_test.rb on lines 3..25
test/lib/extensions/inputs/color_input_test.rb on lines 3..25
test/lib/extensions/inputs/switch_input_test.rb on lines 3..25

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

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 Adminterface
  module Extensions
    module Inputs
      module CountryInput
        include Base
Severity: Minor
Found in lib/adminterface/extensions/inputs/country_input.rb and 1 other location - About 50 mins to fix
lib/adminterface/extensions/inputs/time_zone_input.rb on lines 1..20

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

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 Adminterface
  module Extensions
    module Inputs
      module TimeZoneInput
        include Base
Severity: Minor
Found in lib/adminterface/extensions/inputs/time_zone_input.rb and 1 other location - About 50 mins to fix
lib/adminterface/extensions/inputs/country_input.rb on lines 1..20

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

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 3 locations. Consider refactoring.
Open

  _optionsHTML () {
    const collection = this.options.collection || []
    return collection.length ? this._optionsForSelect(collection) : ''
  }
Severity: Major
Found in app/javascript/adminterface/lib/inputs/select_input.js and 2 other locations - About 40 mins to fix
app/javascript/adminterface/lib/inputs/choices_input.js on lines 83..86
app/javascript/adminterface/lib/inputs/datalist_input.js on lines 31..34

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 3 locations. Consider refactoring.
Open

  _choicesHTML () {
    const collection = this.options.collection || []
    return collection.length ? this._choices(collection) : ''
  }
Severity: Major
Found in app/javascript/adminterface/lib/inputs/choices_input.js and 2 other locations - About 40 mins to fix
app/javascript/adminterface/lib/inputs/datalist_input.js on lines 31..34
app/javascript/adminterface/lib/inputs/select_input.js on lines 58..61

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 3 locations. Consider refactoring.
Open

  _optionsHTML () {
    const collection = this.options.collection || []
    return collection.length ? this._optionsForSelect(collection) : ''
  }
Severity: Major
Found in app/javascript/adminterface/lib/inputs/datalist_input.js and 2 other locations - About 40 mins to fix
app/javascript/adminterface/lib/inputs/choices_input.js on lines 83..86
app/javascript/adminterface/lib/inputs/select_input.js on lines 58..61

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 12 locations. Consider refactoring.
Open

module PhoneInputScenarios
  extend ActiveSupport::Concern

  def find_wrapper(form)
    @wrapper ||= form.find(".input.phone")
Severity: Major
Found in test/lib/extensions/inputs/phone_input_test.rb and 11 other locations - About 40 mins to fix
test/lib/extensions/inputs/country_input_test.rb on lines 3..22
test/lib/extensions/inputs/email_input_test.rb on lines 3..22
test/lib/extensions/inputs/file_input_test.rb on lines 3..22
test/lib/extensions/inputs/number_input_test.rb on lines 3..22
test/lib/extensions/inputs/password_input_test.rb on lines 3..22
test/lib/extensions/inputs/search_input_test.rb on lines 3..22
test/lib/extensions/inputs/select_input_test.rb on lines 3..22
test/lib/extensions/inputs/string_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_picker_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_zone_input_test.rb on lines 3..22
test/lib/extensions/inputs/url_input_test.rb on lines 3..22

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

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 12 locations. Consider refactoring.
Open

module UrlInputScenarios
  extend ActiveSupport::Concern

  def find_wrapper(form)
    @wrapper ||= form.find(".input.url")
Severity: Major
Found in test/lib/extensions/inputs/url_input_test.rb and 11 other locations - About 40 mins to fix
test/lib/extensions/inputs/country_input_test.rb on lines 3..22
test/lib/extensions/inputs/email_input_test.rb on lines 3..22
test/lib/extensions/inputs/file_input_test.rb on lines 3..22
test/lib/extensions/inputs/number_input_test.rb on lines 3..22
test/lib/extensions/inputs/password_input_test.rb on lines 3..22
test/lib/extensions/inputs/phone_input_test.rb on lines 3..22
test/lib/extensions/inputs/search_input_test.rb on lines 3..22
test/lib/extensions/inputs/select_input_test.rb on lines 3..22
test/lib/extensions/inputs/string_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_picker_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_zone_input_test.rb on lines 3..22

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

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 12 locations. Consider refactoring.
Open

module StringInputScenarios
  extend ActiveSupport::Concern

  def find_wrapper(form)
    @wrapper ||= form.find(".input.string")
Severity: Major
Found in test/lib/extensions/inputs/string_input_test.rb and 11 other locations - About 40 mins to fix
test/lib/extensions/inputs/country_input_test.rb on lines 3..22
test/lib/extensions/inputs/email_input_test.rb on lines 3..22
test/lib/extensions/inputs/file_input_test.rb on lines 3..22
test/lib/extensions/inputs/number_input_test.rb on lines 3..22
test/lib/extensions/inputs/password_input_test.rb on lines 3..22
test/lib/extensions/inputs/phone_input_test.rb on lines 3..22
test/lib/extensions/inputs/search_input_test.rb on lines 3..22
test/lib/extensions/inputs/select_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_picker_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_zone_input_test.rb on lines 3..22
test/lib/extensions/inputs/url_input_test.rb on lines 3..22

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

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 12 locations. Consider refactoring.
Open

module EmailInputScenarios
  extend ActiveSupport::Concern

  def find_wrapper(form)
    @wrapper ||= form.find(".input.email")
Severity: Major
Found in test/lib/extensions/inputs/email_input_test.rb and 11 other locations - About 40 mins to fix
test/lib/extensions/inputs/country_input_test.rb on lines 3..22
test/lib/extensions/inputs/file_input_test.rb on lines 3..22
test/lib/extensions/inputs/number_input_test.rb on lines 3..22
test/lib/extensions/inputs/password_input_test.rb on lines 3..22
test/lib/extensions/inputs/phone_input_test.rb on lines 3..22
test/lib/extensions/inputs/search_input_test.rb on lines 3..22
test/lib/extensions/inputs/select_input_test.rb on lines 3..22
test/lib/extensions/inputs/string_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_picker_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_zone_input_test.rb on lines 3..22
test/lib/extensions/inputs/url_input_test.rb on lines 3..22

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

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 12 locations. Consider refactoring.
Open

module PasswordInputScenarios
  extend ActiveSupport::Concern

  def find_wrapper(form)
    @wrapper ||= form.find(".input.password")
Severity: Major
Found in test/lib/extensions/inputs/password_input_test.rb and 11 other locations - About 40 mins to fix
test/lib/extensions/inputs/country_input_test.rb on lines 3..22
test/lib/extensions/inputs/email_input_test.rb on lines 3..22
test/lib/extensions/inputs/file_input_test.rb on lines 3..22
test/lib/extensions/inputs/number_input_test.rb on lines 3..22
test/lib/extensions/inputs/phone_input_test.rb on lines 3..22
test/lib/extensions/inputs/search_input_test.rb on lines 3..22
test/lib/extensions/inputs/select_input_test.rb on lines 3..22
test/lib/extensions/inputs/string_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_picker_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_zone_input_test.rb on lines 3..22
test/lib/extensions/inputs/url_input_test.rb on lines 3..22

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

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 12 locations. Consider refactoring.
Open

module TimeZoneInputScenarios
  extend ActiveSupport::Concern

  def find_wrapper(form)
    @wrapper ||= form.find(".input.time_zone")
Severity: Major
Found in test/lib/extensions/inputs/time_zone_input_test.rb and 11 other locations - About 40 mins to fix
test/lib/extensions/inputs/country_input_test.rb on lines 3..22
test/lib/extensions/inputs/email_input_test.rb on lines 3..22
test/lib/extensions/inputs/file_input_test.rb on lines 3..22
test/lib/extensions/inputs/number_input_test.rb on lines 3..22
test/lib/extensions/inputs/password_input_test.rb on lines 3..22
test/lib/extensions/inputs/phone_input_test.rb on lines 3..22
test/lib/extensions/inputs/search_input_test.rb on lines 3..22
test/lib/extensions/inputs/select_input_test.rb on lines 3..22
test/lib/extensions/inputs/string_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_picker_input_test.rb on lines 3..22
test/lib/extensions/inputs/url_input_test.rb on lines 3..22

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

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 12 locations. Consider refactoring.
Open

module SearchInputScenarios
  extend ActiveSupport::Concern

  def find_wrapper(form)
    @wrapper ||= form.find(".input.search")
Severity: Major
Found in test/lib/extensions/inputs/search_input_test.rb and 11 other locations - About 40 mins to fix
test/lib/extensions/inputs/country_input_test.rb on lines 3..22
test/lib/extensions/inputs/email_input_test.rb on lines 3..22
test/lib/extensions/inputs/file_input_test.rb on lines 3..22
test/lib/extensions/inputs/number_input_test.rb on lines 3..22
test/lib/extensions/inputs/password_input_test.rb on lines 3..22
test/lib/extensions/inputs/phone_input_test.rb on lines 3..22
test/lib/extensions/inputs/select_input_test.rb on lines 3..22
test/lib/extensions/inputs/string_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_picker_input_test.rb on lines 3..22
test/lib/extensions/inputs/time_zone_input_test.rb on lines 3..22
test/lib/extensions/inputs/url_input_test.rb on lines 3..22

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

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