CMDBrew/adminterface

View on GitHub

Showing 82 of 93 total issues

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

class PasswordInputGroupingTest < ActiveAdmin::InputTestCase
  test "renders prepend" do
    form = build_form do |f|
      f.inputs do
        f.input :secret, as: :password, prepend: content_tag(:span, "prepend text", class: "input-group-text")
Severity: Major
Found in test/lib/extensions/inputs/password_input_test.rb and 14 other locations - About 1 hr to fix
test/lib/extensions/inputs/color_input_test.rb on lines 32..50
test/lib/extensions/inputs/country_input_test.rb on lines 42..60
test/lib/extensions/inputs/datalist_input_test.rb on lines 47..65
test/lib/extensions/inputs/date_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/datetime_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/email_input_test.rb on lines 42..60
test/lib/extensions/inputs/file_input_test.rb on lines 42..60
test/lib/extensions/inputs/number_input_test.rb on lines 42..60
test/lib/extensions/inputs/phone_input_test.rb on lines 42..60
test/lib/extensions/inputs/search_input_test.rb on lines 42..60
test/lib/extensions/inputs/string_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_picker_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_zone_input_test.rb on lines 42..60
test/lib/extensions/inputs/url_input_test.rb on lines 42..60

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

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

class PhoneInputGroupingTest < ActiveAdmin::InputTestCase
  test "renders prepend" do
    form = build_form do |f|
      f.inputs do
        f.input :telephone, as: :phone, prepend: content_tag(:span, "prepend text", class: "input-group-text")
Severity: Major
Found in test/lib/extensions/inputs/phone_input_test.rb and 14 other locations - About 1 hr to fix
test/lib/extensions/inputs/color_input_test.rb on lines 32..50
test/lib/extensions/inputs/country_input_test.rb on lines 42..60
test/lib/extensions/inputs/datalist_input_test.rb on lines 47..65
test/lib/extensions/inputs/date_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/datetime_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/email_input_test.rb on lines 42..60
test/lib/extensions/inputs/file_input_test.rb on lines 42..60
test/lib/extensions/inputs/number_input_test.rb on lines 42..60
test/lib/extensions/inputs/password_input_test.rb on lines 42..60
test/lib/extensions/inputs/search_input_test.rb on lines 42..60
test/lib/extensions/inputs/string_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_picker_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_zone_input_test.rb on lines 42..60
test/lib/extensions/inputs/url_input_test.rb on lines 42..60

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

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

class UrlInputGroupingTest < ActiveAdmin::InputTestCase
  test "renders prepend" do
    form = build_form do |f|
      f.inputs do
        f.input :website, as: :url, prepend: content_tag(:span, "prepend text", class: "input-group-text")
Severity: Major
Found in test/lib/extensions/inputs/url_input_test.rb and 14 other locations - About 1 hr to fix
test/lib/extensions/inputs/color_input_test.rb on lines 32..50
test/lib/extensions/inputs/country_input_test.rb on lines 42..60
test/lib/extensions/inputs/datalist_input_test.rb on lines 47..65
test/lib/extensions/inputs/date_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/datetime_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/email_input_test.rb on lines 42..60
test/lib/extensions/inputs/file_input_test.rb on lines 42..60
test/lib/extensions/inputs/number_input_test.rb on lines 42..60
test/lib/extensions/inputs/password_input_test.rb on lines 42..60
test/lib/extensions/inputs/phone_input_test.rb on lines 42..60
test/lib/extensions/inputs/search_input_test.rb on lines 42..60
test/lib/extensions/inputs/string_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_picker_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_zone_input_test.rb on lines 42..60

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

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

class DatetimePickerInputGroupingTest < ActiveAdmin::InputTestCase
  test "renders prepend" do
    form = build_form do |f|
      f.inputs do
        f.input :updated_at, as: :datetime_picker, prepend: content_tag(:span, "prepend text", class: "input-group-text")
