baublet/w8mngr

View on GitHub

Showing 365 of 365 total issues

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

            <g id="triceps" {...musclesMap.TRICEPS}>
              <g transform="matrix(1,0,0,1,-30.9455,0)">
                <path
                  d="M180.138,49.285C180.138,49.285 183.852,46.688 185.161,47.435C186.47,48.183 188.9,52.95 189.18,54.913C189.461,56.876 190.676,72.486 190.676,72.486C190.676,72.486 190.208,74.431 188.9,74.907C187.591,75.384 187.779,70.849 186.787,70.353C185.795,69.857 186.742,73.869 185.75,74.184C184.758,74.5 181.873,73.103 181.873,73.103L179.679,66.657C179.679,66.657 181.737,52.739 180.138,49.285Z"
                  className="fill-current"
Severity: Major
Found in client/components/MuscleMap/MuscleMap.tsx and 9 other locations - About 3 hrs to fix
client/components/MuscleMap/MuscleMap.tsx on lines 103..116
client/components/MuscleMap/MuscleMap.tsx on lines 131..144
client/components/MuscleMap/MuscleMap.tsx on lines 145..158
client/components/MuscleMap/MuscleMap.tsx on lines 159..172
client/components/MuscleMap/MuscleMap.tsx on lines 173..186
client/components/MuscleMap/MuscleMap.tsx on lines 192..205
client/components/MuscleMap/MuscleMap.tsx on lines 206..219
client/components/MuscleMap/MuscleMap.tsx on lines 220..233
client/components/MuscleMap/MuscleMap.tsx on lines 234..247

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

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 10 locations. Consider refactoring.
Open

            <g id="calves" {...musclesMap.CALVES}>
              <g transform="matrix(1,0,0,1,-30.9455,0)">
                <path
                  d="M173.756,152.303C173.756,152.303 168.039,159.411 167.661,162.31C167.282,165.208 167.274,179.227 168.338,181.663C169.116,183.445 172.926,177.702 173.882,174.103C174.839,170.503 173.869,177.443 176.277,180.025C176.683,180.461 180.951,166.272 179.724,161.571C178.022,155.053 177.379,153.203 177.81,150.181C178.488,145.429 175.237,152.303 174.764,154.445C174.292,156.587 173.756,152.303 173.756,152.303Z"
                  className="fill-current"
Severity: Major
Found in client/components/MuscleMap/MuscleMap.tsx and 9 other locations - About 3 hrs to fix
client/components/MuscleMap/MuscleMap.tsx on lines 103..116
client/components/MuscleMap/MuscleMap.tsx on lines 117..130
client/components/MuscleMap/MuscleMap.tsx on lines 131..144
client/components/MuscleMap/MuscleMap.tsx on lines 145..158
client/components/MuscleMap/MuscleMap.tsx on lines 159..172
client/components/MuscleMap/MuscleMap.tsx on lines 192..205
client/components/MuscleMap/MuscleMap.tsx on lines 206..219
client/components/MuscleMap/MuscleMap.tsx on lines 220..233
client/components/MuscleMap/MuscleMap.tsx on lines 234..247

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

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 10 locations. Consider refactoring.
Open

            <g id="biceps" {...musclesMap.BICEPS}>
              <g transform="matrix(1,0,0,1,-0.977287,0.063171)">
                <path
                  d="M26.136,48.783C26.136,48.783 27.24,65.568 25.949,66.318C24.468,67.178 23.711,75.459 23.711,75.459C23.711,75.459 22.965,73.36 22.125,73.453C21.286,73.547 19.7,75.132 19.374,75.692C19.047,76.251 14.151,58.39 26.136,48.783Z"
                  className="fill-current"
Severity: Major
Found in client/components/MuscleMap/MuscleMap.tsx and 9 other locations - About 3 hrs to fix
client/components/MuscleMap/MuscleMap.tsx on lines 103..116
client/components/MuscleMap/MuscleMap.tsx on lines 117..130
client/components/MuscleMap/MuscleMap.tsx on lines 131..144
client/components/MuscleMap/MuscleMap.tsx on lines 145..158
client/components/MuscleMap/MuscleMap.tsx on lines 159..172
client/components/MuscleMap/MuscleMap.tsx on lines 173..186
client/components/MuscleMap/MuscleMap.tsx on lines 192..205
client/components/MuscleMap/MuscleMap.tsx on lines 220..233
client/components/MuscleMap/MuscleMap.tsx on lines 234..247

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

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 10 locations. Consider refactoring.
Open

            <g id="lats" {...musclesMap.LATS}>
              <g transform="matrix(1,0,0,1,-30.9455,0)">
                <path
                  d="M165.212,75.512C165.212,75.512 170.26,80.67 170.809,83.743C171.358,86.816 171.366,92.391 173.992,91.974C174.026,91.968 173.096,89.936 174.317,87.838C178.51,80.632 178.711,72.219 178.711,72.219L180.138,58.5C180.138,58.5 176.222,59.894 173.114,57.842C172.491,57.431 172.858,62.613 169.862,65.315C168.637,66.42 164.004,72.439 165.212,75.512Z"
                  className="fill-current"
