Showing 2,206 of 2,206 total issues

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

      {promoType === 'top' && relatedItems && (
        <IndexAlsosContainer
          alsoItems={relatedItems}
          script={script}
          service={service}
Severity: Minor
Found in src/app/legacy/containers/StoryPromo/index.jsx and 1 other location - About 40 mins to fix
src/app/legacy/psammead/psammead-story-promo/src/index.stories.jsx on lines 118..125

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

    it('should return duration with hours in default format', () => {
      const duration = 'PT1H30M'; // 1:30:00
      expect(formatDuration({ duration })).toEqual('1:30:00');
    });
src/app/legacy/psammead/psammead-timestamp-container/src/utilities/index.test.js on lines 243..246

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

  <ServiceContext.Provider value={context}>
    <Fragment text={text} attributes={attributes} />
  </ServiceContext.Provider>
Severity: Minor
Found in src/app/legacy/containers/Fragment/index.test.jsx and 1 other location - About 40 mins to fix
src/app/legacy/containers/BulletedList/index.test.jsx on lines 19..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

    {promoType === 'top' && alsoItems && (
      <IndexAlsosContainer
        alsoItems={alsoItems}
        script={script}
        service={service}
src/app/legacy/containers/StoryPromo/index.jsx on lines 275..282

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

moment.updateLocale('mr', {
  postformat: null,
  relativeTime: {
    past: '%sपूर्वी',
    m: '1 मिनिटा',
Severity: Minor
Found in src/app/legacy/psammead/psammead-locales/moment/mr.js and 1 other location - About 40 mins to fix
src/app/legacy/psammead/psammead-locales/moment/ta.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

      <ServiceContext.Provider value={memoizedToggleContextValue}>
        <BulletedListContainer
          blocks={blocks}
          blockGroupIndex={blockGroupIndex}
        />
Severity: Minor
Found in src/app/legacy/containers/BulletedList/index.test.jsx and 1 other location - About 40 mins to fix
src/app/legacy/containers/Fragment/index.test.jsx on lines 20..22

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

moment.updateLocale('ta', {
  postformat: null,
  relativeTime: {
    past: '%s முன்னர்',
    m: 'ஒரு நிமிடத்துக்கு',
Severity: Minor
Found in src/app/legacy/psammead/psammead-locales/moment/ta.js and 1 other location - About 40 mins to fix
src/app/legacy/psammead/psammead-locales/moment/mr.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

                                        if (u = f[n++].exec(e))
                                            for (o = 0; o < p.length; o++)
                                                l = u[++r],
                                                typeof (a = p[o]) === c && a.length > 0 ? 2 == a.length ? typeof a[1] == s ? this[a[0]] = a[1].call(this, l) : this[a[0]] = a[1] : 3 == a.length ? typeof a[1] !== s || a[1].exec && a[1].test ? this[a[0]] = l ? l.replace(a[1], a[2]) : i : this[a[0]] = l ? a[1].call(this, l, a[2]) : i : 4 == a.length && (this[a[0]] = l ? a[3].call(this, l.replace(a[1], a[2])) : i) : this[a] = l || i;
Severity: Major
Found in public/vendor/cwr.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

      if (
        !children ||
        children.length === 0 ||
        isRoot ||
        docsOnly ||
    Severity: Major
    Found in .storybook/SidebarLabel/index.tsx - About 40 mins to fix

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

      export const TikTokWithConsentBanner = (_, { service }) => (
        <Component
          blocks={[tiktokBlockEmbed]}
          source="https://www.tiktok.com/@cuppymusic/video/7086167423639997701"
          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 104..110
      src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 122..128
      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 8 locations. Consider refactoring.
      Open

      export const TwitterCanonicalExample = (_, { service }) => (
        <Component
          blocks={[twitterBlock]}
          source="https://twitter.com/BBCNews/status/1384138850478346243?s=20"
          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 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
      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 8 locations. Consider refactoring.
      Open

      export const TwitterNoEmbed = (_, { service }) => (
        <Component
          blocks={[twitterBlockNoEmbed]}
          source="https://twitter.com/BBCNews/status/1384138850478346243?s=20"
          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 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
      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 8 locations. Consider refactoring.
      Open

      export const InstagramNoEmbed = (_, { service }) => (
        <Component
          blocks={[instagramBlockNoEmbed]}
          source="https://www.instagram.com/p/CgNAEjOK46_"
          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 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
      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 8 locations. Consider refactoring.
      Open

      export const YoutubeWithConsentBanner = (_, { service }) => (
        <Component
          blocks={[youtubeBlockEmbed]}
          source="https://www.youtube.com/watch?v=1e05_rwHvOM"
          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 122..128
      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 childSrc`, () => {
                expect(generateChildSrc({ isAmp, isLive })).toEqual(
                  childSrcExpectation,
                );
              });
      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 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
      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 5 locations. Consider refactoring.
      Open

        it('should return id of promo-link with contentType and URI if contentType exists', () => {
          expect(
            buildUniquePromoId({
              promoGroupId: labelId,
              promoItem: secondaryColumnNoAssetURI,
      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 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 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 assetURI does not exist and contentType does not exist', () => {
          expect(
            buildUniquePromoId({
              promoGroupId: labelId,
              promoItem: completeItem,
      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 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 7 locations. Consider refactoring.
      Open

              it(`Then it has this defaultSrc`, () => {
                expect(generateDefaultSrc({ isAmp, isLive })).toEqual(
                  defaultSrcExpectation,
                );
              });
      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 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
      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 InstagramCanonicalExample = (_, { service }) => (
        <Component
          blocks={[instagramBlock]}
          source="https://www.instagram.com/p/CgNAEjOK46_"
          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 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
      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 5 locations. Consider refactoring.
      Open

        it('should return id with contentType only if assetURI and URI do not exist', () => {
          expect(
            buildUniquePromoId({
              promoGroupId: labelId,
              promoItem: secondaryColumnContentType,
      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 101..109

      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