redbadger/website-honestly

View on GitHub

Showing 41 of 42 total issues

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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      const testimonials = [
        {
          content:
            "We have to get what Red Badger are providing. With highly skilled teams, they are doing what the big consultancies who have been in here for years just can't do or translate into meaningful outcomes. This is the first time in two decades of banking that I've seen a transformation actually look like it might succeed.",
          author: 'CIO, Financial Services',
      Severity: Major
      Found in site/pages/home/testimonials.js and 1 other location - About 1 hr to fix
      site/pages/home/client-testimonials-slice/testimonials.js on lines 1..27

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 73.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      const testimonials = [
        {
          content:
            "We have to get what Red Badger are providing. With highly skilled teams, they are doing what the big consultancies who have been in here for years just can't do or translate into meaningful outcomes. This is the first time in two decades of banking that I've seen a transformation actually look like it might succeed.",
          author: 'CIO, Financial Services',
      Severity: Major
      Found in site/pages/home/client-testimonials-slice/testimonials.js and 1 other location - About 1 hr to fix
      site/pages/home/testimonials.js on lines 1..27

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 73.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      const env = key => {
        const value = process.env[key];
        if (value) {
          return value;
        }
      Severity: Major
      Found in bin/register-github-release.js and 1 other location - About 1 hr to fix
      bin/register-github-deployment.js on lines 13..20

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 69.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      const env = key => {
        const value = process.env[key];
        if (value) {
          return value;
        }
      Severity: Major
      Found in bin/register-github-deployment.js and 1 other location - About 1 hr to fix
      bin/register-github-release.js on lines 14..21

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 69.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                  <IntroDesktopTile
                    nextCard={this.nextTile}
                    prevCard={this.prevTile}
                    currentTile={this.state.tile}
                    totalSwipableTiles={this.calculateSwipableTotal()}
      Severity: Major
      Found in site/pages/about-us/social-slice/index.js and 1 other location - About 1 hr to fix
      site/pages/about-us/social-slice/index.js on lines 178..183

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 58.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                  <IntroDesktopTile
                    nextCard={this.nextTile}
                    prevCard={this.prevTile}
                    currentTile={this.state.tile}
                    totalSwipableTiles={this.calculateSwipableTotal()}
      Severity: Major
      Found in site/pages/about-us/social-slice/index.js and 1 other location - About 1 hr to fix
      site/pages/about-us/social-slice/index.js on lines 147..152

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 58.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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 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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                      <a href={item.link}>
                        <div className={labelClassName}>{item.label}</div>
                        <div className={valueClassName}>{item.value}</div>
                      </a>
      Severity: Minor
      Found in site/components/list-box/index.js and 1 other location - About 55 mins to fix
      site/components/list-box/index.js on lines 42..45

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 54.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                      <>
                        <div className={labelClassName}>{item.label}</div>
                        <div className={valueClassName}>{item.value}</div>
                      </>
      Severity: Minor
      Found in site/components/list-box/index.js and 1 other location - About 55 mins to fix
      site/components/list-box/index.js on lines 37..40

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 54.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

      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 componentDidMount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        componentDidMount() {
          window.addEventListener('resize', () => {
            const currentWidth = GoldCoinSlice.setWindowSize();
            const videoPlaying = currentWidth !== 'mobile';
            if (videoPlaying) {
      Severity: Minor
      Found in site/slices/gc-slice/index.js - About 35 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 FormInput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      const FormInput = ({
        name,
        label,
        fieldType,
        description,
      Severity: Minor
      Found in site/components/hubspot/form/formField.js - About 35 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 validateContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        static validateContent(type: string, value: string, required: boolean) {
          // for strings with special constraints like emails or phone numbers
          // If they input has a special case retrieve that validator and run
          // the string through it
          if (inputTypes[type]) {
      Severity: Minor
      Found in site/components/hubspot/form/index.js - About 25 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 stateToProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          stateToProps: ({ badgers, goldCoinPages }, params = {}) => {
            if (goldCoinPages) {
              // find page that matches passed in slug.
              const pageData = goldCoinPages.find(page => page.slug === params.slug);
              if (pageData) {
      Severity: Minor
      Found in site/routes/definitions.js - About 25 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