Showing 2,206 of 2,206 total issues

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

  shouldMatchSnapshot(
    'should render portrait image correctly',
    <Component
      alt={portrait.alt}
      attribution={portrait.attribution}
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 6..17
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 30..41
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 42..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 83.

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

  shouldMatchSnapshot(
    'should render square image correctly',
    <Component
      alt={square.alt}
      attribution={square.attribution}
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 6..17
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 18..29
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 42..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 83.

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

  shouldMatchSnapshot(
    'should render image with custom dimensions correctly',
    <Component
      alt={custom.alt}
      attribution={custom.attribution}
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 6..17
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 18..29
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 30..41

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

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

  shouldMatchSnapshot(
    'should render landscape image correctly',
    <Component
      alt={landscape.alt}
      attribution={landscape.attribution}
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 18..29
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 30..41
src/app/legacy/psammead/psammead-image/src/testHelpers/snapshotTests.jsx on lines 42..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 83.

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 render the translated section label', () => {
    const { getByText } = render(
      <RecentAudioEpisodesWithContext
        masterBrand="bbc_indonesian_radio"
        episodes={indonesian}
src/app/legacy/containers/EpisodeList/RecentAudioEpisodes/index.test.jsx on lines 98..110

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

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 render the episode title when supplied', async () => {
    const { getByText } = render(
      <RecentAudioEpisodesWithContext
        masterBrand="bbc_indonesian_radio"
        episodes={indonesian}
src/app/legacy/containers/EpisodeList/RecentAudioEpisodes/index.test.jsx on lines 57..69

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

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

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

import reactRouterConfig from 'react-router-config';
import isAmpPath from '#app/routes/utils/isAmpPath';
import isAppPath from '#app/routes/utils/isAppPath';
import { ERROR_PAGE } from '#app/routes/utils/pageTypes';
import getRouteProps from '.';
Severity: Minor
Found in src/app/routes/utils/fetchPageData/utils/getRouteProps/index.test.js - About 2 hrs to fix

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

    import { Agent } from 'undici';
    import * as getOnwardsPageData from '../utils/getOnwardsData';
    import * as fetchPageData from '../../utils/fetchPageData';
    import nodeLogger from '../../../../testHelpers/loggerMock';
    import { BFF_FETCH_ERROR } from '../../../lib/logger.const';
    Severity: Minor
    Found in src/app/routes/article/getInitialData/index.test.ts - About 2 hrs to fix

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

          it('should serve a file for valid service paths with variants', async () => {
            const { body } = await makeRequest(
              '/zhongwen/sty-secondary-column/trad.json',
            );
            expect(body).toEqual(
      Severity: Major
      Found in src/server/index.test.jsx and 1 other location - About 2 hrs to fix
      src/server/index.test.jsx on lines 930..938

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

      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

                          return r && y.push(new Promise((function(e, t) {
                              r.onabort = function() {
                                  var e = new Error("Request aborted");
                                  e.name = "AbortError",
                                  t(e)
      Severity: Major
      Found in public/vendor/cwr.js and 1 other location - About 2 hrs to fix
      public/vendor/cwr.js on lines 3554..3560

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

      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 serve a file for valid service paths without variants', async () => {
            const { body } = await makeRequest('/mundo/sty-secondary-column.json');
            expect(body).toEqual(
              expect.objectContaining({
                topStories: expect.any(Object),
      Severity: Major
      Found in src/server/index.test.jsx and 1 other location - About 2 hrs to fix
      src/server/index.test.jsx on lines 919..929

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

      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 render correctly', () => {
            const { container } = render(
              <CanonicalMenuButton
                announcedText="Menu"
                onClick={() => {}}
      src/app/legacy/psammead/psammead-navigation/src/DropdownNavigation/index.test.jsx on lines 84..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 82.

      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

                          return r && v.push(new Promise((function(e, t) {
                              r.onabort = function() {
                                  var e = new Error("Request aborted");
                                  e.name = "AbortError",
                                  t(e)
      Severity: Major
      Found in public/vendor/cwr.js and 1 other location - About 2 hrs to fix
      public/vendor/cwr.js on lines 1422..1428

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

      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 render rtl correctly', () => {
            const { container } = render(
              <CanonicalMenuButton
                announcedText="Menu"
                onClick={() => {}}
      src/app/legacy/psammead/psammead-navigation/src/DropdownNavigation/index.test.jsx on lines 71..82

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

      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 StyledAnchor = styled.a`
        display: block;
      
        :before {
          position: absolute;
      Severity: Major
      Found in src/app/legacy/containers/EpisodeList/Link.jsx and 1 other location - About 2 hrs to fix
      src/app/legacy/components/OptimoPromos/Link/index.styles.jsx on lines 4..32

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

      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 Link = styled.a`
        position: static;
        color: ${props => props.theme.palette.EBON};
        text-decoration: none;
        overflow-wrap: anywhere;
      Severity: Major
      Found in src/app/legacy/components/OptimoPromos/Link/index.styles.jsx and 1 other location - About 2 hrs to fix
      src/app/legacy/containers/EpisodeList/Link.jsx on lines 14..54

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

      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

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

      import React from 'react';
      import { storiesOf } from '@storybook/react';
      import { withKnobs, text, boolean, select } from '@storybook/addon-knobs';
      import Image from '#psammead/psammead-image/src';
      import MediaIndicator from '#psammead/psammead-media-indicator/src';
      Severity: Minor
      Found in src/app/legacy/psammead/psammead-story-promo/src/index.stories.jsx - About 2 hrs to fix

        Function z has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    z = function() {
                        function e(e) {
                            this.pluginId = "com.amazonaws.rum.dom-event",
                            this.eventListenerMap = new Map,
                            this.config = N(N({}, B), e),
        Severity: Major
        Found in public/vendor/cwr.js - About 2 hrs to fix

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

          import { FetchMock } from 'jest-fetch-mock';
          import React from 'react';
          import assocPath from 'ramda/src/assocPath';
          import pashtoPageData from '#data/pashto/bbc_pashto_tv/tv_programmes/w13xttn4.json';
          import * as analyticsUtils from '#lib/analyticsUtils';
          Severity: Minor
          Found in src/app/pages/OnDemandTvPage/index.test.tsx - About 2 hrs to fix

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

                    <Grid
                      dir={dir}
                      item
                      columns={{
                        group0: 2,
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 604..618
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 619..633
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 634..648
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 649..663
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 964..978
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 979..993
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 994..1008
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1009..1023
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1024..1038
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1054..1068
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1069..1083
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1084..1098
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1126..1140
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1141..1155
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1156..1170
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1171..1185
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1186..1200
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1201..1215
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1216..1230
            src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1231..1245

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

            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