bbc/psammead

View on GitHub

Showing 33 of 201 total issues

File index.stories.jsx has 2284 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 packages/components/psammead-grid/src/index.stories.jsx - About 6 days to fix

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

    const DEFAULT_BRAND_BACKGROUND_COLOUR = '#B80000';
    const DEFAULT_BRAND_FOREGROUND_COLOUR = '#FDFDFD';
    const DEFAULT_BRAND_BORDER_COLOUR = '#EAB3B3';
    const DEFAULT_BRAND_HIGHLIGHT_COLOUR = '#FFFFFF';
    
    
    Severity: Major
    Found in packages/utilities/psammead-storybook-helpers/src/text-variants.js - About 1 day to fix

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

      const { candyXmlToRichText } = require('../src/index');
      
      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 index.stories.jsx has 474 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import { storiesOf } from '@storybook/react';
        import styled from '@emotion/styled';
        import {
          color,
        Severity: Minor
        Found in packages/components/psammead-navigation/src/index.stories.jsx - About 7 hrs to fix

          File fonts.js has 461 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const baseFontUrl = 'https://gel.files.bbci.co.uk/r2.511/';
          
          const baseUrlNotoSerifSinhala =
            'https://ws-downloads.files.bbci.co.uk/fonts/NotoSerifSinhala/v1.00/';
          
          
          Severity: Minor
          Found in packages/utilities/psammead-styles/src/fonts.js - About 7 hrs to fix

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

            import React from 'react';
            import { bool, node, number, shape, oneOf } from 'prop-types';
            import styled from '@emotion/styled';
            import {
              GEL_MARGIN_BELOW_400PX,
            Severity: Minor
            Found in packages/components/psammead-grid/src/index.jsx - About 4 hrs to fix

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

              /* eslint-disable no-underscore-dangle */
              
              import React from 'react';
              import { render, act } from '@testing-library/react';
              import styled from '@emotion/styled';
              Severity: Minor
              Found in packages/components/psammead-content-anchor/src/index.test.jsx - About 3 hrs to fix

                File font-families.js has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 *  BBC REITH
                 */
                const reithFallback = `Helvetica, Arial, sans-serif;`;
                const reithSans = `font-family: ReithSans, ${reithFallback}`;
                Severity: Minor
                Found in packages/utilities/psammead-styles/src/font-families.js - About 3 hrs to fix

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

                  import React from 'react';
                  import { shouldMatchSnapshot } from '@bbc/psammead-test-helpers';
                  import Grid from '.';
                  import { ExampleParagraph, ExampleFigure, ExampleImage } from './testHelpers';
                  
                  
                  Severity: Minor
                  Found in packages/components/psammead-grid/src/index.test.jsx - About 3 hrs to fix

                    Function snapshotTests has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const snapshotTests = (Component, additionalProps) => {
                      shouldMatchSnapshot(
                        'should render landscape image correctly',
                        <Component
                          alt={landscape.alt}
                    Severity: Major
                    Found in packages/components/psammead-image/src/testHelpers/snapshotTests.jsx - About 3 hrs to fix

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

                      /* eslint-disable no-console */
                      import React from 'react';
                      import { render, waitFor } from '@testing-library/react';
                      import { shouldMatchSnapshot } from '@bbc/psammead-test-helpers';
                      import { CanonicalSocialEmbed, AmpSocialEmbed } from './index';
                      Severity: Minor
                      Found in packages/components/psammead-social-embed/src/index.test.jsx - About 3 hrs to fix

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

                        import React from 'react';
                        import styled from '@emotion/styled';
                        import { shape, string, node, bool, oneOf } from 'prop-types';
                        import VisuallyHiddenText from '@bbc/psammead-visually-hidden-text';
                        import { C_WHITE, C_EBON } from '@bbc/psammead-styles/colours';
                        Severity: Minor
                        Found in packages/components/psammead-navigation/src/index.jsx - About 2 hrs to fix

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

                          import fetch from 'cross-fetch';
                          import * as webVitals from 'web-vitals';
                          import { renderHook } from '@testing-library/react-hooks';
                          import useWebVitals from './index';
                          
                          
                          Severity: Minor
                          Found in packages/utilities/web-vitals/src/index.test.js - About 2 hrs to fix

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

                            import React, { cloneElement, useRef } from 'react';
                            import styled from '@emotion/styled';
                            import { shape, string, bool, func, oneOf, node } from 'prop-types';
                            import VisuallyHiddenText from '@bbc/psammead-visually-hidden-text';
                            import { navigationIcons } from '@bbc/psammead-assets/svgs';

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

                              /* eslint-disable no-console */
                              import React from 'react';
                              import { shouldMatchSnapshot } from '@bbc/psammead-test-helpers';
                              import { render } from '@testing-library/react';
                              import { latin, arabic } from '@bbc/gel-foundations/scripts';
                              Severity: Minor
                              Found in packages/components/psammead-section-label/src/index.test.jsx - About 2 hrs to fix

                                File index.stories.jsx has 266 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 '@bbc/psammead-image';
                                import MediaIndicator from '@bbc/psammead-media-indicator';
                                Severity: Minor
                                Found in packages/components/psammead-story-promo/src/index.stories.jsx - About 2 hrs to fix

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

                                  import React from 'react';
                                  import styled from '@emotion/styled';
                                  import {
                                    GEL_GROUP_3_SCREEN_WIDTH_MIN,
                                    GEL_GROUP_3_SCREEN_WIDTH_MAX,
                                  Severity: Minor
                                  Found in packages/components/psammead-bulletin/src/index.jsx - About 2 hrs to fix

                                    Function Brand has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const Brand = forwardRef((props, ref) => {
                                      const {
                                        svgHeight,
                                        maxWidth,
                                        minWidth,
                                    Severity: Minor
                                    Found in packages/components/psammead-brand/src/index.jsx - About 1 hr to fix

                                      Function childrenFallback has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const childrenFallback = (
                                        item,
                                        dir,
                                        columnsGroup,
                                        marginsGroup,
                                      Severity: Minor
                                      Found in packages/components/psammead-grid/src/index.jsx - About 1 hr to fix

                                        Function animationStory has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const animationStory = (
                                          dir,
                                          script,
                                          service,
                                          brandBackgroundColour,
                                        Severity: Minor
                                        Found in packages/components/psammead-navigation/src/index.stories.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language