Showing 2,206 of 2,206 total issues

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

export default () => {
  describe('Embed HTML', () => {
    const embedErrorMessage = document.querySelector(
      `[data-e2e="embed-error"]`,
    );
Severity: Major
Found in src/integration/common/embedHtml.amp.js and 1 other location - About 3 hrs to fix
src/integration/common/ampIframe.amp.js on lines 1..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

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.jsx has 291 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useContext } from 'react';
import styled from '@emotion/styled';
import StoryPromo, {
  Headline,
  Summary,
Severity: Minor
Found in src/app/legacy/containers/StoryPromo/index.jsx - About 3 hrs to fix

    Function o has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                        o = function() {
                            function e() {
                                this.state = Int32Array.from(r.INIT),
                                this.temp = new Int32Array(64),
                                this.buffer = new Uint8Array(64),
    Severity: Major
    Found in public/vendor/cwr.js - About 2 hrs to fix

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

      import { FieldData, InvalidMessageCodes } from '../../types';
      import validateFunctions from './validateFunctions';
      
      describe('validateFunctions', () => {
        describe.each([

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

        describe('getSecondaryColumnEndpoint', () => {
          it('should return endpoint when passed service', () => {
            expect(getSecondaryColumnUrl({ service: 'mundo' })).toBe(
              '/mundo/sty-secondary-column',
            );
        src/app/lib/utilities/getUrlHelpers/getMostReadUrls/index.test.js on lines 18..32
        src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 60..74

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

        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

        describe('getLocalRadioScheduleEndpoint', () => {
          it('should return endpoint when passed service', () => {
            expect(getLocalRadioScheduleEndpoint({ service: 'hausa' })).toBe(
              './data/hausa/bbc_hausa_radio/schedule.json',
            );
        src/app/lib/utilities/getUrlHelpers/getMostReadUrls/index.test.js on lines 18..32
        src/app/lib/utilities/getUrlHelpers/getSecondaryColumnUrl/index.test.js on lines 3..14

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

        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 RadioBulletinAssetType = {
          name: 'Test Radio Bulletin promo',
          summary: 'Test Radio summary',
          indexImage: {
            id: '63711781',
        src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.test.js on lines 66..85
        src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.test.js on lines 87..106

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

        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 TVBulletinAssetType = {
          name: 'Test TV Bulletin promo',
          summary: 'Test TV summary',
          indexImage: {
            id: '63711781',
        src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.test.js on lines 66..85
        src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.test.js on lines 108..127

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

        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 GalleryAssetType = {
          name: 'Test gallery link promo',
          summary: 'This is a gallery link promo',
          indexImage: {
            id: '63692548',
        src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.test.js on lines 87..106
        src/app/routes/utils/sharedDataTransformers/filterUnknownContentTypes/index.test.js on lines 108..127

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

        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

        describe('getLocalMostReadEndpoint', () => {
          it('should return endpoint when passed service', () => {
            expect(getLocalMostReadEndpoint({ service: 'hausa' })).toBe(
              './data/hausa/mostRead/index.json',
            );
        src/app/lib/utilities/getUrlHelpers/getRadioSchedulesUrls/index.test.jsx on lines 60..74
        src/app/lib/utilities/getUrlHelpers/getSecondaryColumnUrl/index.test.js on lines 3..14

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

        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 call the view tracking hook when on dropdown navigation', () => {
              const viewTrackerSpy = jest.spyOn(viewTracking, 'default');
              render(<Navigation />, {
                bbcOrigin: 'https://www.test.bbc.co.uk',
                id: 'c0000000000o',
        Severity: Major
        Found in src/app/legacy/containers/Navigation/index.test.jsx and 1 other location - About 2 hrs to fix
        src/app/legacy/containers/Navigation/index.test.jsx on lines 137..149

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

        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 a list with three related items', () => {
                const { container } = render(
                  <WrappedStoryPromo item={indexAlsosItem} promoType="top" />,
                );
        
        
        Severity: Major
        Found in src/app/legacy/containers/StoryPromo/index.test.jsx and 1 other location - About 2 hrs to fix
        src/app/legacy/containers/StoryPromo/index.test.jsx on lines 428..434

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

        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 call the view tracking hook when on scrollable navigation', () => {
              const viewTrackerSpy = jest.spyOn(viewTracking, 'default');
              render(<Navigation />, {
                bbcOrigin: 'https://www.test.bbc.co.uk',
                id: 'c0000000000o',
        Severity: Major
        Found in src/app/legacy/containers/Navigation/index.test.jsx and 1 other location - About 2 hrs to fix
        src/app/legacy/containers/Navigation/index.test.jsx on lines 151..163

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

        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 a related item not contained within a list', () => {
                const { container } = render(
                  <WrappedStoryPromo item={onlyOneRelatedItem} promoType="top" />,
                );
                expect(container.getElementsByTagName('ul')).toHaveLength(0);
        Severity: Major
        Found in src/app/legacy/containers/StoryPromo/index.test.jsx and 1 other location - About 2 hrs to fix
        src/app/legacy/containers/StoryPromo/index.test.jsx on lines 419..426

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

        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 externalLinks = {
          default: {
            p09hxksq: [
              {
                linkText: 'Spotify',
        src/app/routes/onDemandAudio/tempData/podcastExternalLinks/burmese.js on lines 1..30

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

        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 externalLinks = {
          default: {
            p02pc9lh: [
              {
                linkText: 'Spotify',
        src/app/routes/onDemandAudio/tempData/podcastExternalLinks/kyrgyz.js on lines 1..30

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

        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 e has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        function e(e) {
                            var t = this;
                            this.ChainAnonymousCredentialsProvider = function() {
                                return _(t, void 0, void 0, (function() {
                                    return O(this, (function(e) {
        Severity: Major
        Found in public/vendor/cwr.js - About 2 hrs to fix

          Function handle has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          return t.prototype.destroy = function() {}, t.prototype.handle = function(t, n) {
                              var r = (void 0 === n ? {} : n).abortSignal,
                                  o = this.requestTimeout;
                              if (null == r ? void 0 : r.aborted) {
                                  var i = new Error("Request aborted");
          Severity: Major
          Found in public/vendor/cwr.js - About 2 hrs to fix

            Function R has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        R = function() {
                            function e(e) {
                                var t = this;
                                this.ChainAnonymousCredentialsProvider = function() {
                                    return k(t, void 0, void 0, (function() {
            Severity: Major
            Found in public/vendor/cwr.js - About 2 hrs to fix

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

              export const GridItemSmall = styled(props => (
                <Grid
                  {...props}
                  item
                  startOffset={{
              Severity: Major
              Found in src/app/legacy/components/Grid/index.jsx and 1 other location - About 2 hrs to fix
              src/app/legacy/components/Grid/index.jsx on lines 244..265

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

              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