Showing 416 of 2,642 total issues

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

    File fixtures.ts has 669 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export const uploader = [
      {
        id: '2488a6c7',
        type: 'aresUploader',
        model: {
    Severity: Major
    Found in src/app/components/Embeds/Uploader/fixtures.ts - About 1 day to fix

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

      import moment from 'moment';
      import './ru';
      
      moment.locale('ru');
      
      
      Severity: Major
      Found in src/app/legacy/psammead/psammead-locales/moment/ru.test.js - About 1 day to fix

        File preview.tsx has 632 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useEffect } from 'react';
        import { Global } from '@emotion/react';
        import isChromatic from 'chromatic/isChromatic';
        import { forceVisible } from 'react-lazyload';
        import { Preview } from '@storybook/react';
        Severity: Major
        Found in .storybook/preview.tsx - About 1 day to fix

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

          import React from 'react';
          import { Helmet } from 'react-helmet';
          import { BrowserRouter } from 'react-router-dom';
          import mergeDeepLeft from 'ramda/src/mergeDeepLeft';
          import { RequestContextProvider } from '#contexts/RequestContext';
          Severity: Major
          Found in src/app/pages/ArticlePage/index.test.jsx - About 1 day to fix

            File fixtures.ts has 611 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const chartEmbedImages = {
              blocks: [
                {
                  type: 'image',
                  model: {
            Severity: Major
            Found in src/app/components/Embeds/EmbedImages/fixtures.ts - About 1 day to fix

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

              /* eslint-disable no-console */
              
              import React from 'react';
              import {
                renderHook,
              Severity: Major
              Found in src/app/hooks/useViewTracker/index.test.jsx - About 1 day to fix

                File outputFixture.js has 596 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // expected output of transformer given fixture: pidgin/23248703
                module.exports = {
                  content: {
                    blocks: [
                      {

                  File inputFixture.js has 596 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module.exports = {
                    content: {
                      blocks: [
                        {
                          advertising: true,

                    File fixtures.ts has 585 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    export const samplePost = {
                      typeCode: null,
                      header: {
                        model: {
                          blocks: [
                    Severity: Major
                    Found in src/app/lib/seoUtils/getLiveBlogPostingSchema/fixtures.ts - About 1 day to fix

                      File fixture.ts has 585 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      export const samplePost = {
                        typeCode: null,
                        header: {
                          model: {
                            blocks: [
                      Severity: Major
                      Found in ws-nextjs-app/pages/[service]/live/[id]/Post/fixture.ts - About 1 day to fix

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

                        import { Environments, Services } from '#app/models/types/global';
                        import getStatsDestination from '.';
                        
                        describe('getStatsDestination', () => {
                          const testScenarios = [
                        Severity: Major
                        Found in src/app/contexts/RequestContext/getStatsDestination/index.test.ts - About 1 day to fix

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

                          import React from 'react';
                          import { renderRoutes, matchRoutes } from 'react-router-config';
                          import { MemoryRouter } from 'react-router-dom';
                          
                          // test helpers
                          Severity: Major
                          Found in src/app/routes/index.test.jsx - About 1 day to fix

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

                            import moment from 'moment';
                            import './ta';
                            
                            moment.locale('ta');
                            
                            
                            Severity: Major
                            Found in src/app/legacy/psammead/psammead-locales/moment/ta.test.js - About 1 day to fix

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

                              import {
                                blockContainingText,
                                singleTextBlock,
                                textBlock,
                              } from '#models/blocks';
                              Severity: Major
                              Found in src/app/components/OptimizelyRecommendations/fixtureData.js - About 1 day to fix

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

                                import { matchPath } from 'react-router-dom';
                                import {
                                  articleDataPath,
                                  articleManifestPath,
                                  articlePath,
                                Severity: Major
                                Found in src/app/routes/utils/regex/index.test.js - About 1 day to fix

                                  File candy-xml.test.js has 561 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import candyXmlToRichText from '#psammead/psammead-rich-text-transforms/src/candy-xml';
                                  
                                  const createBody = inner =>
                                    `<body xmlns="http://www.bbc.co.uk/asset" xml:space="preserve" xml:base="http://www.bbc.co.uk/article/abc123">${inner}</body>`;
                                  
                                  

                                    File pa-in.test.js has 558 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import moment from 'moment';
                                    import './pa-in';
                                    
                                    moment.locale('pa-in');
                                    
                                    
                                    Severity: Major
                                    Found in src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js - About 1 day to fix

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

                                      import React from 'react';
                                      import { render } from '@testing-library/react';
                                      import { ToggleContextProvider } from '#contexts/ToggleContext';
                                      import * as SectionLabel from '#psammead/psammead-section-label/src';
                                      import { shouldMatchSnapshot } from '#psammead/psammead-test-helpers/src';
                                      Severity: Major
                                      Found in src/app/legacy/containers/IndexPageSection/index.test.jsx - About 1 day to fix

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

                                        import injectCspHeader, {
                                          generateChildSrc,
                                          generateConnectSrc,
                                          generateDefaultSrc,
                                          generateFontSrc,
                                        Severity: Major
                                        Found in src/server/utilities/cspHeader/index.test.js - About 1 day to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language