Katello/katello

View on GitHub
webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js

Summary

Maintainability
D
2 days
Test Coverage

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

import React from 'react';
import { act, renderWithRedux, patientlyWaitFor, fireEvent } from 'react-testing-lib-wrapper';
import { Route } from 'react-router-dom';
import { nockInstance, assertNockRequest, mockAutocomplete } from '../../../../../test-utils/nockWrapper';
import api from '../../../../../services/api';

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

    beforeEach(() => {
      const { results } = cvVersionsData;
      [firstVersion] = results;
      envScope = nockInstance
        .get(environmentPathsPath)
    webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js on lines 32..39

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 66.

    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

      await patientlyWaitFor(() => {
        expect(queryByText('Select a lifecycle environment from the available promotion paths to promote new version.')).toBeNull();
        expect(getByText(`Version ${firstVersion.version}`)).toBeInTheDocument();
      });
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 265..268

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

    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

      await patientlyWaitFor(() => {
        expect(queryByText('Select a lifecycle environment from the available promotion paths to promote new version.')).toBeNull();
        expect(getByText(`Version ${firstVersion.version}`)).toBeInTheDocument();
      });
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 365..368

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

    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

          {
            id: 1,
            name: 'Library',
            label: 'Library',
            publish_date: '5 days',
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 307..320

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

    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

          {
            id: 3,
            name: 'test',
            label: 'test',
            publish_date: '4 days',
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 293..306

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

    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

      const {
        getByText, queryByText, getByLabelText, getAllByLabelText,
      } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 241..246

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

    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

      const {
        getByText, queryByText, getByLabelText, getAllByLabelText,
      } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 331..336

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

    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 { queryByLabelText, queryByText, getByText } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        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 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

    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

      await patientlyWaitFor(() => {
        expect(getByText('Select a lifecycle environment from the available promotion paths to promote new version.')).toBeInTheDocument();
        expect(getByLabelText('prod')).toBeInTheDocument();
      });
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 347..350

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 52.

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

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

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

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

    Refactorings

    Further Reading

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

      await patientlyWaitFor(() => {
        expect(getByText('Select a lifecycle environment from the available promotion paths to promote new version.')).toBeInTheDocument();
        expect(getByLabelText('prod')).toBeInTheDocument();
      });
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 257..260

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

      const { getByText, queryByText } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
      );
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 56..60
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 99..103
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 58..62
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 52..56
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 45..46
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 89..92
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 235..238
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js on lines 51..54
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 200..205
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 401..406
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 441..444

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

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

      const {
        queryByLabelText, queryByText,
      } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 56..60
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 99..103
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 58..62
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 52..56
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 45..46
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 89..92
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 235..238
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js on lines 51..54
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 65..68
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 200..205
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 441..444

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

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

      const { getByText, queryByText } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
      );
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 56..60
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 99..103
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 58..62
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 52..56
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 45..46
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 89..92
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 235..238
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js on lines 51..54
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 65..68
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 200..205
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 401..406

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

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

      const {
        getByLabelText, queryByText,
      } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 56..60
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 99..103
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 58..62
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 52..56
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 45..46
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 89..92
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js on lines 235..238
    webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js on lines 51..54
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 65..68
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 401..406
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 441..444

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

    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 { getByText, getAllByText } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
      );
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 290..294
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 140..143
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 460..463
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 509..512
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 88..91

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

      const { getByText, getAllByText } = renderWithRedux(
        withCVRoute(<ContentViewVersions cvId={5} details={cvDetailData} />),
        renderOptions,
      );
    webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js on lines 290..294
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 140..143
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 460..463
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 509..512
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 118..121

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

      await patientlyWaitFor(() => {
        expect(getByText(`Version ${firstVersion.version}`)).toBeInTheDocument();
      });
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 354..356
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 418..420
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 339..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 5 locations. Consider refactoring.
    Open

      await patientlyWaitFor(() => {
        expect(getByText(`Version ${firstVersion.version}`)).toBeTruthy();
      });
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 350..352
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 414..416
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 574..576
    webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js on lines 60..62

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

      await patientlyWaitFor(() => {
        expect(getByText(`Version ${firstVersion.version}`)).toBeInTheDocument();
      });
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 354..356
    webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 418..420
    webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 249..251

    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

    const renderOptions = {
      apiNamespace: `${CONTENT_VIEWS_KEY}_VERSIONS_5`,
      routerParams: {
        initialEntries: [{ pathname: '/content_views/5' }],
        initialIndex: 1,
    webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js on lines 16..22

    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