Severity: Major
Found in test/lib/extensions/inputs/datetime_picker_input_test.rb and 14 other locations - About 1 hr to fix
test/lib/extensions/inputs/color_input_test.rb on lines 32..50
test/lib/extensions/inputs/country_input_test.rb on lines 42..60
test/lib/extensions/inputs/datalist_input_test.rb on lines 47..65
test/lib/extensions/inputs/date_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/email_input_test.rb on lines 42..60
test/lib/extensions/inputs/file_input_test.rb on lines 42..60
test/lib/extensions/inputs/number_input_test.rb on lines 42..60
test/lib/extensions/inputs/password_input_test.rb on lines 42..60
test/lib/extensions/inputs/phone_input_test.rb on lines 42..60
test/lib/extensions/inputs/search_input_test.rb on lines 42..60
test/lib/extensions/inputs/string_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_picker_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_zone_input_test.rb on lines 42..60
test/lib/extensions/inputs/url_input_test.rb on lines 42..60

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

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

class TimePickerInputGroupingTest < ActiveAdmin::InputTestCase
  test "renders prepend" do
    form = build_form do |f|
      f.inputs do
        f.input :updated_at, as: :time_picker, prepend: content_tag(:span, "prepend text", class: "input-group-text")
Severity: Major
Found in test/lib/extensions/inputs/time_picker_input_test.rb and 14 other locations - About 1 hr to fix
test/lib/extensions/inputs/color_input_test.rb on lines 32..50
test/lib/extensions/inputs/country_input_test.rb on lines 42..60
test/lib/extensions/inputs/datalist_input_test.rb on lines 47..65
test/lib/extensions/inputs/date_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/datetime_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/email_input_test.rb on lines 42..60
test/lib/extensions/inputs/file_input_test.rb on lines 42..60
test/lib/extensions/inputs/number_input_test.rb on lines 42..60
test/lib/extensions/inputs/password_input_test.rb on lines 42..60
test/lib/extensions/inputs/phone_input_test.rb on lines 42..60
test/lib/extensions/inputs/search_input_test.rb on lines 42..60
test/lib/extensions/inputs/string_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_zone_input_test.rb on lines 42..60
test/lib/extensions/inputs/url_input_test.rb on lines 42..60

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

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

class CountryInputGroupingTest < ActiveAdmin::InputTestCase
  test "renders prepend" do
    form = build_form do |f|
      f.inputs do
        f.input :country, as: :country, prepend: content_tag(:span, "prepend text", class: "input-group-text")
