Showing 2,206 of 2,206 total issues

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

    p05525mc: [
      {
        linkText: 'Spotify',
        linkUrl: 'https://open.spotify.com/show/4ZERQGr2e0byGAtbTa76dR',
        linkType: 'spotify',
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 3..26
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 27..50
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 107..130
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 131..155
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 186..209
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 3..25
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 26..48
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 49..72
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 3..27
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 28..51
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/urdu.js on lines 3..25

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

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

    p08s9wv2: [
      {
        linkText: 'Spotify',
        linkUrl: 'https://open.spotify.com/show/2J22D8PZYQdvx4zICcRGon',
        linkType: 'spotify',
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 3..26
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 27..50
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 83..106
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 131..155
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 186..209
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 3..25
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 26..48
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 49..72
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 3..27
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 28..51
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/urdu.js on lines 3..25

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

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

    p0c04t7w: [
      {
        linkText: 'Spotify',
        linkUrl: 'https://open.spotify.com/show/4izrTfBmEKZHYCAUiuc4gw',
        linkType: 'spotify',
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 3..26
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 27..50
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 83..106
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 107..130
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 131..155
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 186..209
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 3..25
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 26..48
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 49..72
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 3..27
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 28..51

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

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

    p09qw1cn: [
      {
        linkText: 'Spotify',
        linkUrl: 'https://open.spotify.com/show/54YV8Rd6zmvq9Ry55q9HQw',
        linkType: 'spotify',
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 3..26
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 27..50
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 83..106
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 107..130
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 131..155
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 186..209
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 3..25
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 26..48
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 49..72
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 3..27
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/urdu.js on lines 3..25

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

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

          <Grid
            dir={dir}
            item
            columns={{
              group0: 6,
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1315..1328
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1371..1384
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1385..1398
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1399..1412
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1413..1426

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

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

    p055260j: [
      {
        linkText: 'Spotify',
        linkUrl: 'https://open.spotify.com/show/0SDaLngHehBulm5LXpyqSV',
        linkType: 'spotify',
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 3..26
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 83..106
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 107..130
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 131..155
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 186..209
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 3..25
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 26..48
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 49..72
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 3..27
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 28..51
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/urdu.js on lines 3..25

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

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

    p07r3r3t: [
      {
        linkText: 'Spotify',
        linkUrl: 'https://open.spotify.com/show/4KqTMEWcOUzHFHAPCt54Uk',
        linkType: 'spotify',
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 3..26
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 27..50
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 83..106
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 107..130
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 131..155
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 186..209
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 3..25
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 26..48
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/marathi.js on lines 49..72
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/portuguese.js on lines 28..51
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/urdu.js on lines 3..25

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

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

  it('should render an audio item correctly', () => {
    const { container } = render(
      <MediaIndicator
        dir="ltr"
        item={audioItem}
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 129..139
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 167..177
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 179..189

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

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

  it('should not override renderer on live', async () => {
    process.env.SIMORGH_APP_ENV = 'live';
    await getInitialData({
      path: 'mock-live-radio-path',
      pageType: MEDIA_PAGE,
Severity: Major
Found in src/app/routes/liveRadio/getInitialData/index.test.js and 3 other locations - About 1 hr to fix
src/app/routes/liveRadio/getInitialData/index.test.js on lines 39..49
src/app/routes/onDemandTV/getInitialData/index.test.js on lines 81..88
src/app/routes/onDemandTV/getInitialData/index.test.js on lines 90..97

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

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

  it('should render a photo gallery item correctly', () => {
    const { container } = render(
      <MediaIndicator
        dir="ltr"
        item={photogalleryItem}
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 117..127
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 129..139
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 179..189

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

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

  it('should not override renderer on live', async () => {
    process.env.SIMORGH_APP_ENV = 'live';
    await getInitialData({ path: 'mock-live-tv-path', pageType: MEDIA_PAGE });
    expect(spy).toHaveBeenCalledWith({
      path: 'mock-live-tv-path',
Severity: Major
Found in src/app/routes/onDemandTV/getInitialData/index.test.js and 3 other locations - About 1 hr to fix
src/app/routes/liveRadio/getInitialData/index.test.js on lines 39..49
src/app/routes/liveRadio/getInitialData/index.test.js on lines 51..61
src/app/routes/onDemandTV/getInitialData/index.test.js on lines 81..88

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

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

      <TopicTags service="arabic" script={arabicTypography}>
        <TopicTag name="test1" link="#" />
        <TopicTag name="test2" link="#" />
        <TopicTag name="test3" link="#" />
        <TopicTag name="test4" link="#" />
src/app/legacy/psammead/psammead-topic-tags/src/index.test.jsx on lines 25..30

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

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

          <Grid
            dir={dir}
            item
            columns={{
              group0: 6,
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1315..1328
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1371..1384
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1385..1398
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1399..1412
src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1427..1440

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

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

  it('should override renderer on test', async () => {
    process.env.SIMORGH_APP_ENV = 'test';
    await getInitialData({ path: 'mock-live-tv-path', pageType: MEDIA_PAGE });
    expect(spy).toHaveBeenCalledWith({
      path: 'mock-live-tv-path?renderer_env=live',
Severity: Major
Found in src/app/routes/onDemandTV/getInitialData/index.test.js and 3 other locations - About 1 hr to fix
src/app/routes/liveRadio/getInitialData/index.test.js on lines 39..49
src/app/routes/liveRadio/getInitialData/index.test.js on lines 51..61
src/app/routes/onDemandTV/getInitialData/index.test.js on lines 90..97

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

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

  it('should override renderer on test', async () => {
    process.env.SIMORGH_APP_ENV = 'test';
    await getInitialData({
      path: 'mock-live-radio-path',
      pageType: MEDIA_PAGE,
Severity: Major
Found in src/app/routes/liveRadio/getInitialData/index.test.js and 3 other locations - About 1 hr to fix
src/app/routes/liveRadio/getInitialData/index.test.js on lines 51..61
src/app/routes/onDemandTV/getInitialData/index.test.js on lines 81..88
src/app/routes/onDemandTV/getInitialData/index.test.js on lines 90..97

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

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

  it('should render a video item correctly', () => {
    const { container } = render(
      <MediaIndicator
        dir="ltr"
        item={videoItem}
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 117..127
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 167..177
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 179..189

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

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

      <TopicTags {...newsProps}>
        <TopicTag name="test1" link="#" />
        <TopicTag name="test2" link="#" />
        <TopicTag name="test3" link="#" />
        <TopicTag name="test4" link="#" />
src/app/legacy/psammead/psammead-topic-tags/src/index.test.jsx on lines 55..60

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

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

  it('should render correctly even without duration', () => {
    const { container } = render(
      <MediaIndicator
        dir="ltr"
        item={noDurationItem}
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 117..127
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 129..139
src/app/legacy/containers/StoryPromo/MediaIndicator/index.test.jsx on lines 167..177

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

    <Grid
      item
      columns={{
        group0: 8,
        group1: 8,
src/app/legacy/psammead/psammead-story-promo/src/index.stories.jsx on lines 218..231

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

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

      <Grid
        item
        columns={{
          group0: 8,
          group1: 8,
src/app/legacy/psammead/psammead-story-promo/src/index.stories.jsx on lines 192..205

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language