Showing 2,206 of 2,206 total issues

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

        <Grid
          item
          columns={{
            group0: 6,
            group1: 6,
Severity: Major
Found in src/app/legacy/psammead/psammead-grid/src/index.test.jsx and 3 other locations - About 3 hrs to fix
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 171..191
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 192..212
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 215..235

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

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

            <Grid
              item
              columns={{
                group0: 6,
                group1: 6,
Severity: Major
Found in src/app/legacy/psammead/psammead-grid/src/index.test.jsx and 3 other locations - About 3 hrs to fix
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 131..151
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 171..191
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 215..235

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

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

        <Grid
          item
          columns={{
            group0: 6,
            group1: 6,
Severity: Major
Found in src/app/legacy/psammead/psammead-grid/src/index.test.jsx and 3 other locations - About 3 hrs to fix
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 131..151
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 171..191
src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 192..212

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

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 RadioFrequencyLink = styled.a`
  ${({ script }) => script && getLongPrimer(script)}
  ${({ service }) => service && getSansRegular(service)}
  color: ${props => props.theme.palette.EBON};
  text-decoration: none;
Severity: Major
Found in src/app/legacy/containers/RadioSchedule/Canonical/index.jsx and 1 other location - About 3 hrs to fix
src/app/legacy/psammead/psammead-useful-links/src/index.jsx on lines 18..31

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

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

export const UsefulLink = styled.a`
  ${({ script }) => script && getPica(script)};
  ${({ service }) => service && getSerifMedium(service)};
  color: ${props => props.theme.palette.EBON};
  text-decoration: none;
Severity: Major
Found in src/app/legacy/psammead/psammead-useful-links/src/index.jsx and 1 other location - About 3 hrs to fix
src/app/legacy/containers/RadioSchedule/Canonical/index.jsx on lines 80..94

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

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

Function le has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            }, ae = n(238), ce = "00000000-0000-0000-0000-000000000000", ue = "unknown", le = function() {
                function e(e, t, n, r) {
                    this.appMonitorDetails = e,
                    this.config = t,
                    this.record = n,
Severity: Major
Found in public/vendor/cwr.js - About 3 hrs to fix

    File index.test.jsx has 310 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import { BrowserRouter } from 'react-router-dom';
    import { suppressPropWarnings } from '#psammead/psammead-test-helpers/src';
    import { data as mundoBannerVariations } from '#data/mundo/topics/cw90edn9kw4t.json';
    import {
    Severity: Minor
    Found in src/app/pages/TopicPage/index.test.jsx - About 3 hrs to fix

      Function buildSections has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      export const buildSections = ({
        service,
        pageType,
        sectionName,
        categoryName,
      Severity: Minor
      Found in src/app/components/ChartbeatAnalytics/utils/index.ts - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File index.jsx has 309 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import styled from '@emotion/styled';
      import {
        GEL_MARGIN_BELOW_400PX,
        GEL_GUTTER_BELOW_600PX,
      Severity: Minor
      Found in src/app/legacy/psammead/psammead-grid/src/index.jsx - About 3 hrs to fix

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

        export const videoItem = {
          headlines: {
            headline: 'A video item',
          },
          locators: {
        Severity: Major
        Found in src/app/legacy/containers/StoryPromo/helpers/fixtureData.js and 1 other location - About 3 hrs to fix
        src/app/legacy/containers/StoryPromo/helpers/fixtureData.js on lines 27..52

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

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

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

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

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

        Refactorings

        Further Reading

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

              it('should have an inline link to an article page', () => {
                cy.get('a[href*="/articles/"]')
                  .should('have.attr', 'href')
                  .then(href => {
                    cy.request({
        Severity: Major
        Found in cypress/e2e/pages/articles/tests.js and 1 other location - About 3 hrs to fix
        cypress/e2e/pages/frontPage/tests.js on lines 33..44

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

        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

                      .within(() => {
                        cy.get('a')
                          .should('have.attr', 'href')
                          .then(href => {
                            cy.request({
        Severity: Major
        Found in cypress/e2e/pages/frontPage/tests.js and 1 other location - About 3 hrs to fix
        cypress/e2e/pages/articles/tests.js on lines 61..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 103.

        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

        export const audioItem = {
          headlines: {
            headline: 'An audio item',
          },
          locators: {
        Severity: Major
        Found in src/app/legacy/containers/StoryPromo/helpers/fixtureData.js and 1 other location - About 3 hrs to fix
        src/app/legacy/containers/StoryPromo/helpers/fixtureData.js on lines 54..79

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

        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

        Function load has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        return e.prototype.load = function(e) {
                            var t = this;
                            this.recordEvent = e.record,
                            function(e, t) {
                                var n,
        Severity: Major
        Found in public/vendor/cwr.js - About 3 hrs to fix

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

              expect(urlToObject(viewEventUrl)).toEqual({
                origin: 'https://logws1363.ati-host.net',
                pathname: '/',
                searchParams: {
                  atc: 'PUB-[article-sty]-[brand]-[]-[CHD=promo::2]-[news::pidgin.news.story.51745682.page]-[]-[]-[]',
          Severity: Major
          Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 2 other locations - About 3 hrs to fix
          src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 134..149
          src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 190..205

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

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

              expect(urlToObject(viewEventUrl)).toEqual({
                origin: 'https://logws1363.ati-host.net',
                pathname: '/',
                searchParams: {
                  atc: 'PUB-[article-sty]-[brand]-[]-[CHD=promo::2]-[news::pidgin.news.story.51745682.page]-[]-[]-[]',
          Severity: Major
          Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 2 other locations - About 3 hrs to fix
          src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 134..149
          src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 244..259

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

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

              expect(urlToObject(viewEventUrl)).toEqual({
                origin: 'https://logws1363.ati-host.net',
                pathname: '/',
                searchParams: {
                  atc: 'PUB-[article-sty]-[brand]-[]-[CHD=promo::2]-[news::pidgin.news.story.51745682.page]-[]-[]-[]',
          Severity: Major
          Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 2 other locations - About 3 hrs to fix
          src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 190..205
          src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 244..259

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

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

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

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

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

          Refactorings

          Further Reading

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

            it('should hit the correct outside UK and UK cookie oven endpoints when on the live environment', () => {
              window.location = new URL('https://www.bbc.com');
          
              setCookieOven('value');
          
          
          src/app/legacy/containers/ConsentBanner/useConsentBanners/setCookieOven.test.js on lines 25..39

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

          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 timeData = {
                      service,
                      type,
                      link,
                      generated: jsondata.generated,
          Severity: Major
          Found in scripts/mostReadAndWatchedCollectionData.js and 1 other location - About 3 hrs to fix
          scripts/mostReadCollectionTimes.js on lines 81..95

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

          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 timeData = {
                      service,
                      type,
                      link,
                      generated: jsondata.generated,
          Severity: Major
          Found in scripts/mostReadCollectionTimes.js and 1 other location - About 3 hrs to fix
          scripts/mostReadAndWatchedCollectionData.js on lines 82..96

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

          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