Showing 390 of 2,206 total issues

File languages.page.tsx has 488 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Head from 'next/head';
import * as React from 'react';
import { GetServerSideProps } from 'next';
import { STATIC_PAGE } from '#app/routes/utils/pageTypes';
import ChartbeatAnalytics from '#app/components/ChartbeatAnalytics';
Severity: Minor
Found in ws-nextjs-app/pages/ws/languages.page.tsx - About 7 hrs to fix

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

    export const aresMediaCaptionBlock = {
      id: '31318aec',
      type: 'caption',
      model: {
        blocks: [
    Severity: Minor
    Found in src/app/components/MediaLoader/fixture.ts - About 7 hrs to fix

      File launchDates.js has 482 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const launchDates = {
        afaanoromoo: {
          articles: 'Sept 2019',
          frontPage: '5th Feb 2020',
          liveRadio: '30th Sept 2019',
      Severity: Minor
      Found in scripts/releaseInfo/launchDates.js - About 7 hrs to fix

        File theming.ts has 482 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        export interface BrandPalette {
          BRAND_BACKGROUND: string;
          BRAND_LOGO: string;
          BRAND_FOREGROUND: string;
          BRAND_HIGHLIGHT: string;
        Severity: Minor
        Found in src/app/models/types/theming.ts - About 7 hrs to fix

          File text-variants.ts has 481 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { Services, Variants } from '#app/models/types/global';
          
          type TextVariant = {
            text: string;
            longText: string;
          Severity: Minor
          Found in .storybook/withServicesDecorator/text-variants.ts - About 7 hrs to fix

            Function constructPageFetchUrl has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

            const constructPageFetchUrl = ({
              pathname,
              pageType,
              service,
              variant,
            Severity: Minor
            Found in src/app/routes/utils/constructPageFetchUrl/index.ts - About 7 hrs 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 index.test.jsx has 471 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import { render, cleanup } from '@testing-library/react';
            import deepClone from 'ramda/src/clone';
            import loggerMock from '#testHelpers/loggerMock';
            import { MEDIA_MISSING } from '#lib/logger.const';
            Severity: Minor
            Found in src/app/legacy/containers/StoryPromo/index.test.jsx - About 7 hrs to fix

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

              import moment from 'moment';
              import './ar';
              
              moment.locale('ar');
              
              
              Severity: Minor
              Found in src/app/legacy/psammead/psammead-locales/moment/ar.test.js - About 7 hrs to fix

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

                import moment from 'moment';
                import './uk';
                
                moment.locale('uk');
                
                
                Severity: Minor
                Found in src/app/legacy/psammead/psammead-locales/moment/uk.test.js - About 6 hrs to fix

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

                  import moment from 'moment';
                  import './mr';
                  
                  moment.locale('mr');
                  
                  
                  Severity: Minor
                  Found in src/app/legacy/psammead/psammead-locales/moment/mr.test.js - About 6 hrs to fix

                    File index.test.jsx has 449 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: Minor
                    Found in src/app/routes/index.test.jsx - About 6 hrs to fix

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

                      /* eslint-disable jsx-a11y/click-events-have-key-events */
                      /* eslint-disable jsx-a11y/no-static-element-interactions */
                      import React from 'react';
                      import userEvent from '@testing-library/user-event';
                      import { waitFor } from '@testing-library/dom';
                      Severity: Minor
                      Found in src/app/hooks/useClickTrackerHandler/index.test.jsx - About 6 hrs to fix

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

                        import { MEDIA_ASSET_PAGE, STORY_PAGE } from '#app/routes/utils/pageTypes';
                        import relItems from '../IndexAlsos/relatedItems';
                        
                        export const completeItem = {
                          headlines: {
                        Severity: Minor
                        Found in src/app/legacy/containers/StoryPromo/helpers/fixtureData.js - About 6 hrs to fix

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

                          /* eslint-disable */
                          import moment from 'moment';
                          import './hi';
                          
                          moment.locale('hi');
                          Severity: Minor
                          Found in src/app/legacy/psammead/psammead-locales/moment/hi.test.js - About 6 hrs to fix

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

                            import moment from 'moment';
                            import './sr';
                            
                            moment.locale('sr');
                            
                            
                            Severity: Minor
                            Found in src/app/legacy/psammead/psammead-locales/moment/sr.test.js - About 6 hrs to fix

                              File sr-cyrl.test.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import moment from 'moment';
                              import './sr-cyrl';
                              
                              moment.locale('sr-cyrl');
                              
                              
                              Severity: Minor
                              Found in src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js - About 6 hrs to fix

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

                                import moment from 'moment';
                                import './ne';
                                
                                moment.locale('ne');
                                
                                
                                Severity: Minor
                                Found in src/app/legacy/psammead/psammead-locales/moment/ne.test.js - About 6 hrs to fix

                                  File colorthief.js has 427 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /*
                                  The colorthief module does not seem to be compatible with
                                  yarn v3 due to how it references github sub dependencies
                                  
                                  This file is from:
                                  Severity: Minor
                                  Found in src/app/hooks/useImageColour/colorthief.js - About 6 hrs to fix

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

                                    import moment from 'moment';
                                    import './gu';
                                    
                                    moment.locale('gu');
                                    
                                    
                                    Severity: Minor
                                    Found in src/app/legacy/psammead/psammead-locales/moment/gu.test.js - About 6 hrs to fix

                                      File pt-br.test.js has 425 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import moment from 'moment';
                                      import './pt-br';
                                      
                                      moment.locale('pt-br');
                                      
                                      
                                      Severity: Minor
                                      Found in src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js - About 6 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language