src/app/legacy/containers/IndexPageSection/index.test.jsx

Summary

Maintainability
F
6 days
Test Coverage

File index.test.jsx has 556 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { render } from '@testing-library/react';
import { ToggleContextProvider } from '#contexts/ToggleContext';
import * as SectionLabel from '#psammead/psammead-section-label/src';
import { shouldMatchSnapshot } from '#psammead/psammead-test-helpers/src';
Severity: Major
Found in src/app/legacy/containers/IndexPageSection/index.test.jsx - About 1 day to fix

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

      items: [
        {
          headlines: {
            headline: "Nothing rendered because we didn't set a strapline",
          },
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 5 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 116..153

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

    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

      items: [
        {
          headlines: {
            headline: 'Top Story 1 headline',
          },
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 5 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 169..206

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

    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

        it('should not render the story promo inside a list when only one item exists', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection group={hasOneItem} sectionNumber={0} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 3 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 580..589
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 601..613

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

    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

        it('should render everything after the first non-radio bulletin', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection
                group={startsWithRadioBulletins}
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 3 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 528..537
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 580..589

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

    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

        it('should render useful links when the semantic group name is "Useful links"', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection group={usefulLinks} sectionNumber={1} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 3 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 528..537
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 601..613

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

    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

        it('should render text if the strapline is empty and is the 1st section ', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection group={group} sectionNumber={0} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 3 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 552..563

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

    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

        it('should render empty text if the strapline is empty and is not the 1st section ', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection group={hasNoStrapline} sectionNumber={1} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 3 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 539..550

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

    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

        it('should be called with false when sectionNumber !== 0', () => {
          render(
            <Wrapper>
              <IndexPageSection group={hasOneItem} sectionNumber={1} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 2 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 425..435

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

    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

        it('should be called with true when sectionNumber === 0', () => {
          render(
            <Wrapper>
              <IndexPageSection group={hasOneItem} sectionNumber={0} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 2 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 437..447

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

    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

        it('should render null when there are no items', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection group={hasNoItems} sectionNumber={0} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 2 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 504..514
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 516..526

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

    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

        it('should render when there is no strapline but is the 1st section', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection group={hasNoStrapline} sectionNumber={0} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 2 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 492..502
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 504..514

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

    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

        it('should render null when there is no strapline and is not the 1st section', () => {
          const { container } = render(
            <Wrapper>
              <IndexPageSection group={hasNoStrapline} sectionNumber={1} />
            </Wrapper>,
    Severity: Major
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 2 hrs to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 492..502
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 516..526

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

    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

        {
          name: 'Igbo Radio bulletin',
          summary:
            'This is an Igbo Radio bulletin promo, using a CPS promo for a Radio Bulletin with the LIVE button checked',
          uri: 'https://www.bbc.com/igbo/media-42986440',
    Severity: Minor
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 322..333
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 352..363

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

        {
          name: 'Igbo Radio bulletin',
          summary:
            'This is an Igbo Radio bulletin promo, using a CPS promo for a Radio Bulletin with the LIVE button checked',
          uri: 'https://www.bbc.com/igbo/media-42986440',
    Severity: Minor
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 288..299
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 352..363

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

        {
          name: 'Igbo Radio bulletin',
          summary:
            'This is an Igbo Radio bulletin promo, using a CPS promo for a Radio Bulletin 2 with the LIVE button checked',
          uri: 'https://www.bbc.com/igbo/media-42986440',
    Severity: Minor
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 288..299
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 322..333

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

        shouldMatchSnapshot(
          'should render correctly for canonical',
          <Wrapper service="news">
            <IndexPageSection group={group} sectionNumber={0} />
          </Wrapper>,
    Severity: Minor
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 394..399
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 408..413

    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

        shouldMatchSnapshot(
          'should render with only one item',
          <Wrapper service="news">
            <IndexPageSection group={hasOneItem} sectionNumber={0} />
          </Wrapper>,
    Severity: Minor
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 387..392
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 394..399

    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

        shouldMatchSnapshot(
          'should render correctly with a linking strapline',
          <Wrapper service="news">
            <IndexPageSection group={groupWithLink} sectionNumber={2} />
          </Wrapper>,
    Severity: Minor
    Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 387..392
    src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 408..413

    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