Showing 2,206 of 2,206 total issues

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

export const FacebookVideoCanonicalExample = (_, { service }) => (
  <Component
    blocks={[facebookVideoBlockEmbed]}
    source="https://www.facebook.com/RickAstley/videos/1378590239249667"
    service={service}
Severity: Major
Found in src/app/legacy/containers/SocialEmbed/index.stories.jsx and 7 other locations - About 40 mins to fix
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 44..50
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 62..68
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 70..76
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 78..84
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 86..92
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 104..110
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 122..128

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

        it(`Then it has this imgSrc`, () => {
          expect(generateImgSrc({ isAmp, isLive })).toEqual(imgSrcExpectation);
        });
Severity: Major
Found in src/server/utilities/cspHeader/index.test.js and 6 other locations - About 40 mins to fix
src/server/utilities/cspHeader/index.test.js on lines 448..452
src/server/utilities/cspHeader/index.test.js on lines 458..462
src/server/utilities/cspHeader/index.test.js on lines 464..468
src/server/utilities/cspHeader/index.test.js on lines 470..474
src/server/utilities/cspHeader/index.test.js on lines 480..484
src/server/utilities/cspHeader/index.test.js on lines 486..490

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

        it(`Then it has this frameSrc`, () => {
          expect(generateFrameSrc({ isAmp, isLive })).toEqual(
            frameSrcExpectation,
          );
        });
Severity: Major
Found in src/server/utilities/cspHeader/index.test.js and 6 other locations - About 40 mins to fix
src/server/utilities/cspHeader/index.test.js on lines 448..452
src/server/utilities/cspHeader/index.test.js on lines 458..462
src/server/utilities/cspHeader/index.test.js on lines 464..468
src/server/utilities/cspHeader/index.test.js on lines 476..478
src/server/utilities/cspHeader/index.test.js on lines 480..484
src/server/utilities/cspHeader/index.test.js on lines 486..490

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

        it(`Then it has this styleSrc`, () => {
          expect(generateStyleSrc({ isAmp, isLive })).toEqual(
            styleSrcExpectation,
          );
        });
Severity: Major
Found in src/server/utilities/cspHeader/index.test.js and 6 other locations - About 40 mins to fix
src/server/utilities/cspHeader/index.test.js on lines 448..452
src/server/utilities/cspHeader/index.test.js on lines 458..462
src/server/utilities/cspHeader/index.test.js on lines 464..468
src/server/utilities/cspHeader/index.test.js on lines 470..474
src/server/utilities/cspHeader/index.test.js on lines 476..478
src/server/utilities/cspHeader/index.test.js on lines 480..484

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

  it('should return id using URI if assetURI does not exist', () => {
    expect(
      buildUniquePromoId({
        promoGroupId: labelId,
        promoItem: standardLinkItem,
Severity: Major
Found in src/app/legacy/containers/StoryPromo/utilities/index.test.js and 4 other locations - About 40 mins to fix
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 71..79
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 91..99
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 101..109
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 111..119

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

  it('should return id using canonicalUrl if assetUri does not exist and uri does not exist', () => {
    expect(
      buildUniquePromoId({
        promoGroupId: labelId,
        promoItem: tipoFormattedTopStoriesItem,
Severity: Major
Found in src/app/legacy/containers/StoryPromo/utilities/index.test.js and 4 other locations - About 40 mins to fix
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 71..79
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 81..89
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 91..99
src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 111..119

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

        it(`Then it has this fontSrc`, () => {
          expect(generateFontSrc({ isAmp, isLive })).toEqual(
            fontSrcExpectation,
          );
        });
Severity: Major
Found in src/server/utilities/cspHeader/index.test.js and 6 other locations - About 40 mins to fix
src/server/utilities/cspHeader/index.test.js on lines 448..452
src/server/utilities/cspHeader/index.test.js on lines 458..462
src/server/utilities/cspHeader/index.test.js on lines 470..474
src/server/utilities/cspHeader/index.test.js on lines 476..478
src/server/utilities/cspHeader/index.test.js on lines 480..484
src/server/utilities/cspHeader/index.test.js on lines 486..490

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

export const FacebookPostCanonicalExample = (_, { service }) => (
  <Component
    blocks={[facebookPostBlockEmbed]}
    source="https://www.facebook.com/RickAstley/posts/545713756920775"
    service={service}
Severity: Major
Found in src/app/legacy/containers/SocialEmbed/index.stories.jsx and 7 other locations - About 40 mins to fix
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 44..50
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 62..68
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 70..76
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 78..84
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 86..92
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 104..110
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 140..146

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

        it(`Then it has this scriptSrc`, () => {
          expect(generateScriptSrc({ isAmp, isLive })).toEqual(
            scriptSrcExpectation,
          );
        });
Severity: Major
Found in src/server/utilities/cspHeader/index.test.js and 6 other locations - About 40 mins to fix
src/server/utilities/cspHeader/index.test.js on lines 448..452
src/server/utilities/cspHeader/index.test.js on lines 458..462
src/server/utilities/cspHeader/index.test.js on lines 464..468
src/server/utilities/cspHeader/index.test.js on lines 470..474
src/server/utilities/cspHeader/index.test.js on lines 476..478
src/server/utilities/cspHeader/index.test.js on lines 486..490

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    {
      originCode: 'cpsdevpb',
      locator: 'testland.jpg',
      width: 2048,
      expected: {
Severity: Major
Found in src/app/lib/utilities/srcSet/index.test.js and 3 other locations - About 40 mins to fix
src/app/lib/utilities/srcSet/index.test.js on lines 5..19
src/app/lib/utilities/srcSet/index.test.js on lines 27..41
src/app/lib/utilities/srcSet/index.test.js on lines 56..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

      it('should return portuguese experimentation endpoint with engine', () => {
        expect(
          getRecommendationsUrl({
            assetUri: '/portuguese/brasil-59876053',
            service: 'portuguese',
src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 20..28
src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 29..37
src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 38..46

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    {
      originCode: 'cpsdevpb',
      locator: 'testland.jpg',
      width: 2048,
      expected: {
Severity: Major
Found in src/app/lib/utilities/srcSet/index.test.js and 3 other locations - About 40 mins to fix
src/app/lib/utilities/srcSet/index.test.js on lines 5..19
src/app/lib/utilities/srcSet/index.test.js on lines 27..41
src/app/lib/utilities/srcSet/index.test.js on lines 42..55

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    it('should return endpoint with query string on local', () => {
      expect(
        getRadioScheduleEndpoint({
          service: 'hausa',
          queryString: '?renderer_env=live',
src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 20..28
src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 29..37
src/app/lib/utilities/getUrlHelpers/getRecommendationsUrl/index.test.js on lines 28..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    {
      originCode: 'cpsdevpb',
      locator: 'testland.jpg',
      width: 1024,
      expected: {
Severity: Major
Found in src/app/lib/utilities/srcSet/index.test.js and 3 other locations - About 40 mins to fix
src/app/lib/utilities/srcSet/index.test.js on lines 27..41
src/app/lib/utilities/srcSet/index.test.js on lines 42..55
src/app/lib/utilities/srcSet/index.test.js on lines 56..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    it('should return the correct headline for live asset', () => {
      const liveAsset = { ...noAssetTypeCode, cpsType: 'LIV' };
      expect(getHeadline(liveAsset)).toEqual(
        "Fotoğraflarla: Almanya'da iklim aktivistleri açık kömür madenine girdi",
      );
Severity: Minor
Found in src/app/lib/utilities/getStoryPromoInfo/index.test.jsx and 1 other location - About 40 mins to fix
src/app/lib/utilities/getStoryPromoInfo/index.test.jsx on lines 149..152

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    it('should return the correct url for live asset', () => {
      const liveAsset = { ...noAssetTypeCode, cpsType: 'LIV' };
      expect(getUrl(liveAsset)).toEqual('/turkce/haberler-dunya-48735662');
    });
Severity: Minor
Found in src/app/lib/utilities/getStoryPromoInfo/index.test.jsx and 1 other location - About 40 mins to fix
src/app/lib/utilities/getStoryPromoInfo/index.test.jsx on lines 116..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 48.

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

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

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

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

Refactorings

Further Reading

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

    {
      originCode: 'test',
      locator: 'testland.jpg',
      width: 640,
      expected: {
Severity: Major
Found in src/app/lib/utilities/srcSet/index.test.js and 3 other locations - About 40 mins to fix
src/app/lib/utilities/srcSet/index.test.js on lines 5..19
src/app/lib/utilities/srcSet/index.test.js on lines 42..55
src/app/lib/utilities/srcSet/index.test.js on lines 56..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    it('should always return endpoint without query string on live', () => {
      expect(
        getRadioScheduleEndpoint({
          service: 'hausa',
          queryString: '?renderer_env=live',
src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 29..37
src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 38..46
src/app/lib/utilities/getUrlHelpers/getRecommendationsUrl/index.test.js on lines 28..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

    ({
      pageName,
      main,
      framework,
      lib,
Severity: Minor
Found in scripts/bundleSize/index.js and 1 other location - About 40 mins to fix
src/app/pages/TopicPage/TopicPage.jsx on lines 77..114

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

          <EmbedConsentBannerAmp provider={provider} id={id}>
            <AmpElement id={id} source={source} />
          </EmbedConsentBannerAmp>
Severity: Minor
Found in src/app/legacy/psammead/psammead-social-embed/src/index.jsx and 1 other location - About 40 mins to fix
src/app/legacy/psammead/psammead-social-embed/src/index.jsx on lines 151..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 48.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language