Showing 390 of 2,206 total issues

File settings.js has 9119 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module.exports = () => ({
  afaanoromoo: {
    name: 'afaanoromoo',
    font: undefined,
    isWorldService: true,
Severity: Major
Found in cypress/support/config/settings.js - About 3 wks to fix

    File cwr.js has 5146 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! License information can be found in LICENSE and LICENSE-THIRD-PARTY */
    !function() {
        var e = {
                914: function(e, t, n) {
                    "use strict";
    Severity: Major
    Found in public/vendor/cwr.js - About 2 wks to fix

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

      export const RelatedContentData = [
        {
          type: 'link',
          model: {
            locator: 'urn:bbc:cps:curie:asset:0f35c912-afc7-1a4b-9518-7853401c1149',
      Severity: Major
      Found in src/app/components/RelatedContentSection/fixture/index.ts - About 1 wk to fix

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

        import React from 'react';
        import { storiesOf } from '@storybook/react';
        import { withKnobs } from '@storybook/addon-knobs';
        import {
          withServicesKnob,
        Severity: Major
        Found in src/app/legacy/psammead/psammead-grid/src/index.stories.jsx - About 6 days to fix

          File fixtureData.ts has 2281 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            Article,
            OptimoBylineContributorBlock,
          } from '#app/models/types/optimo';
          import {
          Severity: Major
          Found in src/app/pages/ArticlePage/fixtureData.ts - About 6 days to fix

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

            import React from 'react';
            import request from 'supertest';
            import * as reactDomServer from 'react-dom/server';
            import dotenv from 'dotenv';
            import getRouteProps from '#app/routes/utils/fetchPageData/utils/getRouteProps';
            Severity: Major
            Found in src/server/index.test.jsx - About 4 days to fix

              File fixtureData.js has 1328 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              export const threeLinks = [
                {
                  id: '65244df2',
                  type: 'title',
                  model: {
              Severity: Major
              Found in src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js - About 3 days to fix

                Function r has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
                Open

                var r = (function () {
                    var r = 5,
                      n = 8 - r,
                      o = 1e3;
                    function e(t, n, o) {
                Severity: Minor
                Found in src/app/hooks/useImageColour/colorthief.js - About 2 days 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 buildParams.test.ts has 1067 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { TOPIC_PAGE } from '#app/routes/utils/pageTypes';
                import * as analyticsUtils from '#lib/analyticsUtils';
                import { RequestContextProps } from '../../../../contexts/RequestContext';
                import { ServiceConfig } from '../../../../models/types/serviceConfig';
                import { buildPageATIParams, buildPageATIUrl } from './buildParams';
                Severity: Major
                Found in src/app/components/ATIAnalytics/params/genericPage/buildParams.test.ts - About 2 days to fix

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

                  import React from 'react';
                  import { Helmet } from 'react-helmet';
                  import {
                    ARTICLE_PAGE,
                    FRONT_PAGE,
                  Severity: Major
                  Found in src/app/components/Metadata/index.test.tsx - About 2 days to fix

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

                    /* eslint-disable no-template-curly-in-string */
                    import React from 'react';
                    import { articleDataNews } from '#pages/ArticlePage/fixtureData';
                    import { data as fixData } from '#data/afrique/cpsAssets/48465371.json';
                    import styUkrainianAssetData from '#data/ukrainian/cpsAssets/news-53561143.json';
                    Severity: Major
                    Found in src/app/components/ATIAnalytics/index.test.tsx - About 2 days to fix

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

                      import Cookie from 'js-cookie';
                      import onClient from '../../../lib/utilities/onClient';
                      import {
                        ARTICLE_PAGE,
                        FRONT_PAGE,
                      Severity: Major
                      Found in src/app/components/ChartbeatAnalytics/utils/index.test.ts - About 2 days to fix

                        Function pageLayout has 423 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const pageLayout = () => {
                          return (
                            <>
                              <ATIAnalytics atiData={atiAnalytics} />
                              <ChartbeatAnalytics title={pageTitle} />
                        Severity: Major
                        Found in ws-nextjs-app/pages/ws/languages.page.tsx - About 2 days to fix

                          Function 655 has 416 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      655: function(e, t, n) {
                                          "use strict";
                                          n.r(t),
                                          n.d(t, {
                                              __extends: function() {
                          Severity: Major
                          Found in public/vendor/cwr.js - About 2 days to fix

                            Function Je has 390 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        Je = function() {
                                            function e(e) {
                                                var t = e.applyChecksum,
                                                    n = e.credentials,
                                                    r = e.region,
                            Severity: Major
                            Found in public/vendor/cwr.js - About 1 day to fix

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

                              /* eslint-disable no-template-curly-in-string */
                              import Cookie from 'js-cookie';
                              import {
                                setWindowValue,
                                resetWindowValue,
                              Severity: Major
                              Found in src/app/lib/analyticsUtils/index.test.js - About 1 day to fix

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

                                /* eslint-disable no-console */
                                import * as analyticsUtils from '../../../lib/analyticsUtils';
                                import {
                                  ARTICLE_PAGE,
                                  FRONT_PAGE,
                                Severity: Major
                                Found in src/app/components/ATIAnalytics/params/index.test.ts - About 1 day to fix

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

                                  import { TopStoryItem } from '../types';
                                  
                                  export const topStoriesItem = {
                                    headlines: {
                                      headline: 'Covid antibodies in 1 in 10 people in December',

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

                                    export const contentBlockWithByline = {
                                      content: {
                                        model: {
                                          blocks: [
                                            {

                                      Function r has 303 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      var r = (function () {
                                          var r = 5,
                                            n = 8 - r,
                                            o = 1e3;
                                          function e(t, n, o) {
                                      Severity: Major
                                      Found in src/app/hooks/useImageColour/colorthief.js - About 1 day to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language