Showing 2,206 of 2,206 total issues

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

  sinhala: {
    articles: 'Sept 2019',
    frontPage: '5th Feb 2020',
    liveRadio: '14th Jan 2020',
    mediaAssetPage: '27th Feb 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 50 mins to fix
scripts/releaseInfo/launchDates.js on lines 2..12
scripts/releaseInfo/launchDates.js on lines 25..35
scripts/releaseInfo/launchDates.js on lines 36..46
scripts/releaseInfo/launchDates.js on lines 57..67
scripts/releaseInfo/launchDates.js on lines 84..94
scripts/releaseInfo/launchDates.js on lines 117..127
scripts/releaseInfo/launchDates.js on lines 137..147
scripts/releaseInfo/launchDates.js on lines 157..167
scripts/releaseInfo/launchDates.js on lines 203..213
scripts/releaseInfo/launchDates.js on lines 370..380

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

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

  korean: {
    articles: 'Sept 2019',
    frontPage: '23rd April 2020',
    liveRadio: '30th Sept 2019',
    mediaAssetPage: '6th Feb 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 50 mins to fix
scripts/releaseInfo/launchDates.js on lines 2..12
scripts/releaseInfo/launchDates.js on lines 25..35
scripts/releaseInfo/launchDates.js on lines 36..46
scripts/releaseInfo/launchDates.js on lines 57..67
scripts/releaseInfo/launchDates.js on lines 84..94
scripts/releaseInfo/launchDates.js on lines 117..127
scripts/releaseInfo/launchDates.js on lines 137..147
scripts/releaseInfo/launchDates.js on lines 203..213
scripts/releaseInfo/launchDates.js on lines 300..310
scripts/releaseInfo/launchDates.js on lines 370..380

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

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

  arabic: {
    articles: 'Sept 2019',
    frontPage: '23rd April 2020',
    liveRadio: '4th Feb 2020',
    mediaAssetPage: '',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 50 mins to fix
scripts/releaseInfo/launchDates.js on lines 2..12
scripts/releaseInfo/launchDates.js on lines 25..35
scripts/releaseInfo/launchDates.js on lines 57..67
scripts/releaseInfo/launchDates.js on lines 84..94
scripts/releaseInfo/launchDates.js on lines 117..127
scripts/releaseInfo/launchDates.js on lines 137..147
scripts/releaseInfo/launchDates.js on lines 157..167
scripts/releaseInfo/launchDates.js on lines 203..213
scripts/releaseInfo/launchDates.js on lines 300..310
scripts/releaseInfo/launchDates.js on lines 370..380

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

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

  bengali: {
    articles: 'Sept 2019',
    frontPage: '5th Feb 2020',
    liveRadio: '10th Jan 2020',
    mediaAssetPage: '5th March 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 50 mins to fix
scripts/releaseInfo/launchDates.js on lines 2..12
scripts/releaseInfo/launchDates.js on lines 25..35
scripts/releaseInfo/launchDates.js on lines 36..46
scripts/releaseInfo/launchDates.js on lines 84..94
scripts/releaseInfo/launchDates.js on lines 117..127
scripts/releaseInfo/launchDates.js on lines 137..147
scripts/releaseInfo/launchDates.js on lines 157..167
scripts/releaseInfo/launchDates.js on lines 203..213
scripts/releaseInfo/launchDates.js on lines 300..310
scripts/releaseInfo/launchDates.js on lines 370..380

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

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

  amharic: {
    articles: 'Sept 2019',
    frontPage: '5th Feb 2020',
    liveRadio: '30th Sept 2019',
    mediaAssetPage: '6th Feb 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 50 mins to fix
scripts/releaseInfo/launchDates.js on lines 2..12
scripts/releaseInfo/launchDates.js on lines 36..46
scripts/releaseInfo/launchDates.js on lines 57..67
scripts/releaseInfo/launchDates.js on lines 84..94
scripts/releaseInfo/launchDates.js on lines 117..127
scripts/releaseInfo/launchDates.js on lines 137..147
scripts/releaseInfo/launchDates.js on lines 157..167
scripts/releaseInfo/launchDates.js on lines 203..213
scripts/releaseInfo/launchDates.js on lines 300..310
scripts/releaseInfo/launchDates.js on lines 370..380

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

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

  gahuza: {
    articles: 'Sept 2019',
    frontPage: '19th Feb 2020',
    liveRadio: '10th Jan 2020',
    mediaAssetPage: '27th Feb 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 50 mins to fix
scripts/releaseInfo/launchDates.js on lines 2..12
scripts/releaseInfo/launchDates.js on lines 25..35
scripts/releaseInfo/launchDates.js on lines 36..46
scripts/releaseInfo/launchDates.js on lines 57..67
scripts/releaseInfo/launchDates.js on lines 117..127
scripts/releaseInfo/launchDates.js on lines 137..147
scripts/releaseInfo/launchDates.js on lines 157..167
scripts/releaseInfo/launchDates.js on lines 203..213
scripts/releaseInfo/launchDates.js on lines 300..310
scripts/releaseInfo/launchDates.js on lines 370..380

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

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

export const getMostReadPageRegex = services => {
  const serviceRegex = getServiceRegex(services);
  return `/:service(${serviceRegex}):variant(${variantRegex})?/popular/read:amp(${ampRegex})?:lite(${liteRegex})?`;
};
Severity: Major
Found in src/app/routes/utils/regex/utils/index.js and 4 other locations - About 50 mins to fix
src/app/routes/utils/regex/utils/index.js on lines 90..93
src/app/routes/utils/regex/utils/index.js on lines 134..137
src/app/routes/utils/regex/utils/index.js on lines 149..152
src/app/routes/utils/regex/utils/index.js on lines 154..157

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

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

        it('should leave all non-TVBulletins for av-live-streams', () => {
          expect(
            removeTVBulletinsIfNotAVLiveStream({
              items: nonTVBulletins.input,
              type: 'av-live-streams',
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 256..263
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 265..272
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 290..297
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 299..306
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 324..331
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 333..340
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 371..378

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

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

export const getTipoHomeRegex = services => {
  const serviceRegex = getServiceRegex(services);
  return `/:service(${serviceRegex}):variant(${variantRegex})?/tipohome:amp(${ampRegex})?:lite(${liteRegex})?`;
};
Severity: Major
Found in src/app/routes/utils/regex/utils/index.js and 4 other locations - About 50 mins to fix
src/app/routes/utils/regex/utils/index.js on lines 134..137
src/app/routes/utils/regex/utils/index.js on lines 149..152
src/app/routes/utils/regex/utils/index.js on lines 154..157
src/app/routes/utils/regex/utils/index.js on lines 159..162

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

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

        it('should filter single TVBulletin for not-av-live-streams', () => {
          expect(
            removeTVBulletinsIfNotAVLiveStream({
              items: onlyTVBulletin.input,
              type: 'not-av-live-streams',
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 256..263
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 290..297
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 299..306
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 324..331
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 333..340
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 362..369
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 371..378

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

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

        it('should filter all TVBulletin for not-av-live-streams', () => {
          expect(
            removeTVBulletinsIfNotAVLiveStream({
              items: multipleTVBulletins.input,
              type: 'not-av-live-streams',
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 256..263
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 265..272
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 290..297
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 324..331
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 333..340
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 362..369
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 371..378

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

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

export const FacebookPostAmpExample = (_, { service }) => (
  <Component
    isAmp
    blocks={[facebookPostBlockEmbed]}
    source="https://www.facebook.com/RickAstley/posts/545713756920775"
Severity: Major
Found in src/app/legacy/containers/SocialEmbed/index.stories.jsx and 4 other locations - About 50 mins to fix
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 52..59
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 94..101
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 112..119
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 148..155

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

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

export const getPodcastBrandRegex = services => {
  const serviceRegex = getServiceRegex(services);
  return `/:service(${serviceRegex}):variant(${variantRegex})?/podcasts/:brandId(${mediaIdRegex}):lite(${liteRegex})?`;
};
Severity: Major
Found in src/app/routes/utils/regex/utils/index.js and 4 other locations - About 50 mins to fix
src/app/routes/utils/regex/utils/index.js on lines 90..93
src/app/routes/utils/regex/utils/index.js on lines 149..152
src/app/routes/utils/regex/utils/index.js on lines 154..157
src/app/routes/utils/regex/utils/index.js on lines 159..162

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

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

        it('should leave multiple TVBulletins for av-live-streams', () => {
          expect(
            removeTVBulletinsIfNotAVLiveStream({
              items: multipleTVBulletins.input,
              type: 'av-live-streams',
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 256..263
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 265..272
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 299..306
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 324..331
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 333..340
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 362..369
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 371..378

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

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

        it('should leave single TVBulletin for av-live-streams', () => {
          expect(
            removeTVBulletinsIfNotAVLiveStream({
              items: onlyTVBulletin.input,
              type: 'av-live-streams',
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 265..272
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 290..297
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 299..306
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 324..331
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 333..340
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 362..369
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 371..378

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

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

        it('should filter all TVBulletins and leave non-TVBulletins for not-av-live-streams', () => {
          expect(
            removeTVBulletinsIfNotAVLiveStream({
              items: mixedTVBulletin.input,
              type: 'not-av-live-streams',
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 256..263
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 265..272
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 290..297
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 299..306
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 324..331
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 362..369
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 371..378

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

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

export const YoutubeWithConsentBannerAmp = (_, { service }) => (
  <Component
    isAmp
    blocks={[youtubeBlockEmbed]}
    source="https://www.youtube.com/watch?v=1e05_rwHvOM"
Severity: Major
Found in src/app/legacy/containers/SocialEmbed/index.stories.jsx and 4 other locations - About 50 mins to fix
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 52..59
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 94..101
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 130..137
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 148..155

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

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

export const TikTokWithConsentBannerAmp = (_, { service }) => (
  <Component
    isAmp
    blocks={[tiktokBlockEmbed]}
    source="https://www.tiktok.com/@cuppymusic/video/7086167423639997701"
Severity: Major
Found in src/app/legacy/containers/SocialEmbed/index.stories.jsx and 4 other locations - About 50 mins to fix
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 52..59
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 112..119
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 130..137
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 148..155

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

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

        it('should leave all types for av-live-streams', () => {
          expect(
            removeTVBulletinsIfNotAVLiveStream({
              items: mixedTVBulletin.input,
              type: 'av-live-streams',
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 256..263
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 265..272
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 290..297
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 299..306
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 333..340
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 362..369
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 371..378

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

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

export const FacebookVideoAmpExample = (_, { service }) => (
  <Component
    isAmp
    blocks={[facebookVideoBlockEmbed]}
    source="https://www.facebook.com/RickAstley/videos/1378590239249667"
Severity: Major
Found in src/app/legacy/containers/SocialEmbed/index.stories.jsx and 4 other locations - About 50 mins to fix
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 52..59
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 94..101
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 112..119
src/app/legacy/containers/SocialEmbed/index.stories.jsx on lines 130..137

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

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