Severity: Major
Found in test/lib/extensions/inputs/country_input_test.rb and 14 other locations - About 1 hr to fix
test/lib/extensions/inputs/color_input_test.rb on lines 32..50
test/lib/extensions/inputs/datalist_input_test.rb on lines 47..65
test/lib/extensions/inputs/date_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/datetime_picker_input_test.rb on lines 57..75
test/lib/extensions/inputs/email_input_test.rb on lines 42..60
test/lib/extensions/inputs/file_input_test.rb on lines 42..60
test/lib/extensions/inputs/number_input_test.rb on lines 42..60
test/lib/extensions/inputs/password_input_test.rb on lines 42..60
test/lib/extensions/inputs/phone_input_test.rb on lines 42..60
test/lib/extensions/inputs/search_input_test.rb on lines 42..60
test/lib/extensions/inputs/string_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_picker_input_test.rb on lines 42..60
test/lib/extensions/inputs/time_zone_input_test.rb on lines 42..60
test/lib/extensions/inputs/url_input_test.rb on lines 42..60

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

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

  _defaultInputHTMLOptions () {
    const options = {
      class: `form-check-input ${this.options.as}`,
      type: 'checkbox'
    }
Severity: Major
Found in app/javascript/adminterface/lib/inputs/boolean_input.js and 1 other location - About 1 hr to fix
app/javascript/adminterface/lib/inputs/color_input.js on lines 4..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 60.

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

  _defaultInputHTMLOptions () {
    const options = {
      class: `form-control form-control-color ${this.options.as}`,
      type: 'color'
    }
Severity: Major
Found in app/javascript/adminterface/lib/inputs/color_input.js and 1 other location - About 1 hr to fix
app/javascript/adminterface/lib/inputs/boolean_input.js on lines 12..19

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

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

    test "updates components" do
      assert_equal("rtl", @application.lang_dir)
      assert_equal({input: "string"}, @application.components[:comments].deep_symbolize_keys)
      assert_equal(
        {
Severity: Major
Found in test/lib/configurations_test.rb and 2 other locations - About 1 hr to fix
test/lib/configurations_test.rb on lines 70..79
test/lib/configurations_test.rb on lines 114..123

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

    test "updates components" do
      assert_equal "rtl", @namespace.lang_dir
      assert_equal({input: "string"}, @namespace.components[:comments].deep_symbolize_keys)
      assert_equal(
        {
Severity: Major
Found in test/lib/configurations_test.rb and 2 other locations - About 1 hr to fix
test/lib/configurations_test.rb on lines 35..44
test/lib/configurations_test.rb on lines 114..123

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

    test "updates components" do
      assert_equal "rtl", @resource.lang_dir
      assert_equal({input: "string"}, @resource.components[:comments].deep_symbolize_keys)
      assert_equal(
        {
Severity: Major
Found in test/lib/configurations_test.rb and 2 other locations - About 1 hr to fix
test/lib/configurations_test.rb on lines 35..44
test/lib/configurations_test.rb on lines 70..79

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

  _getAllTimeZones () {
    const timeZones = adminterface.meta.timeZones

    if (timeZones.error) {
      console.error(timeZones)
Severity: Major
Found in app/javascript/adminterface/lib/inputs/time_zone_input.js and 1 other location - About 1 hr to fix
app/javascript/adminterface/lib/inputs/country_input.js on lines 52..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 56.

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

  _getAllCountries () {
    const countries = adminterface.meta.countries

    if (countries.error) {
      console.error(countries)
Severity: Major
Found in app/javascript/adminterface/lib/inputs/country_input.js and 1 other location - About 1 hr to fix
app/javascript/adminterface/lib/inputs/time_zone_input.js on lines 30..39

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

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

class CheckBoxesInputTest < ActiveAdmin::InputTestCase
  setup do
    @form = build_form do |f|
      f.inputs do
        f.input :interests, as: :check_boxes, collection: %w[movies]
Severity: Minor
Found in test/lib/extensions/inputs/check_boxes_input_test.rb and 1 other location - About 55 mins to fix
test/lib/extensions/inputs/radio_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 46.

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

class RadioInputTest < ActiveAdmin::InputTestCase
  setup do
    @form = build_form do |f|
      f.inputs do
        f.input :interests, as: :radio, collection: %w[movies]
Severity: Minor
Found in test/lib/extensions/inputs/radio_input_test.rb and 1 other location - About 55 mins to fix
test/lib/extensions/inputs/check_boxes_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 46.

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

      const restOfCountries = this.countries.filter(function (item) {
        return !priorityCountries.find(el => el.code === item.code)
      })
Severity: Minor
Found in app/javascript/adminterface/lib/inputs/country_input.js and 1 other location - About 55 mins to fix
app/javascript/adminterface/lib/inputs/time_zone_input.js on lines 22..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 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

      const restOfTimeZones = this.timeZones.filter(function (item) {
        return !priorityTimeZones.find(el => el.name === item.name)
      })
Severity: Minor
Found in app/javascript/adminterface/lib/inputs/time_zone_input.js and 1 other location - About 55 mins to fix
app/javascript/adminterface/lib/inputs/country_input.js on lines 44..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 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

  class PageView < ::ActiveAdmin::IntegrationTestHelper::MockActionView
    def active_admin_config
      @active_admin_config ||= PageTest::PageResource.new(active_admin_namespace, "PageTest", {})
    end

Severity: Minor
Found in test/lib/extensions/views/pages/page_test.rb and 1 other location - About 55 mins to fix
test/lib/extensions/views/pages/base_test.rb on lines 12..30

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

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

  class PageView < ::ActiveAdmin::IntegrationTestHelper::MockActionView
    def active_admin_config
      @active_admin_config ||= BasePageTest::PageResource.new(active_admin_namespace, "BasePageTest", {})
    end

Severity: Minor
Found in test/lib/extensions/views/pages/base_test.rb and 1 other location - About 55 mins to fix
test/lib/extensions/views/pages/page_test.rb on lines 12..30

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

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 ColorInputTest < ActiveAdmin::InputTestCase
  setup do
    @form = build_form do |f|
      f.inputs do
        f.input :favorite_color, as: :color
Severity: Major
Found in test/lib/extensions/inputs/color_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/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

Severity
Category
Status
Source
Language