Showing 2,206 of 2,206 total issues

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

const chineseFontStyles = {
  sansRegular: `
    ${chineseFontFamily}
    ${getFontStyleAndWeight('normal', 400)}
  `,
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 86..95
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 102..111
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 118..127
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 134..143
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 166..175
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 182..191
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 198..207
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 214..223
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 230..239
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 246..255
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 263..272
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 279..288
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 295..304
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 311..320
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 327..336
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 343..352

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

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

const koreanStyles = {
  sansRegular: `
    ${koreanFontFamily}
    ${getFontStyleAndWeight('normal', 400)}
  `,
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 86..95
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 102..111
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 118..127
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 134..143
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 150..159
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 166..175
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 182..191
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 198..207
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 230..239
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 246..255
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 263..272
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 279..288
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 295..304
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 311..320
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 327..336
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 343..352

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

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

const punjabiStyles = {
  sansRegular: `
    ${punjabiFontFamily}
    ${getFontStyleAndWeight('normal', 400)}
  `,
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 86..95
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 102..111
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 118..127
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 134..143
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 150..159
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 166..175
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 182..191
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 198..207
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 214..223
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 230..239
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 246..255
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 279..288
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 295..304
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 311..320
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 327..336
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 343..352

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

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

  kyrgyz: {
    articles: 'Sept 2019',
    frontPage: '26th Sept 2019',
    liveRadio: '10th Jan 2020',
    mediaAssetPage: '27th Feb 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 1 hr to fix
scripts/releaseInfo/launchDates.js on lines 13..24
scripts/releaseInfo/launchDates.js on lines 68..79
scripts/releaseInfo/launchDates.js on lines 105..116
scripts/releaseInfo/launchDates.js on lines 218..229
scripts/releaseInfo/launchDates.js on lines 230..241
scripts/releaseInfo/launchDates.js on lines 311..322
scripts/releaseInfo/launchDates.js on lines 327..338
scripts/releaseInfo/launchDates.js on lines 339..350
scripts/releaseInfo/launchDates.js on lines 421..432
scripts/releaseInfo/launchDates.js on lines 433..444

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

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

const tigrinyaStyles = {
  sansRegular: `
    ${tigrinyaFontFamily}
    ${getFontStyleAndWeight('normal', 400)}
  `,
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 86..95
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 102..111
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 118..127
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 134..143
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 150..159
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 166..175
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 182..191
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 198..207
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 214..223
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 230..239
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 246..255
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 263..272
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 279..288
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 295..304
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 311..320
src/app/legacy/psammead/psammead-styles/src/font-families.js on lines 327..336

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

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

  hausa: {
    articles: 'Sept 2019',
    frontPage: '23rd April 2020',
    liveRadio: '30th Jan 2020',
    mediaAssetPage: '5th March 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 10 other locations - About 1 hr to fix
scripts/releaseInfo/launchDates.js on lines 13..24
scripts/releaseInfo/launchDates.js on lines 68..79
scripts/releaseInfo/launchDates.js on lines 168..179
scripts/releaseInfo/launchDates.js on lines 218..229
scripts/releaseInfo/launchDates.js on lines 230..241
scripts/releaseInfo/launchDates.js on lines 311..322
scripts/releaseInfo/launchDates.js on lines 327..338
scripts/releaseInfo/launchDates.js on lines 339..350
scripts/releaseInfo/launchDates.js on lines 421..432
scripts/releaseInfo/launchDates.js on lines 433..444

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

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

const BoldItalicParagraph = styled.p`
  ${({ script }) => getBodyCopy(script)};
  ${({ service }) => getSansBoldItalic(service)}
`;
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 20..23
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 24..27
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 28..31
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 37..40

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

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('is the correct image', () => {
        const firstImage = document.querySelector(
          '[data-testid="topic-promos"] > li  img, amp-img',
        );
        expect(firstImage).toBeInTheDocument();
Severity: Major
Found in src/integration/pages/homePage/pageContentTests.js and 3 other locations - About 1 hr to fix
src/integration/common/mediaPlayer.js on lines 13..19
src/integration/common/mediaPlayer.js on lines 21..27
src/integration/pages/storyPage/ampIncludeTests.js on lines 4..11

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

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('renders a placeholder', () => {
        const mediaPlayerPlaceholder = mediaPlayerContainer.querySelector(
          'div[data-e2e=media-loader__placeholder]',
        );
        expect(mediaPlayerPlaceholder).toBeInTheDocument();
Severity: Major
Found in src/integration/common/mediaPlayer.js and 3 other locations - About 1 hr to fix
src/integration/common/mediaPlayer.js on lines 21..27
src/integration/pages/homePage/pageContentTests.js on lines 12..18
src/integration/pages/storyPage/ampIncludeTests.js on lines 4..11

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

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

const Caption = styled.figcaption`
  ${({ script }) => getLongPrimer(script)};
  ${({ service }) => getSansRegularItalic(service)}
`;
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 20..23
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 24..27
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 28..31
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 32..35

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

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

const RegularParagraph = styled.p`
  ${({ script }) => getBodyCopy(script)};
  ${({ service }) => getSansRegular(service)}
`;
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 24..27
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 28..31
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 32..35
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 37..40

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

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

const ItalicParagraph = styled.p`
  ${({ script }) => getBodyCopy(script)};
  ${({ service }) => getSansRegularItalic(service)}
`;
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 20..23
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 24..27
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 32..35
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 37..40

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

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('renders a figure caption', () => {
        const mediaPlayerCaption = mediaPlayerContainer.querySelector(
          'div[data-e2e=media-loader__placeholder]',
        );
        expect(mediaPlayerCaption).toBeInTheDocument();
Severity: Major
Found in src/integration/common/mediaPlayer.js and 3 other locations - About 1 hr to fix
src/integration/common/mediaPlayer.js on lines 13..19
src/integration/pages/homePage/pageContentTests.js on lines 12..18
src/integration/pages/storyPage/ampIncludeTests.js on lines 4..11

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

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

const BoldParagraph = styled.p`
  ${({ script }) => getBodyCopy(script)};
  ${({ service }) => getSansBold(service)}
`;
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 20..23
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 28..31
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 32..35
src/app/legacy/psammead/psammead-inline-link/src/index.stories.jsx on lines 37..40

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

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('I can see a fallback image', () => {
        const imageEl = document.querySelector(
          'amp-img[src="https://ichef.bbci.co.uk/news/1280/idt2-test/idt2/3686672a-0a64-4cdb-91c6-ae9ed0f214f7/image/640"]',
        );

Severity: Major
Found in src/integration/pages/storyPage/ampIncludeTests.js and 3 other locations - About 1 hr to fix
src/integration/common/mediaPlayer.js on lines 13..19
src/integration/common/mediaPlayer.js on lines 21..27
src/integration/pages/homePage/pageContentTests.js on lines 12..18

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

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

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

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

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

Refactorings

Further Reading

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

                    if (null == r ? void 0 : r.aborted) {
                        var i = new Error("Request aborted");
                        return i.name = "AbortError", Promise.reject(i)
                    }
Severity: Major
Found in public/vendor/cwr.js and 1 other location - About 1 hr to fix
public/vendor/cwr.js on lines 3507..3510

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

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

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

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

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

Refactorings

Further Reading

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

                    if (null == r ? void 0 : r.aborted) {
                        var i = new Error("Request aborted");
                        return i.name = "AbortError", Promise.reject(i)
                    }
Severity: Major
Found in public/vendor/cwr.js and 1 other location - About 1 hr to fix
public/vendor/cwr.js on lines 1358..1361

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

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

const igboNavData = [
  {
    title: 'Akụkọ',
    url: '/igbo',
  },
src/app/legacy/psammead/psammead-navigation/testHelpers/yoruba.js on lines 1..15

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

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

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

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

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

Refactorings

Further Reading

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

export const testsThatFollowSmokeTestConfigForCanonicalOnly = ({ service }) => {
  if (Cypress.env('APP_ENV') === 'local') {
    runCanonicalAdsTests({ service });
  }
};
cypress/e2e/pages/featureIndexPage/testsForAMPOnly.js on lines 5..9
cypress/e2e/pages/storyPage/testsForAMPOnly.js on lines 20..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 56.

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

          <CanonicalSocialEmbed
            provider={provider}
            service={service}
            id={id}
            oEmbed={oEmbed}
Severity: Major
Found in src/app/legacy/containers/SocialEmbed/index.jsx and 1 other location - About 1 hr to fix
src/app/legacy/containers/SocialEmbed/index.jsx on lines 64..72

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

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