Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

    owner_details: PropTypes.shape({
      upstreamConsumer: PropTypes.shape({
        uuid: PropTypes.string,
        name: PropTypes.string,
        webUrl: PropTypes.string,
webpack/scenes/Subscriptions/SubscriptionsPage.js on lines 341..347

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

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

export const resolveTraceUrl = ({ hostname, search }) => createJob({
  hostname,
  feature: REX_FEATURES.KATELLO_HOST_TRACER_RESOLVE,
  inputs: { [TRACES_SEARCH_QUERY]: search },
});
webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js on lines 23..27
webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js on lines 43..47

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

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

  const primaryActionButton =
    (
      <Button
        ouiaId="add-rpm-rule-button"
        onClick={() => setModalOpen(true)}
webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 59..67
webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js on lines 81..89

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

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

        resource.prototype.hasContent = function () {
            return angular.isDefined(this.content_facet_attributes) && angular.isDefined(this.content_facet_attributes.uuid);
        };
engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js on lines 21..23

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

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

        {(latestVersionId === versionId &&
                (needsPublish === null || needsPublish || needsPublishLocal)) &&
                <NeedsPublishIcon
                  composite={composite}
                  determinate={needsPublish !== null || needsPublishLocal}
webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js on lines 104..110

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

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

    owner_details: PropTypes.shape({
      upstreamConsumer: PropTypes.shape({
        name: PropTypes.string,
        webUrl: PropTypes.string,
        uuid: PropTypes.string,
Severity: Major
Found in webpack/scenes/Subscriptions/SubscriptionsPage.js and 1 other location - About 1 hr to fix
webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js on lines 333..339

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

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

    {
      name: __('Bugs'),
      id: 'bugs',
      children: bugs.map(bug => ({ name: bug.bug_id, id: bug.bug_id, ...bug })),
    },
webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErratumExpansionContents.js on lines 20..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 55.

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 dropdownKebabItems = [
    <DropdownItem
      aria-label="bulk_add"
      ouiaId="bulk_add"
      key="bulk_add"
webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js on lines 115..125

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

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

            {(latestVersionId === id &&
                    (needsPublish === null || needsPublish || needsPublishLocal)) &&
                    <NeedsPublishIcon
                      composite={composite}
                      determinate={needsPublish !== null || needsPublishLocal}
webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js on lines 158..164

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

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

        {actionModalOpen &&
          <ModuleActionConfirmationModal
            hostname={hostname}
            action={hostModuleStreamAction}
            moduleSpec={actionableModuleSpec}
webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js on lines 571..580

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

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

            self.table.nextPage = function () {
                var nextPage = parseInt(params.page, 10) + 1;
                return self.table.changePage(nextPage);
            };
engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js on lines 412..415

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

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

      {hostId &&
        <DebInstallModal
          isOpen={isModalOpen}
          closeModal={closeModal}
          hostId={hostId}
webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js on lines 663..672

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

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

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

        def subjects(options = {})
          environment_id = options.fetch(:environment_id, nil)
          environment = ::Katello::KTEnvironment.find(environment_id) if environment_id

          repository_id = options.fetch(:repository_id, nil)
Severity: Minor
Found in app/lib/actions/katello/capsule_content/sync.rb and 1 other location - About 1 hr to fix
app/lib/actions/katello/capsule_content/verify_checksum.rb on lines 55..65

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

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

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

        def subjects(options = {})
          environment_id = options.fetch(:environment_id, nil)
          environment = ::Katello::KTEnvironment.find(environment_id) if environment_id

          repository_id = options.fetch(:repository_id, nil)
Severity: Minor
Found in app/lib/actions/katello/capsule_content/verify_checksum.rb and 1 other location - About 1 hr to fix
app/lib/actions/katello/capsule_content/sync.rb on lines 61..71

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

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 host_tools_installed?(force_update_cache: false)
        Rails.cache.fetch("#{self.host.id}/host_tools_installed", expires_in: 7.days, force: force_update_cache) do
          self.host.installed_packages.where("#{Katello::InstalledPackage.table_name}.name" => ALL_HOST_TOOLS_PACKAGE_NAMES).any? ||
            self.host.installed_debs.where("#{Katello::InstalledDeb.table_name}.name" => ALL_HOST_TOOLS_PACKAGE_NAMES).any?
        end
Severity: Minor
Found in app/models/katello/host/content_facet.rb and 1 other location - About 1 hr to fix
app/models/katello/host/content_facet.rb on lines 337..341

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

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 tracer_installed?(force_update_cache: false)
        Rails.cache.fetch("#{self.host.id}/tracer_installed", expires_in: 7.days, force: force_update_cache) do
          self.host.installed_packages.where("#{Katello::InstalledPackage.table_name}.name" => ALL_TRACER_PACKAGE_NAMES).any? ||
            self.host.installed_debs.where("#{Katello::InstalledDeb.table_name}.name" => ALL_TRACER_PACKAGE_NAMES).any?
        end
Severity: Minor
Found in app/models/katello/host/content_facet.rb and 1 other location - About 1 hr to fix
app/models/katello/host/content_facet.rb on lines 348..352

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

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

  const { queryByText, getByLabelText, getAllByLabelText } =
    renderWithRedux(
      withCVRoute(<CVContainerImageFilterContent filterId={195} details={details} />),
      renderOptions,
    );
webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 229..235
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 126..130
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 263..267
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 65..69
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 119..123
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 178..182
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 238..242
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 300..304
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 123..127
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 96..99
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 53..57
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 110..114
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 168..172
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 228..232
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 291..295
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 55..59
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 111..115
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 167..171
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 227..231
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 288..292
webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 469..472

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

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

  await patientlyWaitFor(() => {
    expect(getByText(cvFilterName)).toBeInTheDocument();
    expect(getAllByLabelText('Actions')[1]).toBeInTheDocument();
  });
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 283..286
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 339..342

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

  const { getAllByLabelText, getByText, queryByText } =
    renderWithRedux(withCVRoute(<ContentViewFilterDetails
      cvId={1}
      details={details}
    />), renderOptions);
webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 158..162
webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 229..235
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 126..130
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 263..267
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 65..69
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 119..123
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 178..182
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 238..242
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 300..304
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 123..127
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 96..99
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 53..57
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 110..114
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 228..232
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 291..295
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 55..59
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 111..115
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 167..171
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 227..231
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 288..292
webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 469..472

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

  const { getByText, queryByText, getByLabelText } =
    renderWithRedux(withCVRoute(<ContentViewFilterDetails
      cvId={1}
      details={details}
    />), renderOptions);
webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 158..162
webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 229..235
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 126..130
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 263..267
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 65..69
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 119..123
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 178..182
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 238..242
webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js on lines 300..304
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 123..127
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 96..99
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 53..57
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 110..114
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 168..172
webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js on lines 291..295
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 55..59
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 111..115
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 167..171
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 227..231
webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js on lines 288..292
webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 469..472

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

Severity
Category
Status
Source
Language