dashpresshq/dashpress

View on GitHub
src/frontend/components/app/form/input/Stories.tsx

Summary

Maintainability
F
4 days
Test Coverage

Function DemoForm has 305 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/components/app/form/input/Stories.tsx - About 1 day to fix

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

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

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

                <Field name="code" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormCodeEditor
                      language="javascript"
                      label={fakeMessageDescriptor("Javascript")}
      Severity: Major
      Found in src/frontend/components/app/form/input/Stories.tsx and 2 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 97..105
      src/frontend/components/app/form/input/Stories.tsx on lines 202..210

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

                <Field name="asyncSelect" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <AsyncFormSelect
                      url="http://localhost:3000/roles"
                      label={fakeMessageDescriptor("Async Select Input")}
      Severity: Major
      Found in src/frontend/components/app/form/input/Stories.tsx and 2 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 97..105
      src/frontend/components/app/form/input/Stories.tsx on lines 299..307

      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 3 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/components/app/form/input/Stories.tsx and 2 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 202..210
      src/frontend/components/app/form/input/Stories.tsx on lines 299..307

      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/components/app/form/input/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 232..240
      src/frontend/components/app/form/input/Stories.tsx on lines 251..259
      src/frontend/components/app/form/input/Stories.tsx on lines 270..278
      src/frontend/components/app/form/input/Stories.tsx on lines 289..297

      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/components/app/form/input/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 77..85
      src/frontend/components/app/form/input/Stories.tsx on lines 251..259
      src/frontend/components/app/form/input/Stories.tsx on lines 270..278
      src/frontend/components/app/form/input/Stories.tsx on lines 289..297

      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/components/app/form/input/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 77..85
      src/frontend/components/app/form/input/Stories.tsx on lines 232..240
      src/frontend/components/app/form/input/Stories.tsx on lines 270..278
      src/frontend/components/app/form/input/Stories.tsx on lines 289..297

      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/components/app/form/input/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 77..85
      src/frontend/components/app/form/input/Stories.tsx on lines 232..240
      src/frontend/components/app/form/input/Stories.tsx on lines 251..259
      src/frontend/components/app/form/input/Stories.tsx on lines 289..297

      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/components/app/form/input/Stories.tsx and 4 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 77..85
      src/frontend/components/app/form/input/Stories.tsx on lines 232..240
      src/frontend/components/app/form/input/Stories.tsx on lines 251..259
      src/frontend/components/app/form/input/Stories.tsx on lines 270..278

      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="numberInput" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormNumberInput
                      label={fakeMessageDescriptor("Example Number Input")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 59..66
      src/frontend/components/app/form/input/Stories.tsx on lines 68..75
      src/frontend/components/app/form/input/Stories.tsx on lines 223..230
      src/frontend/components/app/form/input/Stories.tsx on lines 261..268
      src/frontend/components/app/form/input/Stories.tsx on lines 280..287

      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/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 59..66
      src/frontend/components/app/form/input/Stories.tsx on lines 68..75
      src/frontend/components/app/form/input/Stories.tsx on lines 242..249
      src/frontend/components/app/form/input/Stories.tsx on lines 261..268
      src/frontend/components/app/form/input/Stories.tsx on lines 280..287

      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/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 59..66
      src/frontend/components/app/form/input/Stories.tsx on lines 68..75
      src/frontend/components/app/form/input/Stories.tsx on lines 223..230
      src/frontend/components/app/form/input/Stories.tsx on lines 242..249
      src/frontend/components/app/form/input/Stories.tsx on lines 280..287

      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="richText" validateFields={[]} validate={required}>
                  {(formProps) => (
                    <FormRichTextArea
                      label={fakeMessageDescriptor("Example Rich Text")}
                      {...formProps}
      Severity: Major
      Found in src/frontend/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 59..66
      src/frontend/components/app/form/input/Stories.tsx on lines 68..75
      src/frontend/components/app/form/input/Stories.tsx on lines 223..230
      src/frontend/components/app/form/input/Stories.tsx on lines 242..249
      src/frontend/components/app/form/input/Stories.tsx on lines 261..268

      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/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 59..66
      src/frontend/components/app/form/input/Stories.tsx on lines 223..230
      src/frontend/components/app/form/input/Stories.tsx on lines 242..249
      src/frontend/components/app/form/input/Stories.tsx on lines 261..268
      src/frontend/components/app/form/input/Stories.tsx on lines 280..287

      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/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
      src/frontend/components/app/form/input/Stories.tsx on lines 68..75
      src/frontend/components/app/form/input/Stories.tsx on lines 223..230
      src/frontend/components/app/form/input/Stories.tsx on lines 242..249
      src/frontend/components/app/form/input/Stories.tsx on lines 261..268
      src/frontend/components/app/form/input/Stories.tsx on lines 280..287

      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