Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

Method plan has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def plan(host, service_level, purpose_role, purpose_usage, purpose_addons)
          fail _("Host %s has not been registered with subscription-manager.") % host.name unless host.subscription_facet

          host.subscription_facet.service_level = service_level unless service_level.nil?
          host.subscription_facet.purpose_role = purpose_role unless purpose_role.nil?
Severity: Minor
Found in app/lib/actions/katello/host/update_system_purpose.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method update_acss has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def update_acss(acs, smart_proxies_to_update, products_to_associate, products_to_disassociate)
          smart_proxies_to_update&.each do |smart_proxy|
            if acs.custom? || acs.rhui?
              smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.find_by(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: nil)
              plan_action(Pulp3::Orchestration::AlternateContentSource::Update, smart_proxy_acs)
Severity: Minor
Found in app/lib/actions/katello/alternate_content_source/update.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method call has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def call(env)
    prepare!(env)
    response = @app.call(env)

    session_data = env[ActionDispatch::Session::AbstractStore::ENV_SESSION_KEY]
Severity: Minor
Found in lib/katello/url_constrained_cookie_store.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method plan has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def plan(target_repo, smart_proxy, source_repositories, options = {})
            filter_ids = options.fetch(:filters, nil)&.map(&:id)
            rpm_filenames = options.fetch(:rpm_filenames, nil)
            solve_dependencies = options.fetch(:solve_dependencies, false)

Severity: Minor
Found in app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        def find_by_repository_name(_key, operator, value)
          conditions = sanitize_sql_for_conditions(["#{Katello::RootRepository.table_name}.name #{operator} ?", value_to_sql(operator, value)])
          facets = Katello::Host::ContentFacet.joins_repositories.where(conditions)
          if facets.empty?
            { :conditions => "1=0" }
Severity: Major
Found in app/models/katello/concerns/content_facet_host_extensions.rb and 3 other locations - About 55 mins to fix
app/models/katello/concerns/content_facet_host_extensions.rb on lines 90..96
app/models/katello/concerns/content_facet_host_extensions.rb on lines 128..134
app/models/katello/concerns/content_facet_host_extensions.rb on lines 138..144

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

    param :content_overrides, Array, :desc => N_("Array of Content override parameters to be added in bulk") do
      param :content_label, String, :desc => N_("Label of the content"), :required => true
      param :value, String, :desc => N_("Override value. Provide a boolean value if name is 'enabled'"), :required => false
      param :name, String, :desc => N_("Override parameter key or name. Note if name is not provided the default name will be 'enabled'"), :required => false
      param :remove, :bool, :desc => N_("Set true to remove an override and reset it to 'default'"), :required => false
Severity: Major
Found in app/controllers/katello/api/v2/activation_keys_controller.rb and 2 other locations - About 55 mins to fix
app/controllers/katello/api/v2/host_subscriptions_controller.rb on lines 172..177
app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb on lines 154..159

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

    param :content_overrides, Array, :desc => N_("Array of Content override parameters") do
      param :content_label, String, :desc => N_("Label of the content"), :required => true
      param :value, String, :desc => N_("Override value. Provide a boolean value if name is 'enabled'"), :required => false
      param :name, String, :desc => N_("Override key or name. Note if name is not provided the default name will be 'enabled'"), :required => false
      param :remove, :bool, :desc => N_("Set true to remove an override and reset it to 'default'"), :required => false
app/controllers/katello/api/v2/activation_keys_controller.rb on lines 226..231
app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb on lines 154..159

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

        def find_by_applicable_rpms(_key, operator, value)
          conditions = sanitize_sql_for_conditions(["#{Katello::Rpm.table_name}.nvra #{operator} ?", value_to_sql(operator, value)])
          hosts = ::Host::Managed.joins(:applicable_rpms).where(conditions)
          if hosts.empty?
            { :conditions => "1=0" }
Severity: Minor
Found in app/models/katello/concerns/content_facet_host_extensions.rb and 1 other location - About 55 mins to fix
app/models/katello/concerns/content_facet_host_extensions.rb on lines 80..86

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

        def find_by_installable_rpms(_key, operator, value)
          conditions = sanitize_sql_for_conditions(["#{Katello::Rpm.table_name}.nvra #{operator} ?", value_to_sql(operator, value)])
          facets = Katello::Host::ContentFacet.joins_installable_rpms.where(conditions)
          if facets.empty?
            { :conditions => "1=0" }
