Showing 2,206 of 2,206 total issues

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

    it('FB app ID', () => {
      const metaTagContent = getMetaTagContent('meta[property="fb:app_id"]');

      expect(metaTagContent).toBeTruthy();
      expect(metaTagContent).toMatchSnapshot();
Severity: Major
Found in src/integration/common/SEO.js and 15 other locations - About 50 mins to fix
src/integration/common/SEO.js on lines 54..59
src/integration/common/SEO.js on lines 61..66
src/integration/common/SEO.js on lines 68..73
src/integration/common/SEO.js on lines 75..80
src/integration/common/SEO.js on lines 82..87
src/integration/common/SEO.js on lines 89..94
src/integration/common/SEO.js on lines 96..101
src/integration/common/SEO.js on lines 103..108
src/integration/common/SEO.js on lines 110..117
src/integration/common/SEO.js on lines 119..126
src/integration/common/SEO.js on lines 128..133
src/integration/common/SEO.js on lines 135..142
src/integration/common/SEO.js on lines 144..149
src/integration/common/SEO.js on lines 151..158
src/integration/common/SEO.js on lines 160..165

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

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

    it('Twitter image src', () => {
      const metaTagContent = getMetaTagContent(
        'meta[name="twitter:image:src"]',
      );

Severity: Major
Found in src/integration/common/SEO.js and 15 other locations - About 50 mins to fix
src/integration/common/SEO.js on lines 47..52
src/integration/common/SEO.js on lines 54..59
src/integration/common/SEO.js on lines 61..66
src/integration/common/SEO.js on lines 68..73
src/integration/common/SEO.js on lines 75..80
src/integration/common/SEO.js on lines 82..87
src/integration/common/SEO.js on lines 89..94
src/integration/common/SEO.js on lines 96..101
src/integration/common/SEO.js on lines 103..108
src/integration/common/SEO.js on lines 110..117
src/integration/common/SEO.js on lines 128..133
src/integration/common/SEO.js on lines 135..142
src/integration/common/SEO.js on lines 144..149
src/integration/common/SEO.js on lines 151..158
src/integration/common/SEO.js on lines 160..165

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

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

    it('Twitter description', () => {
      const metaTagContent = getMetaTagContent(
        'meta[name="twitter:description"]',
      );

Severity: Major
Found in src/integration/common/SEO.js and 15 other locations - About 50 mins to fix
src/integration/common/SEO.js on lines 47..52
src/integration/common/SEO.js on lines 54..59
src/integration/common/SEO.js on lines 61..66
src/integration/common/SEO.js on lines 68..73
src/integration/common/SEO.js on lines 75..80
src/integration/common/SEO.js on lines 82..87
src/integration/common/SEO.js on lines 89..94
src/integration/common/SEO.js on lines 96..101
src/integration/common/SEO.js on lines 103..108
src/integration/common/SEO.js on lines 110..117
src/integration/common/SEO.js on lines 119..126
src/integration/common/SEO.js on lines 128..133
src/integration/common/SEO.js on lines 135..142
src/integration/common/SEO.js on lines 144..149
src/integration/common/SEO.js on lines 160..165

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

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

    it('OG site name', () => {
      const metaTagContent = getMetaTagContent('meta[property="og:site_name"]');

      expect(metaTagContent).toBeTruthy();
      expect(metaTagContent).toMatchSnapshot();
Severity: Major
Found in src/integration/common/SEO.js and 15 other locations - About 50 mins to fix
src/integration/common/SEO.js on lines 47..52
src/integration/common/SEO.js on lines 54..59
src/integration/common/SEO.js on lines 61..66
src/integration/common/SEO.js on lines 68..73
src/integration/common/SEO.js on lines 75..80
src/integration/common/SEO.js on lines 82..87
src/integration/common/SEO.js on lines 96..101
src/integration/common/SEO.js on lines 103..108
src/integration/common/SEO.js on lines 110..117
src/integration/common/SEO.js on lines 119..126
src/integration/common/SEO.js on lines 128..133
src/integration/common/SEO.js on lines 135..142
src/integration/common/SEO.js on lines 144..149
src/integration/common/SEO.js on lines 151..158
src/integration/common/SEO.js on lines 160..165

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

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

    it('OG url', () => {
      const metaTagContent = getMetaTagContent('meta[property="og:url"]');

      expect(metaTagContent).toBeTruthy();
      expect(metaTagContent).toMatchSnapshot();
Severity: Major
Found in src/integration/common/SEO.js and 15 other locations - About 50 mins to fix
src/integration/common/SEO.js on lines 47..52
src/integration/common/SEO.js on lines 54..59
src/integration/common/SEO.js on lines 61..66
src/integration/common/SEO.js on lines 68..73
src/integration/common/SEO.js on lines 75..80
src/integration/common/SEO.js on lines 89..94
src/integration/common/SEO.js on lines 96..101
src/integration/common/SEO.js on lines 103..108
src/integration/common/SEO.js on lines 110..117
src/integration/common/SEO.js on lines 119..126
src/integration/common/SEO.js on lines 128..133
src/integration/common/SEO.js on lines 135..142
src/integration/common/SEO.js on lines 144..149
src/integration/common/SEO.js on lines 151..158
src/integration/common/SEO.js on lines 160..165

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

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

    it('Twitter site', () => {
      const metaTagContent = getMetaTagContent('meta[name="twitter:site"]');

      expect(metaTagContent).toBeTruthy();
      expect(metaTagContent).toMatchSnapshot();
Severity: Major
Found in src/integration/common/SEO.js and 15 other locations - About 50 mins to fix
src/integration/common/SEO.js on lines 47..52
src/integration/common/SEO.js on lines 54..59
src/integration/common/SEO.js on lines 61..66
src/integration/common/SEO.js on lines 68..73
src/integration/common/SEO.js on lines 75..80
src/integration/common/SEO.js on lines 82..87
src/integration/common/SEO.js on lines 89..94
src/integration/common/SEO.js on lines 96..101
src/integration/common/SEO.js on lines 103..108
src/integration/common/SEO.js on lines 110..117
src/integration/common/SEO.js on lines 119..126
src/integration/common/SEO.js on lines 135..142
src/integration/common/SEO.js on lines 144..149
src/integration/common/SEO.js on lines 151..158
src/integration/common/SEO.js on lines 160..165

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

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

    it('Twitter title', () => {
      const metaTagContent = getMetaTagContent('meta[name="twitter:title"]');

      expect(metaTagContent).toBeTruthy();
      expect(metaTagContent).toMatchSnapshot();
Severity: Major
Found in src/integration/common/SEO.js and 15 other locations - About 50 mins to fix
src/integration/common/SEO.js on lines 47..52
src/integration/common/SEO.js on lines 54..59
src/integration/common/SEO.js on lines 61..66
src/integration/common/SEO.js on lines 68..73
src/integration/common/SEO.js on lines 75..80
src/integration/common/SEO.js on lines 82..87
src/integration/common/SEO.js on lines 89..94
src/integration/common/SEO.js on lines 96..101
src/integration/common/SEO.js on lines 103..108
src/integration/common/SEO.js on lines 110..117
src/integration/common/SEO.js on lines 119..126
src/integration/common/SEO.js on lines 128..133
src/integration/common/SEO.js on lines 135..142
src/integration/common/SEO.js on lines 144..149
src/integration/common/SEO.js on lines 151..158

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

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

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

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

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

Refactorings

Further Reading

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

  it('should return href with anchor text', () => {
    setWindowValue('location', {
      href: 'https://www.example.com/#anchortext',
    });
    const href = getHref();
Severity: Major
Found in src/app/lib/analyticsUtils/index.test.js and 3 other locations - About 50 mins to fix
src/app/lib/analyticsUtils/index.test.js on lines 255..263
src/app/lib/analyticsUtils/index.test.js on lines 330..338
src/app/lib/analyticsUtils/index.test.js on lines 581..589

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

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

const ListItem = styled.li`
  text-align: center;
  width: 100%;
  word-break: break-word;
  & button {
Severity: Major
Found in src/app/legacy/psammead/psammead-consent-banner/src/index.jsx and 2 other locations - About 50 mins to fix
src/app/legacy/components/ScrollablePromo/PromoList/index.jsx on lines 45..68
src/app/lib/utilities/getUrlHelpers/getMostReadUrls/index.test.js on lines 4..10

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

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

    before(() => {
      cy.url().then(url => {
        [, articleId] = url.match(/\/([^/]+?)(?:\.[^/.]+)?$/);
      });
    });
Severity: Minor
Found in cypress/e2e/pages/articles/testsForAMPOnly.js and 1 other location - About 50 mins to fix
cypress/e2e/pages/articles/tests.js on lines 88..92

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

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

  {
    type: 'article',
    title: 'Test image gallery',
    firstPublished: '2022-11-22T17:23:05.000Z',
    lastPublished: '2023-12-13T18:59:20.000Z',
Severity: Major
Found in src/app/components/Curation/HierarchicalGrid/mediaFixtures.js and 3 other locations - About 50 mins to fix
src/app/components/Curation/HierarchicalGrid/liveFixtures.js on lines 2..15
src/app/components/Curation/HierarchicalGrid/liveFixtures.js on lines 16..29
src/app/components/Curation/HierarchicalGrid/liveFixtures.js on lines 30..43

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

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

  {
    title: 'Wetin happun for January 6 one year ago?',
    type: 'article',
    firstPublished: '2022-01-06T19:00:29.000Z',
    lastPublished: '2022-12-09T20:56:29.000Z',
Severity: Major
Found in src/app/components/Curation/HierarchicalGrid/liveFixtures.js and 3 other locations - About 50 mins to fix
src/app/components/Curation/HierarchicalGrid/liveFixtures.js on lines 2..15
src/app/components/Curation/HierarchicalGrid/liveFixtures.js on lines 30..43
src/app/components/Curation/HierarchicalGrid/mediaFixtures.js on lines 15..27

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

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,
  pageType,
}) =>
  describe(`No testsThatFollowSmokeTestConfigForCanonicalOnly for ${service} ${pageType}`, () => {});
Severity: Major
Found in cypress/e2e/123PlaygroundForTests/testsForCanonicalOnly.js and 2 other locations - About 50 mins to fix
cypress/e2e/123PlaygroundForTests/tests.js on lines 7..8
cypress/e2e/123PlaygroundForTests/testsForAMPOnly.js on lines 7..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 52.

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 testsThatFollowSmokeTestConfig = ({ service, pageType }) =>
  describe(`No testsThatFollowSmokeTestConfig for ${service} ${pageType}`, () => {});
Severity: Major
Found in cypress/e2e/123PlaygroundForTests/tests.js and 2 other locations - About 50 mins to fix
cypress/e2e/123PlaygroundForTests/testsForAMPOnly.js on lines 7..11
cypress/e2e/123PlaygroundForTests/testsForCanonicalOnly.js on lines 7..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 52.

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

    `
      @media (min-width: ${GEL_GROUP_0_SCREEN_WIDTH_MIN}){
        margin-${dir === 'ltr' ? 'left' : 'right'}: ${GEL_SPACING};
        &:first-child {
          margin-${dir === 'ltr' ? 'left' : 'right'}: ${GEL_SPACING};
Severity: Major
Found in src/app/legacy/components/ScrollablePromo/PromoList/index.jsx and 2 other locations - About 50 mins to fix
src/app/legacy/psammead/psammead-consent-banner/src/index.jsx on lines 146..216
src/app/lib/utilities/getUrlHelpers/getMostReadUrls/index.test.js on lines 4..10

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

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

      describe('Chartbeat', () => {
        it('should have a script with correct src', () => {
          cy.hasScriptWithChartbeatSrc();
        });
        it('should have correct config', () => {
Severity: Minor
Found in cypress/e2e/pages/mediaAssetPage/testsForCanonicalOnly.js and 1 other location - About 50 mins to fix
cypress/e2e/pages/homePage/testsForCanonicalOnly.js on lines 46..53

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

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

  {
    title: 'Why Donald Trump say Bitcoin na scam',
    type: 'article',
    firstPublished: '2021-06-08T07:41:51.000Z',
    lastPublished: '2022-08-14T05:36:38.000Z',
Severity: Major
Found in src/app/components/Curation/HierarchicalGrid/liveFixtures.js and 3 other locations - About 50 mins to fix
src/app/components/Curation/HierarchicalGrid/liveFixtures.js on lines 2..15
src/app/components/Curation/HierarchicalGrid/liveFixtures.js on lines 16..29
src/app/components/Curation/HierarchicalGrid/mediaFixtures.js on lines 15..27

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

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

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

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

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

Refactorings

Further Reading

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

  it('should return campaign type of XTOR', () => {
    setWindowValue('location', {
      href: 'https://www.bbc.com/mundo#xtor',
    });

Severity: Major
Found in src/app/lib/analyticsUtils/index.test.js and 3 other locations - About 50 mins to fix
src/app/lib/analyticsUtils/index.test.js on lines 255..263
src/app/lib/analyticsUtils/index.test.js on lines 330..338
src/app/lib/analyticsUtils/index.test.js on lines 350..356

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

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

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

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

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

Refactorings

Further Reading

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

  it('should return navigator language', () => {
    setWindowValue('navigator', {
      language: 'abc',
    });

Severity: Major
Found in src/app/lib/analyticsUtils/index.test.js and 3 other locations - About 50 mins to fix
src/app/lib/analyticsUtils/index.test.js on lines 330..338
src/app/lib/analyticsUtils/index.test.js on lines 350..356
src/app/lib/analyticsUtils/index.test.js on lines 581..589

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

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

      before(() => {
        cy.url().then(url => {
          [, articleId] = url.match(/\/([^/]+?)(?:\.[^/.]+)?$/);
        });
      });
Severity: Minor
Found in cypress/e2e/pages/articles/tests.js and 1 other location - About 50 mins to fix
cypress/e2e/pages/articles/testsForAMPOnly.js on lines 25..29

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

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