Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

        def plan(host, release_version)
          plan_self(:hostname => host.name)
          if host.content_facet && host.subscription_facet
            if release_version.present? && !host.content_facet.available_releases.include?(release_version)
              fail _("Host %{name} cannot be assigned release version %{release_version}.") % { :name => host.name, :release_version => release_version }
Severity: Minor
Found in app/lib/actions/katello/host/update_release_version.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

        def plan(acs, smart_proxies, products, acs_params)
          action_subject(acs)
          acs.update!(acs_params)

          smart_proxies = smart_proxies.uniq
Severity: Minor
Found in app/lib/actions/katello/alternate_content_source/update.rb - About 35 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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def run
            target_repo = ::Katello::Repository.find(input[:target_repository_id])
            if input[:skip_publication]
              #Need to clear smart proxy sync histories for non-publication content_types: docker, ansible collection
              target_repo.clear_smart_proxy_sync_histories if input[:contents_changed]
Severity: Minor
Found in app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb - About 35 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 config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def self.config
    url_root = ENV['RAILS_RELATIVE_URL_ROOT']
    base_config = {
      'markTranslated' => SETTINGS[:mark_translated] || false,
      'relativeUrlRoot' => url_root ? url_root + '/' : '/'
Severity: Minor
Found in engines/bastion/lib/bastion.rb - About 35 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 humanized_details has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def humanized_details
            ret = []
            ret << _("Cancelled.") if cancelled?
            if total_units == 0
              ret << _("Waiting to start.")
Severity: Minor
Found in app/lib/actions/pulp3/repository/presenters/repair_presenter.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

          def plan(repository, smart_proxy, args)
            file = {:filename => args.dig(:unit_key, :name), :sha256 => args.dig(:unit_key, :checksum) }
            content_unit_href = args.dig(:unit_key, :content_unit_id)
            docker_tag = (args.dig(:unit_type_id) == "docker_tag")

Severity: Minor
Found in app/lib/actions/pulp3/orchestration/repository/import_upload.rb - About 35 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 2 locations. Consider refactoring.
Open

      when :errata
        p = self.parameters[:errata_ids]
        msg = details[:event_messages][self.overall_status]
        return n_(msg[1], msg[2], p.length) % { errata: p.first, total: p.length - 1 }
Severity: Minor
Found in app/models/katello/task_status.rb and 1 other location - About 35 mins to fix
app/models/katello/task_status.rb on lines 174..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 35.

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

      when :package_group
        p = self.parameters[:groups]
        msg = details[:event_messages][self.overall_status]
        return n_(msg[1], msg[2], p.length) % { group: p.first, total: p.length - 1 }
Severity: Minor
Found in app/models/katello/task_status.rb and 1 other location - About 35 mins to fix
app/models/katello/task_status.rb on lines 178..181

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

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

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

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

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

Refactorings

Further Reading

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

      <DescriptionListGroup>
        <Term>{__('Synopsis')}</Term>
        <Description>{synopsis}</Description>
      </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

        <DescriptionListGroup>
          <DescriptionListTerm>{__('Model')}</DescriptionListTerm>
          <DescriptionListDescription>{model}</DescriptionListDescription>
        </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

        <DescriptionListGroup>
          <DescriptionListTerm>{__('Sockets')}</DescriptionListTerm>
          <DescriptionListDescription>{cpuSockets}</DescriptionListDescription>
        </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

      <DescriptionListGroup>
        <Term>{__('Summary')}</Term>
        <Description>{summary}</Description>
      </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

        <DescriptionListGroup>
          <DescriptionListTerm>{__('Cores per socket')}</DescriptionListTerm>
          <DescriptionListDescription>{coreSocket}</DescriptionListDescription>
        </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

jest.mock('../../hostDetailsHelpers', () => ({
  ...jest.requireActual('../../hostDetailsHelpers'),
  userPermissionsFromHostDetails: () => ({
    create_job_invocations: true,
    edit_hosts: true,
webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsCard.test.js on lines 56..62
webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js on lines 10..16
webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js on lines 11..17
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 11..17
webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js on lines 10..16

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

jest.mock('../../hostDetailsHelpers', () => ({
  ...jest.requireActual('../../hostDetailsHelpers'),
  userPermissionsFromHostDetails: () => ({
    create_job_invocations: true,
    edit_hosts: true,
webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsCard.test.js on lines 56..62
webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js on lines 10..16
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 11..17
webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js on lines 10..16
webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 11..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 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 9 locations. Consider refactoring.
Open

        <DescriptionListGroup>
          <DescriptionListTerm>{__('Content source')}</DescriptionListTerm>
          <DescriptionListDescription>{contentSourceName}</DescriptionListDescription>
        </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

        <DescriptionListGroup>
          <DescriptionListTerm>{__('Number of CPU(s)')}</DescriptionListTerm>
          <DescriptionListDescription>{cpuCount}</DescriptionListDescription>
        </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

jest.mock('../../hostDetailsHelpers', () => ({
  ...jest.requireActual('../../hostDetailsHelpers'),
  userPermissionsFromHostDetails: () => ({
    create_job_invocations: true,
    edit_hosts: true,
webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsCard.test.js on lines 56..62
webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js on lines 11..17
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 11..17
webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js on lines 10..16
webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 11..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 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 9 locations. Consider refactoring.
Open

        <DescriptionListGroup>
          <DescriptionListTerm>{__('RAM')}</DescriptionListTerm>
          <DescriptionListDescription>{memory}</DescriptionListDescription>
        </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 30..33

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

      <DescriptionListGroup>
        <Term>{__('Solution')}</Term>
        <Description>{solution}</Description>
      </DescriptionListGroup>
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 59..62
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 63..66
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 67..70
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 71..74
webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js on lines 75..78
webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js on lines 82..85
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 22..25
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionDetail.js on lines 26..29

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

Severity
Category
Status
Source
Language