Severity: Major
Found in app/models/katello/concerns/content_facet_host_extensions.rb and 3 other locations - About 55 mins to fix
app/models/katello/concerns/content_facet_host_extensions.rb on lines 90..96
app/models/katello/concerns/content_facet_host_extensions.rb on lines 138..144
app/models/katello/concerns/content_facet_host_extensions.rb on lines 148..154

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

        def find_by_repository_content_label(_key, operator, value)
          conditions = sanitize_sql_for_conditions(["#{Katello::Content.table_name}.label #{operator} ?", value_to_sql(operator, value)])
          facets = Katello::Host::ContentFacet.joins_repositories.where(conditions)
          if facets.empty?
            { :conditions => "1=0" }
Severity: Major
Found in app/models/katello/concerns/content_facet_host_extensions.rb and 3 other locations - About 55 mins to fix
app/models/katello/concerns/content_facet_host_extensions.rb on lines 90..96
app/models/katello/concerns/content_facet_host_extensions.rb on lines 128..134
app/models/katello/concerns/content_facet_host_extensions.rb on lines 148..154

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

        def find_by_applicable_errata(_key, operator, value)
          conditions = sanitize_sql_for_conditions(["#{Katello::Erratum.table_name}.errata_id #{operator} ?", value_to_sql(operator, value)])
          hosts = ::Host::Managed.joins(:applicable_errata).where(conditions)
          if hosts.empty?
            { :conditions => "1=0" }
Severity: Minor
Found in app/models/katello/concerns/content_facet_host_extensions.rb and 1 other location - About 55 mins to fix
app/models/katello/concerns/content_facet_host_extensions.rb on lines 118..124

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

    param :content_overrides, Array, :desc => N_("Array of Content override parameters") do
      param :content_label, String, :desc => N_("Label of the content"), :required => true
      param :value, String, :desc => N_("Override value. Provide a boolean value if name is 'enabled'"), :required => false
      param :name, String, :desc => N_("Override key or name. Note if name is not provided the default name will be 'enabled'"), :required => false
      param :remove, :bool, :desc => N_("Set true to remove an override and reset it to 'default'"), :required => false
app/controllers/katello/api/v2/activation_keys_controller.rb on lines 226..231
app/controllers/katello/api/v2/host_subscriptions_controller.rb on lines 172..177

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

        def find_by_installable_errata(_key, operator, value)
          conditions = sanitize_sql_for_conditions(["#{Katello::Erratum.table_name}.errata_id #{operator} ?", value_to_sql(operator, value)])
          facets = Katello::Host::ContentFacet.joins_installable_errata.where(conditions)
          if facets.empty?
            { :conditions => "1=0" }
Severity: Major
Found in app/models/katello/concerns/content_facet_host_extensions.rb and 3 other locations - About 55 mins to fix
app/models/katello/concerns/content_facet_host_extensions.rb on lines 128..134
app/models/katello/concerns/content_facet_host_extensions.rb on lines 138..144
app/models/katello/concerns/content_facet_host_extensions.rb on lines 148..154

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

  const {
    getByText,
    queryByText,
    getAllByText,
    getByLabelText,
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 248..253
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 289..294
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 369..374
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 421..426
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 478..483
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 702..707

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

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

  const {
    queryByText,
    getAllByText,
    getByLabelText,
    getAllByLabelText,
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 248..253
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 369..374
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 421..426
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 478..483
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 512..517
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 702..707

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

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

  const {
    queryByText,
    getAllByText,
    getByLabelText,
    getAllByLabelText,
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 289..294
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 369..374
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 421..426
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 478..483
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 512..517
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 702..707

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

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

  const {
    getByText,
    queryByText,
    getAllByText,
    getByLabelText,
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 248..253
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 289..294
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 421..426
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 478..483
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 512..517
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 702..707

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

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

  const {
    queryByText,
    getAllByText,
    getByLabelText,
    getAllByLabelText,
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 248..253
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 289..294
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 369..374
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 421..426
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 478..483
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 512..517

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

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

  const {
    getByText,
    queryByText,
    getAllByText,
    getByLabelText,
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 248..253
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 289..294
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 369..374
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 421..426
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 512..517
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 702..707

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

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

  const {
    queryByText,
    getAllByText,
    getByLabelText,
    getAllByLabelText,
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 248..253
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 289..294
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 369..374
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 478..483
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 512..517
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 702..707

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

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