Showing 390 of 2,206 total issues

Function WithContextsContainer has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const WithContextsContainer = props => {
    const {
      toggles,
      bbcOrigin = null,
      status = null,
Severity: Major
Found in src/app/legacy/containers/PageHandlers/withContexts.jsx - About 2 hrs to fix

    Function quantize has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            quantize: function (h, c) {
              if (!h.length || c < 2 || c > 256) return !1;
              var f = (function (t) {
                var o,
                  i = new Array(1 << (3 * r));
    Severity: Major
    Found in src/app/hooks/useImageColour/colorthief.js - About 2 hrs to fix

      Function pt has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function s has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function s(r, n) {
              if (n.count()) {
                var o = n.r2 - n.r1 + 1,
                  i = n.g2 - n.g1 + 1,
                  u = t.max([o, i, n.b2 - n.b1 + 1]);
        Severity: Major
        Found in src/app/hooks/useImageColour/colorthief.js - About 2 hrs to fix

          Function signRequest has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          }, e.prototype.signRequest = function(e, t) {
                              var n = void 0 === t ? {} : t,
                                  r = n.signingDate,
                                  o = void 0 === r ? new Date : r,
                                  i = n.signableHeaders,
          Severity: Major
          Found in public/vendor/cwr.js - About 2 hrs to fix

            Function getPageBundleData has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const getPageBundleData = () => {
              const main = getBundlesData(
                jsFiles.filter(fileName => fileName.startsWith(`${bundleType}.main-`)),
              );
              const framework = getBundlesData(
            Severity: Major
            Found in scripts/bundleSize/getBundleData.js - About 2 hrs to fix

              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

                  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

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

                        import React, { useContext } from 'react';
                        import styled from '@emotion/styled';
                        import GRID from '#psammead/psammead-grid/src';
                        import {
                          GEL_GROUP_2_SCREEN_WIDTH_MAX,
                        Severity: Minor
                        Found in src/app/legacy/components/Grid/index.jsx - About 2 hrs to fix

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

                          import React from 'react';
                          import { RequestContextProvider } from '../../contexts/RequestContext';
                          import { ToggleContextProvider } from '../../contexts/ToggleContext';
                          import { data as pidginMostReadData } from '../../../../data/pidgin/mostRead/index.json';
                          import serbianLatMostReadData from '../../../../data/serbian/mostRead/lat.json';
                          Severity: Minor
                          Found in src/app/components/MostRead/index.test.tsx - About 2 hrs to fix

                            Function 372 has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        372: function(e) {
                                            "use strict";
                                            function t(e) {
                                                return "function" == typeof e
                                            }
                            Severity: Major
                            Found in public/vendor/cwr.js - About 2 hrs to fix

                              Function test has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      it('should be displayed if the toggle is on, and shows the expected number of items', function test() {
                                        cy.fixture(`toggles/${service}.json`).then(toggles => {
                                          const recentEpisodesEnabled = path(
                                            ['recentVideoEpisodes', 'enabled'],
                                            toggles,
                              Severity: Major
                              Found in cypress/e2e/pages/onDemandTV/tests.js - About 2 hrs to fix

                                Function handle has 56 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 Pt has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              }, Pt = function() {
                                                  function e(e) {
                                                      var t = this;
                                                      this.resourceEventListener = function(e) {
                                                          var n = [],
                                  Severity: Major
                                  Found in public/vendor/cwr.js - About 2 hrs to fix

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

                                    import React from 'react';
                                    import moment from 'moment';
                                    import {
                                      render,
                                      screen,
                                    Severity: Minor
                                    Found in src/app/legacy/components/Promo/index.test.jsx - About 2 hrs to fix

                                      File translations.ts has 260 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      /* eslint-disable camelcase */
                                      export interface Translations {
                                        pagination?: {
                                          page?: string;
                                          previousPage: string;
                                      Severity: Minor
                                      Found in src/app/models/types/translations.ts - About 2 hrs to fix

                                        Function Tn has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                    Tn = function(e) {
                                                        function t() {
                                                            var t = e.call(this) || this;
                                                            return t.pushState = function() {
                                                                var e = t;
                                        Severity: Major
                                        Found in public/vendor/cwr.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language