Katello/katello

View on GitHub
webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js

Summary

Maintainability
F
5 days
Test Coverage

File errataTab.test.js has 775 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { renderWithRedux, patientlyWaitFor, within, fireEvent } from 'react-testing-lib-wrapper';
import { nockInstance, assertNockRequest, mockForemanAutocomplete } from '../../../../../test-utils/nockWrapper';
import { foremanApi } from '../../../../../services/api';
import { HOST_ERRATA_KEY, ERRATA_SEARCH_QUERY } from '../ErrataTab/HostErrataConstants';

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

    test('Toggle Group shows if it\'s the default content view but non-library environment', async (done) => {
      // Setup autocomplete with mockForemanAutoComplete since we aren't adding /katello
      const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
      const mockErrata = makeMockErrata({});
      const options = renderOptions({
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 604..629

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

    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

    test('Toggle Group shows if it\'s the library environment but non-default content view', async (done) => {
      // Setup autocomplete with mockForemanAutoComplete since we aren't adding /katello
      const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
      const mockErrata = makeMockErrata({});
      const options = renderOptions({
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 578..602

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

    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 {
        queryByText,
        getByRole,
        queryByLabelText,
        getAllByText,
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 764..770

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

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

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

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

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

    Refactorings

    Further Reading

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

      const {
        queryByText,
        queryByLabelText,
        getByRole,
        getAllByText,
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 806..812

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

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

      const scope2 = nockInstance
        .get(hostErrata)
        .query({ ...defaultQuery, severity: 'Important' })
        .reply(200, { ...mockErrataData, results: [thirdErrata] });
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 759..762
    webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 118..121
    webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 159..162
    webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 215..218
    webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js on lines 411..414

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

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

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

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

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

    Refactorings

    Further Reading

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

      const scope2 = nockInstance
        .get(hostErrata)
        .query({ ...defaultQuery, type: 'security' })
        .reply(200, { ...mockErrataData, results: [firstErrata] });
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 801..804
    webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 118..121
    webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 159..162
    webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 215..218
    webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js on lines 411..414

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

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

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

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

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

    Refactorings

    Further Reading

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

      const { getAllByText, getByLabelText, queryByText } = renderWithRedux(
        <ErrataTab />,
        renderOptions(cfWithErrataTotal(mockErrata.total)),
      );
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 736..740
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 899..902

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

    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 {
        queryByLabelText,
        getByText,
        getAllByText,
      } = renderWithRedux(<ErrataTab />, renderOptions(cfWithErrataTotal(mockErrata.total)));
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 860..863
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 899..902

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

    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 { getAllByText, getByLabelText, queryByText } = renderWithRedux(
        <ErrataTab />,
        renderOptions(cfWithErrataTotal(mockErrata.total)),
      );
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 736..740
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 860..863

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

    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 jobInvocationBody = ({ job_invocation: { inputs } }) =>
        inputs[ERRATA_SEARCH_QUERY] === `errata_id = ${results[0].errata_id}`;
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 892..893

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

    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 jobInvocationBody = ({ job_invocation: { inputs } }) =>
        inputs[ERRATA_SEARCH_QUERY] === `errata_id !^ (${results[0].errata_id})`;
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 964..965

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

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

      const { getByText, getAllByText, getByLabelText } = renderWithRedux(
        <ErrataTab />,
        renderOptions(cfWithErrataTotal(mockErrata.total)),
      );
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 930..933
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 971..974

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

      const { getAllByText, getByLabelText, queryByText } = renderWithRedux(
        <ErrataTab />,
        renderOptions(cfWithErrataTotal(mockErrata.total)),
      );
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 971..974
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 1003..1006

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

      const { getByText, getAllByText, getByLabelText } = renderWithRedux(
        <ErrataTab />,
        renderOptions(cfWithErrataTotal(mockErrata.total)),
      );
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 930..933
    webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js on lines 1003..1006

    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

    There are no issues that match your filters.

    Category
    Status