hadmean/hadmean

View on GitHub
src/frontend/design-system/components/Form/Stories.tsx

Summary

Maintainability
F
4 days
Test Coverage

Function DemoForm has 339 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function DemoForm() {
  return (
    <Form
      onSubmit={(values: unknown) => action(values as string)}
      render={({ handleSubmit }) => (
Severity: Major
Found in src/frontend/design-system/components/Form/Stories.tsx - About 1 day to fix

    File Stories.tsx has 377 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable react/function-component-definition */
    
    import { Story } from "@storybook/react";
    import { Field, Form } from "react-final-form";
    import { action } from "@storybook/addon-actions";
    Severity: Minor
    Found in src/frontend/design-system/components/Form/Stories.tsx - About 5 hrs to fix

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

                <Field name="descriptionText" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormInput
                      description="Some Description here"
                      label={fakeMessageDescriptor("With description")}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 1 other location - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 337..345

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

      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

                <Field name="code" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormCodeEditor
                      language="javascript"
                      label={fakeMessageDescriptor("Javascript")}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 1 other location - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 118..126

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

      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

                <Field name="disabled" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormInput
                      label={fakeMessageDescriptor("Disabled Text Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 270..278
      src/frontend/design-system/components/Form/Stories.tsx on lines 289..297
      src/frontend/design-system/components/Form/Stories.tsx on lines 308..316
      src/frontend/design-system/components/Form/Stories.tsx on lines 327..335

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

                <Field name="richText" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormRichTextArea
                      label={fakeMessageDescriptor("Disabled Rich Text")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 98..106
      src/frontend/design-system/components/Form/Stories.tsx on lines 270..278
      src/frontend/design-system/components/Form/Stories.tsx on lines 289..297
      src/frontend/design-system/components/Form/Stories.tsx on lines 308..316

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

                <Field name="dateInput" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormDateInput
                      label={fakeMessageDescriptor("Disabled Date Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 98..106
      src/frontend/design-system/components/Form/Stories.tsx on lines 289..297
      src/frontend/design-system/components/Form/Stories.tsx on lines 308..316
      src/frontend/design-system/components/Form/Stories.tsx on lines 327..335

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

                <Field name="numberInput" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormNumberInput
                      label={fakeMessageDescriptor("Disabled Number Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 98..106
      src/frontend/design-system/components/Form/Stories.tsx on lines 270..278
      src/frontend/design-system/components/Form/Stories.tsx on lines 308..316
      src/frontend/design-system/components/Form/Stories.tsx on lines 327..335

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

                <Field name="textArea" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormTextArea
                      label={fakeMessageDescriptor("Disabled Text Area Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 98..106
      src/frontend/design-system/components/Form/Stories.tsx on lines 270..278
      src/frontend/design-system/components/Form/Stories.tsx on lines 289..297
      src/frontend/design-system/components/Form/Stories.tsx on lines 327..335

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

                <Field name="richText" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormRichTextArea
                      label={fakeMessageDescriptor("Example Rich Text")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 80..87
      src/frontend/design-system/components/Form/Stories.tsx on lines 89..96
      src/frontend/design-system/components/Form/Stories.tsx on lines 261..268
      src/frontend/design-system/components/Form/Stories.tsx on lines 280..287
      src/frontend/design-system/components/Form/Stories.tsx on lines 299..306

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

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

                <Field name="examplePassword" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormPasswordInput
                      label={fakeMessageDescriptor("Example Password Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 80..87
      src/frontend/design-system/components/Form/Stories.tsx on lines 261..268
      src/frontend/design-system/components/Form/Stories.tsx on lines 280..287
      src/frontend/design-system/components/Form/Stories.tsx on lines 299..306
      src/frontend/design-system/components/Form/Stories.tsx on lines 318..325

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

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

                <Field name="textArea" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormTextArea
                      label={fakeMessageDescriptor("Example Text Area Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 80..87
      src/frontend/design-system/components/Form/Stories.tsx on lines 89..96
      src/frontend/design-system/components/Form/Stories.tsx on lines 261..268
      src/frontend/design-system/components/Form/Stories.tsx on lines 280..287
      src/frontend/design-system/components/Form/Stories.tsx on lines 318..325

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

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

                <Field name="exampleText" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormInput
                      label={fakeMessageDescriptor("Example Text Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 89..96
      src/frontend/design-system/components/Form/Stories.tsx on lines 261..268
      src/frontend/design-system/components/Form/Stories.tsx on lines 280..287
      src/frontend/design-system/components/Form/Stories.tsx on lines 299..306
      src/frontend/design-system/components/Form/Stories.tsx on lines 318..325

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

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

                <Field name="numberInput" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormNumberInput
                      label={fakeMessageDescriptor("Example Number Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 80..87
      src/frontend/design-system/components/Form/Stories.tsx on lines 89..96
      src/frontend/design-system/components/Form/Stories.tsx on lines 261..268
      src/frontend/design-system/components/Form/Stories.tsx on lines 299..306
      src/frontend/design-system/components/Form/Stories.tsx on lines 318..325

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

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

                <Field name="dateInput" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormDateInput
                      label={fakeMessageDescriptor("Example Date Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/design-system/components/Form/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/design-system/components/Form/Stories.tsx on lines 80..87
      src/frontend/design-system/components/Form/Stories.tsx on lines 89..96
      src/frontend/design-system/components/Form/Stories.tsx on lines 280..287
      src/frontend/design-system/components/Form/Stories.tsx on lines 299..306
      src/frontend/design-system/components/Form/Stories.tsx on lines 318..325

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

      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

      There are no issues that match your filters.

      Category
      Status