thiskevinwang/coffee-code-climb

View on GitHub

Showing 194 of 194 total issues

Function Bio has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Bio() {
  const data = useStaticQuery<Data>(bioQuery)
  const { author, social } = data.site.siteMetadata
  return (
    <div
Severity: Minor
Found in src/components/bio.tsx - About 1 hr to fix

    Function makeUpdatePreferredUsername has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const makeUpdatePreferredUsername = (rdxDispatch: Dispatch) => async (
      accessToken: string,
      refreshToken: string,
      preferredUsername: string,
      email: string
    Severity: Minor
    Found in src/utils/Playground/useCognito.ts - About 1 hr to fix

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

                  <ItemRow>
                    <ItemRow>
                      <Key>Ctrl</Key>&nbsp;+&nbsp;<Key>f</Key>
                    </ItemRow>
                    <small>Flip Cards</small>
      Severity: Major
      Found in src/components/FunButtonsModal/index.tsx and 4 other locations - About 1 hr to fix
      src/components/FunButtonsModal/index.tsx on lines 176..181
      src/components/FunButtonsModal/index.tsx on lines 182..187
      src/components/FunButtonsModal/index.tsx on lines 194..199
      src/components/FunButtonsModal/index.tsx on lines 200..205

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

      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

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

        const { postsVersion, layoutVersion, isDarkMode } = useSelector(
          (state: RootState) => ({
            postsVersion: state.postsVersion,
            layoutVersion: state.layoutVersion,
            isDarkMode: state.isDarkMode,
      Severity: Major
      Found in src/components/Layout2Components/NavBar2.tsx and 1 other location - About 1 hr to fix
      src/components/NavBar/index.tsx on lines 39..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 64.

      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

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

            AWS.config.credentials = new AWS.CognitoIdentityCredentials({
              IdentityPoolId: process.env.GATSBY_IDENTITY_POOL_ID as string,
              Logins: {
                "graph.facebook.com": response.authResponse.accessToken,
              },
      Severity: Major
      Found in src/utils/Playground/useCognito.ts and 1 other location - About 1 hr to fix
      src/utils/Playground/useCognito.ts on lines 124..129

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

      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

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

                  <ItemRow>
                    <ItemRow>
                      <Key>Ctrl</Key>&nbsp;+&nbsp;<Key>r</Key>
                    </ItemRow>
                    <small>Reset Cards</small>
      Severity: Major
      Found in src/components/FunButtonsModal/index.tsx and 4 other locations - About 1 hr to fix
      src/components/FunButtonsModal/index.tsx on lines 176..181
      src/components/FunButtonsModal/index.tsx on lines 182..187
      src/components/FunButtonsModal/index.tsx on lines 188..193
      src/components/FunButtonsModal/index.tsx on lines 200..205

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

      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

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

            AWS.config.credentials = new AWS.CognitoIdentityCredentials({
              IdentityPoolId: process.env.GATSBY_IDENTITY_POOL_ID as string,
              Logins: {
                "graph.facebook.com": response.authResponse.accessToken,
              },
      Severity: Major
      Found in src/utils/Playground/useCognito.ts and 1 other location - About 1 hr to fix
      src/utils/Playground/useCognito.ts on lines 162..167

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

      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

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

                  <ItemRow>
                    <ItemRow>
                      <Key>Ctrl</Key>&nbsp;+&nbsp;<Key>t</Key>
                    </ItemRow>
                    <small>Toggle Icon Trail</small>
      Severity: Major
      Found in src/components/FunButtonsModal/index.tsx and 4 other locations - About 1 hr to fix
      src/components/FunButtonsModal/index.tsx on lines 182..187
      src/components/FunButtonsModal/index.tsx on lines 188..193
      src/components/FunButtonsModal/index.tsx on lines 194..199
      src/components/FunButtonsModal/index.tsx on lines 200..205

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

      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

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

        const { isDarkMode, layoutVersion, postsVersion } = useSelector(
          (state: RootState) => ({
            isDarkMode: state.isDarkMode,
            layoutVersion: state.layoutVersion,
            postsVersion: state.postsVersion,
      Severity: Major
      Found in src/components/NavBar/index.tsx and 1 other location - About 1 hr to fix
      src/components/Layout2Components/NavBar2.tsx on lines 121..127

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

      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

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

                  <ItemRow>
                    <ItemRow>
                      <Key>Ctrl</Key>&nbsp;+&nbsp;<Key>d</Key>
                    </ItemRow>
                    <small>Dark Mode</small>
      Severity: Major
      Found in src/components/FunButtonsModal/index.tsx and 4 other locations - About 1 hr to fix
      src/components/FunButtonsModal/index.tsx on lines 176..181
      src/components/FunButtonsModal/index.tsx on lines 182..187
      src/components/FunButtonsModal/index.tsx on lines 188..193
      src/components/FunButtonsModal/index.tsx on lines 194..199

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

      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

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

            {previous && (
              <Link to={getSlugFromNode(previous)} rel="prev" prev>
                <label>← older</label>
                <>{getTitleFromNode(previous)}</>
              </Link>
      src/components/TemplateComponents/PrevNextNavigation/index.tsx on lines 89..94

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

      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

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

            {next && (
              <Link to={getSlugFromNode(next)} rel="next" next>
                <label>newer →</label>
                <>{getTitleFromNode(next)}</>
              </Link>
      src/components/TemplateComponents/PrevNextNavigation/index.tsx on lines 82..87

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

      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

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

                  <ItemRow>
                    <ItemRow>
                      <Key>Ctrl</Key>&nbsp;+&nbsp;<Key>s</Key>
                    </ItemRow>
                    <small>Slow Mo</small>
      Severity: Major
      Found in src/components/FunButtonsModal/index.tsx and 4 other locations - About 1 hr to fix
      src/components/FunButtonsModal/index.tsx on lines 176..181
      src/components/FunButtonsModal/index.tsx on lines 188..193
      src/components/FunButtonsModal/index.tsx on lines 194..199
      src/components/FunButtonsModal/index.tsx on lines 200..205

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

      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 makeAdminLinkProviderForUser has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const makeAdminLinkProviderForUser = (rdxDispatch: Dispatch) => async (
        email: string
      ) => {
        return alert("FIXME")
        FB.login(function (response) {
      Severity: Minor
      Found in src/utils/Playground/useCognito.ts - About 1 hr to fix

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          <svg
            viewBox="0 0 24 24"
            width="24"
            height="24"
            stroke="currentColor"
        Severity: Major
        Found in src/icons/sun.tsx and 2 other locations - About 1 hr to fix
        src/icons/moon.tsx on lines 4..17
        src/icons/question-circle.tsx on lines 4..19

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

        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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            <svg
              viewBox="0 0 24 24"
              width="24"
              height="24"
              stroke="currentColor"
        Severity: Major
        Found in src/icons/question-circle.tsx and 2 other locations - About 1 hr to fix
        src/icons/moon.tsx on lines 4..17
        src/icons/sun.tsx on lines 4..25

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

        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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          <svg
            viewBox="0 0 24 24"
            width="24"
            height="24"
            stroke="currentColor"
        Severity: Major
        Found in src/icons/moon.tsx and 2 other locations - About 1 hr to fix
        src/icons/question-circle.tsx on lines 4..19
        src/icons/sun.tsx on lines 4..25

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

        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

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

        const formButton = {
          background: Colors.SILVER_LIGHTER,
          backgroundDisabled: Colors.BLACK_DARKER,
          backgroundHover: Colors.BLACK_DARKER,
          borderColorDisabled: Colors.GREY_DARKER,
        Severity: Major
        Found in src/components/ColorSchemeProvider/Themes/dark.ts and 1 other location - About 1 hr to fix
        src/components/ColorSchemeProvider/Themes/light.ts on lines 12..19

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

        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

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

        const formButton = {
          background: Colors.BLACK_DARKER,
          backgroundDisabled: Colors.SILVER_LIGHTER,
          backgroundHover: Colors.SILVER_LIGHTER,
          borderColorDisabled: Colors.GREY_LIGHTER,
        Severity: Major
        Found in src/components/ColorSchemeProvider/Themes/light.ts and 1 other location - About 1 hr to fix
        src/components/ColorSchemeProvider/Themes/dark.ts on lines 12..19

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

        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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          try {
            const data = await cognito.initiateAuth(params).promise()
            rdxDispatch(setCognito(data, null))
          } catch (err) {
            rdxDispatch(setCognito(null, err))
        Severity: Major
        Found in src/utils/Playground/useCognito.ts and 2 other locations - About 1 hr to fix
        src/utils/Playground/useCognito.ts on lines 211..216
        src/utils/Playground/useCognito.ts on lines 231..236

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

        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

        Severity
        Category
        Status
        Source
        Language