FowApps/fow.ui

View on GitHub

Showing 169 of 169 total issues

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

    <svg
        width={width || 174}
        height={width ? 'auto' : 160}
        viewBox="0 0 174 160"
        fill="none"
Severity: Major
Found in src/assets/svg/PlusOwl.tsx and 1 other location - About 2 days to fix
src/assets/svg/ErrorOwl.tsx on lines 8..110

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

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

    <svg
        width={width || '86'}
        height={width || '110'}
        viewBox="0 0 86 110"
        fill="none"
Severity: Major
Found in src/assets/svg/ErrorOwl.tsx and 1 other location - About 2 days to fix
src/assets/svg/PlusOwl.tsx on lines 8..110

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

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 Table.tsx has 967 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable jsx-a11y/no-static-element-interactions */
/* eslint-disable jsx-a11y/label-has-associated-control */
// @ts-nocheck
import React, {
Severity: Major
Found in src/components/molecules/Table/Table.tsx - About 2 days to fix

    Function Select has 385 lines of code (exceeds 100 allowed). Consider refactoring.
    Open

    const Select = (props: React.PropsWithChildren<SelectProps>): JSX.Element => {
        const {
            width,
            height = 280,
            closeAfterSelect = false,
    Severity: Major
    Found in src/components/atoms/SelectV3/Select.tsx - About 1 day to fix

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

      export const setColor = (color: ColorTypes) => {
          switch (color) {
              case 'pink':
                  return css`
                      background-color: ${(props) =>
      Severity: Major
      Found in src/components/atoms/Label/styles/color.ts and 1 other location - About 1 day to fix
      src/components/atoms/Badge/styles/color.ts on lines 5..40

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 300.

      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 const setColor = (color: ColorTypes) => {
          switch (color) {
              case 'primary':
                  return css`
                      background-color: ${(props) =>
      Severity: Major
      Found in src/components/atoms/Badge/styles/color.ts and 1 other location - About 1 day to fix
      src/components/atoms/Label/styles/color.ts on lines 11..46

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

      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 DateRangePicker.style.ts has 572 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import styled, { createGlobalStyle } from 'styled-components';
      
      type Wrapper = {
          name?: string;
          hasValidationError?: boolean;

        Function Table has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
        Open

        const Table = ({
            data = [],
            columns = [],
            isLoading,
            pageSize: controlledPageSize = 10,
        Severity: Minor
        Found in src/components/molecules/Table/Table.tsx - About 1 day 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 DatePicker.style.ts has 499 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import styled, { createGlobalStyle } from 'styled-components';
        
        type Wrapper = {
            name?: string;
            hasValidationError?: boolean;
        Severity: Minor
        Found in src/components/molecules/DatePicker/styles/DatePicker.style.ts - About 1 day to fix

          File Select.tsx has 447 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable no-nested-ternary */
          import React, {
              ChangeEvent,
              UIEventHandler,
              useCallback,
          Severity: Minor
          Found in src/components/atoms/SelectV3/Select.tsx - About 6 hrs to fix

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

                            {
                                ddd: 0,
                                ind: 5,
                                ty: 0,
                                nm: 'paper',
            Severity: Major
            Found in src/assets/lotties/empty.ts and 1 other location - About 6 hrs to fix
            src/assets/lotties/empty.ts on lines 328..349

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

            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

                    {
                        ddd: 0,
                        ind: 1,
                        ty: 0,
                        nm: 'not_found 2',
            Severity: Major
            Found in src/assets/lotties/empty.ts and 1 other location - About 6 hrs to fix
            src/assets/lotties/empty.ts on lines 257..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 190.

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

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

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

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

            Refactorings

            Further Reading

            Function FormBuilder has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

            const FormBuilder = ({
                initialValues,
                disableCurrency = false,
                formInstance,
                onSubmit,
            Severity: Minor
            Found in src/components/atoms/Form/FormBuilder.tsx - About 5 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

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

            export const Label = styled.label<LabelProps>`
                display: flex;
                margin-bottom: ${(props) => props.theme.fow.spacing.xxsmall};
                color: ${(props) =>
                    props.hasError
            Severity: Major
            Found in src/components/atoms/TextArea/styles/TextArea.style.ts and 2 other locations - About 5 hrs to fix
            src/components/atoms/Input/styles/Input.style.ts on lines 129..145
            src/components/molecules/Upload/styles/Upload.style.ts on lines 46..62

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

            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 Label = styled.label<LabelProps>`
                display: flex;
                margin-bottom: ${(props) => props.theme.fow.spacing.xxsmall};
                color: ${(props) =>
                    props.hasError
            Severity: Major
            Found in src/components/atoms/Input/styles/Input.style.ts and 2 other locations - About 5 hrs to fix
            src/components/atoms/TextArea/styles/TextArea.style.ts on lines 88..104
            src/components/molecules/Upload/styles/Upload.style.ts on lines 46..62

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

            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 Label = styled.label<LabelProps>`
                display: flex;
                margin-bottom: ${(props) => props.theme.fow.spacing.xxsmall};
                color: ${(props) =>
                    props.hasError
            Severity: Major
            Found in src/components/molecules/Upload/styles/Upload.style.ts and 2 other locations - About 5 hrs to fix
            src/components/atoms/Input/styles/Input.style.ts on lines 129..145
            src/components/atoms/TextArea/styles/TextArea.style.ts on lines 88..104

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

            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

                            {
                                ddd: 0,
                                ind: 2,
                                ty: 2,
                                nm: 'paper_2',
            Severity: Major
            Found in src/assets/lotties/empty.ts and 1 other location - About 5 hrs to fix
            src/assets/lotties/empty.ts on lines 284..303

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

            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

                            {
                                ddd: 0,
                                ind: 1,
                                ty: 2,
                                nm: 'paper_1',
            Severity: Major
            Found in src/assets/lotties/empty.ts and 1 other location - About 5 hrs to fix
            src/assets/lotties/empty.ts on lines 304..323

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

            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 Editor.tsx has 365 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, {
                forwardRef,
                LegacyRef,
                useCallback,
                useContext,
            Severity: Minor
            Found in src/components/molecules/Editor/Editor.tsx - About 4 hrs to fix

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

                      default:
                          return css`
                              flex-direction: ${reverse ? 'row-reverse' : 'row'};
                              > *:not(:last-child) {
                                  ${reverse
              Severity: Major
              Found in src/components/atoms/Space/styles/space.ts and 1 other location - About 4 hrs to fix
              src/components/atoms/Space/styles/space.ts on lines 21..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 107.

              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