redbadger/website-honestly

View on GitHub

Showing 25 of 42 total issues

File policy.js has 960 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// @flow
/* eslint-disable react/no-unescaped-entities, max-len */

import * as React from 'react';

Severity: Major
Found in site/pages/privacy-policy/policy.js - About 2 days to fix

    File policy.js has 559 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // @flow
    import * as React from 'react';
    
    import styles from '../../components/policy/style.css';
    import { P, H3, SerifH3, B, PolicyList } from '../../components/policy/shared';
    Severity: Major
    Found in site/pages/terms-and-conditions/policy.js - About 1 day to fix

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

      import React from 'react';
      
      // Components
      import ScrollTracker from '../../../../components/scroll-tracker';
      import Social from '../../../../components/social';
      Severity: Minor
      Found in site/pages/our-work/case-study/mission-beyond/index.js - About 1 day to fix

        File definitions.js has 466 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // @flow
        import { stateToBadgerProps, genBadgersParams, getBadgersTitle } from './selectors';
        
        type RouteDefinition = {|
          title: string | ((props: Object) => string),
        Severity: Minor
        Found in site/routes/definitions.js - About 7 hrs to fix

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

          // @flow
          import React from 'react';
          
          import Social from '../../../../components/social';
          import Image from '../../../../components/image';
          Severity: Minor
          Found in site/pages/our-work/case-study/fidelity/index.js - About 5 hrs to fix

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

            // @flow
            import React from 'react';
            
            import Social from '../../../../components/social';
            import Image from '../../../../components/image';
            Severity: Minor
            Found in site/pages/our-work/case-study/nandos-loyalty/index.js - About 4 hrs to fix

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

              // @flow
              import React from 'react';
              import classnames from 'classnames/bind';
              import Social from '../../../../components/social';
              import Image from '../../../../components/image';
              Severity: Minor
              Found in site/pages/our-work/case-study/bank/index.js - About 3 hrs to fix

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

                import React from 'react';
                
                // Components
                import ScrollTracker from '../../../../components/scroll-tracker';
                import Social from '../../../../components/social';
                Severity: Minor
                Found in site/pages/our-work/case-study/pagofx/index.js - About 3 hrs to fix

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

                  import marked from 'marked';
                  import fetch from 'node-fetch';
                  import handleErrors from '../util/handle-errors';
                  
                  const badgerBrainEndpoint = () => process.env.BADGER_BRAIN_HOST;
                  Severity: Minor
                  Found in site/fetchers/badger-brain/index.js - About 2 hrs to fix

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

                    import React from 'react';
                    
                    const MapDotImage = () => (
                      <svg viewBox="0 0 927 527" xmlns="http://www.w3.org/2000/svg">
                        <defs />
                    Severity: Minor
                    Found in site/pages/our-work/case-study/pagofx/map-dot/index.js - About 2 hrs to fix

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

                      import React from 'react';
                      
                      const MapDotImage = () => (
                        <svg viewBox="0 0 927 527" xmlns="http://www.w3.org/2000/svg">
                          <defs />
                      Severity: Minor
                      Found in site/pages/our-work/case-study/mission-beyond/map-dot/index.js - About 2 hrs to fix

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

                        // @flow
                        
                        import React from 'react';
                        import classnames from 'classnames/bind';
                        
                        
                        Severity: Minor
                        Found in site/pages/our-work/case-study/fortnum-and-mason/index.js - About 2 hrs to fix

                          File policy.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          // @flow
                          /* eslint-disable react/no-unescaped-entities */
                          
                          import * as React from 'react';
                          
                          
                          Severity: Minor
                          Found in site/pages/cookie-policy/policy.js - About 2 hrs to fix

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

                            // @flow
                            import React from 'react';
                            import Cookies from 'js-cookie';
                            
                            import FormField from './formField';
                            Severity: Minor
                            Found in site/components/hubspot/form/index.js - About 2 hrs to fix

                              Function isValidTweet has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const isValidTweet = (tweet: TwitterResponse) => {
                                try {
                                  if (!tweet) {
                                    throw new Error('Missing tweet');
                                  }
                              Severity: Minor
                              Found in site/fetchers/twitter/index.js - About 1 hr 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

                              Function getSiteRoutes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export default function getSiteRoutes(state, routeDefinitions) {
                                const allRoutes = [];
                              
                                // eslint-disable-next-line no-restricted-syntax
                                for (const definition of routeDefinitions) {
                              Severity: Minor
                              Found in dev/generate-sitemap/site-routes.js - About 1 hr 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

                              Function splitEvents has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function splitEvents({
                                events, // array of events
                                timeline, // one of 'past', 'today', 'future'
                                reverse = false, // optionally reverse final list of events
                                todayDateTime = new Date(), // iso string representing today date
                              Severity: Minor
                              Found in site/fetchers/util/events.js - About 1 hr 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

                              Function scrollTo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const scrollTo = params => () => {
                                if (params.contactUs) {
                                  let el = document.getElementById('contactUs');
                              
                                  if (el && el.scrollIntoView) {
                              Severity: Minor
                              Found in site/client/index.js - About 1 hr 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

                              Function setWindowSize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                static setWindowSize() {
                                  let currentWidth = 'tablet';
                                  if (typeof window !== 'undefined') {
                                    if (window.innerWidth < screenBreakPoints.tablet) {
                                      currentWidth = 'mobile';
                              Severity: Minor
                              Found in site/pages/experience-us/index.js - About 45 mins 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

                              Function setWindowSize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                static setWindowSize() {
                                  let currentWidth = 'tablet';
                                  if (typeof window !== 'undefined') {
                                    if (window.innerWidth < screenBreakPoints.tablet) {
                                      currentWidth = 'mobile';
                              Severity: Minor
                              Found in site/slices/gc-slice/index.js - About 45 mins 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

                              Severity
                              Category
                              Status
                              Source
                              Language