Severity: Major
Found in client/components/MuscleMap/MuscleMap.tsx and 9 other locations - About 3 hrs to fix
client/components/MuscleMap/MuscleMap.tsx on lines 117..130
client/components/MuscleMap/MuscleMap.tsx on lines 131..144
client/components/MuscleMap/MuscleMap.tsx on lines 145..158
client/components/MuscleMap/MuscleMap.tsx on lines 159..172
client/components/MuscleMap/MuscleMap.tsx on lines 173..186
client/components/MuscleMap/MuscleMap.tsx on lines 192..205
client/components/MuscleMap/MuscleMap.tsx on lines 206..219
client/components/MuscleMap/MuscleMap.tsx on lines 220..233
client/components/MuscleMap/MuscleMap.tsx on lines 234..247

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

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 [requestResetLink, { loading }] = useRequestPasswordResetTokenMutation({
    onError: error,
    onCompleted: (response) => {
      if (response.requestPasswordResetToken.errors.length > 0) {
        error(response.requestPasswordResetToken.errors[0]);
Severity: Major
Found in client/components/ForgotPasswordForm.tsx and 1 other location - About 3 hrs to fix
client/components/MagicEmailLinkForm.tsx on lines 14..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 104.

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 10 locations. Consider refactoring.
Open

            <g id="hamstrings" {...musclesMap.HAMSTRINGS}>
              <g transform="matrix(1,0,0,1,-30.9455,0)">
                <path
                  d="M164.903,118.639C164.903,118.639 177.25,119.126 179.208,117.408C181.166,115.69 181.688,126.804 179.208,138.814C176.728,150.823 178.292,152.164 177.928,151.849C175.19,149.477 173.543,143.552 173.351,143.696C173.199,143.81 167.647,152.009 168.559,158.396C168.612,158.763 163.357,129.421 162.575,125.854C161.792,122.287 160.61,119.028 164.903,118.639Z"
                  className="fill-current"
Severity: Major
Found in client/components/MuscleMap/MuscleMap.tsx and 9 other locations - About 3 hrs to fix
client/components/MuscleMap/MuscleMap.tsx on lines 103..116
client/components/MuscleMap/MuscleMap.tsx on lines 117..130
client/components/MuscleMap/MuscleMap.tsx on lines 131..144
client/components/MuscleMap/MuscleMap.tsx on lines 145..158
client/components/MuscleMap/MuscleMap.tsx on lines 173..186
client/components/MuscleMap/MuscleMap.tsx on lines 192..205
client/components/MuscleMap/MuscleMap.tsx on lines 206..219
client/components/MuscleMap/MuscleMap.tsx on lines 220..233
client/components/MuscleMap/MuscleMap.tsx on lines 234..247

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

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 10 locations. Consider refactoring.
Open

            <g id="pectorals" {...musclesMap.PECTORALS}>
              <g transform="matrix(0.971651,0,0,0.971651,-0.433654,1.01893)">
                <path
                  d="M43.654,40.144C43.334,44.244 45.72,49.36 45.751,52.43C45.792,56.587 45.411,59.947 38.07,60.764C32.17,61.421 30.843,58.977 28.931,57.76C27.738,57.001 27.372,49.143 26.283,47.956C25.538,47.144 30.39,38.787 37.113,38.846C43.836,38.905 43.722,39.284 43.654,40.144Z"
                  className="fill-current"
Severity: Major
Found in client/components/MuscleMap/MuscleMap.tsx and 9 other locations - About 3 hrs to fix
client/components/MuscleMap/MuscleMap.tsx on lines 103..116
client/components/MuscleMap/MuscleMap.tsx on lines 117..130
client/components/MuscleMap/MuscleMap.tsx on lines 131..144
client/components/MuscleMap/MuscleMap.tsx on lines 145..158
client/components/MuscleMap/MuscleMap.tsx on lines 159..172
client/components/MuscleMap/MuscleMap.tsx on lines 173..186
client/components/MuscleMap/MuscleMap.tsx on lines 192..205
client/components/MuscleMap/MuscleMap.tsx on lines 206..219
client/components/MuscleMap/MuscleMap.tsx on lines 234..247

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

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 10 locations. Consider refactoring.
Open

            <g id="deltoids" {...musclesMap.DELTOIDS}>
              <g transform="matrix(1,0,0,1,-0.972732,-0.492107)">
                <path
                  d="M36.583,38.544C36.583,38.544 24.151,31.459 19.071,42.02C17.202,45.905 18.612,58.166 18.67,58.73C18.708,59.103 22.359,50.85 25.487,49.105C26.024,48.806 25.343,40.795 36.583,38.544Z"
                  className="fill-current"
Severity: Major
Found in client/components/MuscleMap/MuscleMap.tsx and 9 other locations - About 3 hrs to fix
client/components/MuscleMap/MuscleMap.tsx on lines 103..116
client/components/MuscleMap/MuscleMap.tsx on lines 117..130
client/components/MuscleMap/MuscleMap.tsx on lines 131..144
client/components/MuscleMap/MuscleMap.tsx on lines 145..158
client/components/MuscleMap/MuscleMap.tsx on lines 159..172
client/components/MuscleMap/MuscleMap.tsx on lines 173..186
client/components/MuscleMap/MuscleMap.tsx on lines 206..219
client/components/MuscleMap/MuscleMap.tsx on lines 220..233
client/components/MuscleMap/MuscleMap.tsx on lines 234..247

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

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

export const verifyEmailTemplate = ({
  user,
  emailVerificationToken,
}: {
  user: UserEntity;
Severity: Major
Found in api/dataServices/email/templates/verifyEmail.ts and 2 other locations - About 3 hrs to fix
api/dataServices/email/templates/emailLogin.ts on lines 4..16
api/dataServices/email/templates/forgotPassword.ts on lines 4..16

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

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

export const forgotPasswordTemplate = ({
  user,
  resetToken,
}: {
  user: UserEntity;
Severity: Major
Found in api/dataServices/email/templates/forgotPassword.ts and 2 other locations - About 3 hrs to fix
api/dataServices/email/templates/emailLogin.ts on lines 4..16
api/dataServices/email/templates/verifyEmail.ts on lines 4..18

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

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

export const emailLoginTemplate = ({
  user,
  loginToken,
}: {
  user: UserEntity;
Severity: Major
Found in api/dataServices/email/templates/emailLogin.ts and 2 other locations - About 3 hrs to fix
api/dataServices/email/templates/forgotPassword.ts on lines 4..16
api/dataServices/email/templates/verifyEmail.ts on lines 4..18

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

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

export function Privacy() {
  return (
    <div className="flex flex-col gap-4 w-full">
      <ContentContainer>
        <PageHeading>Privacy Policy</PageHeading>
Severity: Major
Found in client/pages/Privacy.tsx and 1 other location - About 3 hrs to fix
client/pages/TermsOfService.tsx on lines 8..37

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

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

export function TermsOfService() {
  return (
    <div className="flex flex-col gap-4 w-full">
      <ContentContainer>
        <PageHeading>Terms of Service</PageHeading>
Severity: Major
Found in client/pages/TermsOfService.tsx and 1 other location - About 3 hrs to fix
client/pages/Privacy.tsx on lines 8..61

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

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

File MuscleMap.tsx has 306 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import cx from "classnames";
import React from "react";

import { Muscle } from "../../generated";

Severity: Minor
Found in client/components/MuscleMap/MuscleMap.tsx - About 3 hrs to fix

    File FoodListItem.tsx has 303 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import cx from "classnames";
    import React from "react";
    import { Link, useHistory } from "react-router-dom";
    
    import { or } from "../../../shared";
    Severity: Minor
    Found in client/components/Foods/FoodListItem.tsx - About 3 hrs to fix

      Function Upload has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      export function Upload({
        limit = 1,
        bodyDrop = true,
        type = "IMAGE",
        aspectRatio = "1/1",
      Severity: Minor
      Found in client/components/Forms/Upload.tsx - About 3 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 UserPreferences.tsx has 302 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from "react";
      import { boolean, date, number, object, string } from "yup";
      
      import { getWithDefault, objectEntries } from "../../shared";
      import { GhostButton } from "../components/Button/Ghost";
      Severity: Minor
      Found in client/pages/UserPreferences.tsx - About 3 hrs to fix

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

        function sentences(num: number): string {
          const sentences: string[] = [];
        
          for (let i = 0; i < num; i++) {
            sentences.push(sentence(number({ min: 5, max: 15 })));
        Severity: Major
        Found in scripts/seedData.ts and 1 other location - About 3 hrs to fix
        scripts/seedData.ts on lines 78..86

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

        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

        function paragraphs(num: number): string {
          const paragraphs: string[] = [];
        
          for (let i = 0; i < num; i++) {
            paragraphs.push(sentences(number({ min: 3, max: 5 })));
        Severity: Major
        Found in scripts/seedData.ts and 1 other location - About 3 hrs to fix
        scripts/seedData.ts on lines 68..76

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

        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

              if (element) {
                element.removeEventListener("drop", onDrop);
                for (const event of allWatchEvents) {
                  element.removeEventListener(event, onAllDragEventsFunction);
                }
        Severity: Major
        Found in client/components/Forms/Upload.tsx and 1 other location - About 2 hrs to fix
        client/components/Forms/Upload.tsx on lines 224..235

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

        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