best-doctor/ke

View on GitHub

Showing 95 of 332 total issues

Function AsyncDualSelectWidget has 212 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AsyncDualSelectWidget = (props: DualSelectWidgetProps): JSX.Element => {
  const {
    name,
    style,
    helpText,
Severity: Major
Found in src/common/components/AsyncDualSelectWidget/AsyncDualSelectWidget.tsx - About 1 day to fix

    Function WizardStepContainer has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const WizardStepContainer = (props: WizardViewContainerProps): JSX.Element => {
      const wizardStepRef = React.useRef<WizardStepContainerRef>(null)
      const {
        wizard,
        wizardStep,

      File filters.tsx has 383 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Это легаси
      /* eslint-disable react/jsx-props-no-spreading */
      import React, { useState } from 'react'
      import InputMask, { Props as InputMaskProps } from 'react-input-mask'
      import { Box } from '@chakra-ui/react'
      Severity: Minor
      Found in src/ListView/components/Table/filters.tsx - About 5 hrs to fix

        Function Bottom has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const Bottom = (props: BottonProps): JSX.Element => {
          const {
            resourceName,
            pageIndex,
            canPreviousPage,
        Severity: Major
        Found in src/ListView/components/Table/Bottom.tsx - About 4 hrs to fix

          Function RenderDetail has 105 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const RenderDetail = (props: RenderDetailProps): JSX.Element => {
            /*
              Entry point for displaying components in https://myspa.com/some-url/100500 route format.
          
              Here we fetch data from the backend using the url that we specified in a
          Severity: Major
          Found in src/DetailView/RenderDetail.tsx - About 4 hrs to fix

            Function ForeignKeySelectWidget has 102 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ForeignKeySelectWidget = (props: ForeignKeySelectWidgetProps): JSX.Element => {
              const {
                name,
                mainDetailObject,
                provider,
            Severity: Major
            Found in src/DetailView/widgets/ForeignKeySelect.tsx - About 4 hrs to fix

              Function DateTimeRangeListWidget has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const DateTimeRangeListWidget = (props: DateTimeRangeWidgetProps): JSX.Element => {
                const {
                  name,
                  helpText,
                  targetPayload,
              Severity: Major
              Found in src/DetailView/widgets/DateTimeRangeListWidget.tsx - About 3 hrs to fix

                Function ChipInput has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const ChipInput = forwardRef<HTMLInputElement, ChipInputProps>((props, ref): JSX.Element => {
                  const {
                    value: inputValue,
                    onChange,
                    placeholder,
                Severity: Major
                Found in src/django-spa/components/controls/ChipInput/ChipInput.tsx - About 3 hrs to fix

                  Function AsyncDualSelectWidget has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const AsyncDualSelectWidget = (props: DualSelectWidgetProps): JSX.Element => {
                    const {
                      name,
                      style,
                      helpText,
                  Severity: Minor
                  Found in src/common/components/AsyncDualSelectWidget/AsyncDualSelectWidget.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

                  Function MultiSelectWidget has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const MultiSelectWidget = (props: MultiSelectWidgetProps): JSX.Element => {
                    const {
                      name,
                      mainDetailObject,
                      optionLabel,
                  Severity: Major
                  Found in src/DetailView/widgets/MultiSelectWidget.tsx - About 2 hrs to fix

                    Function DateTimeRangeWidget has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const DateTimeRangeWidget = (props: DateTimeRangeWidgetProps): JSX.Element => {
                      const {
                        name,
                        helpText,
                        targetPayload,
                    Severity: Major
                    Found in src/DetailView/widgets/DateTimeRangeWidget.tsx - About 2 hrs to fix

                      Function ContainerWidget has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const ContainerWidget = (props: any): JSX.Element => {
                        const {
                          setInitialValue,
                          submitChange,
                          resourceName,
                      Severity: Major
                      Found in src/DetailView/widgets/ContainerWidget.tsx - About 2 hrs to fix

                        Function InputWidget has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const InputWidget = forwardRef<HTMLInputElement, InputWidgetProps>((props: InputWidgetProps, ref): JSX.Element => {
                          const {
                            name,
                            helpText,
                            targetPayload,
                        Severity: Major
                        Found in src/DetailView/widgets/InputWidget.tsx - About 2 hrs to fix

                          Function Wizard has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const Wizard = (props: WizardProps): JSX.Element => {
                            const {
                              wizard,
                              provider,
                              mainDetailObject,
                          Severity: Major
                          Found in src/WizardMaster/components/Wizard.tsx - About 2 hrs to fix

                            Function BaseSelectWidget has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              (props: BaseSelectWidgetProps, ref): JSX.Element => {
                                const {
                                  name,
                                  helpText,
                                  description,
                            Severity: Major
                            Found in src/DetailView/widgets/SelectWidget.tsx - About 2 hrs to fix

                              Function WizardStepControlPanel has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const WizardStepControlPanel = (props: WizardStepControlPanelProps): JSX.Element => {
                                const {
                                  wizardStep,
                                  wizard,
                                  submitChange,

                                Function SelectList has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const SelectList = ({
                                  values,
                                  selectedValues,
                                  getOptionLabel,
                                  getOptionValue,
                                Severity: Minor
                                Found in src/common/components/AsyncDualSelectWidget/SelectList/SelectList.tsx - About 2 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

                                Function useRecordValidation has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function useRecordValidation<K extends ErrorsKey>(
                                  useRoot: (record: RecordErrors<K>, onChange: (updater: Updater<RecordErrors<K>>) => void) => RootProviderDesc,
                                  useCheck: (
                                    validator: RecordValidator
                                  ) => ValidationState<Record<K, ValidationError[] | null>> & { validate: RecordValidator },
                                Severity: Major
                                Found in src/django-spa/cdk/Forms/Validation/Record.hook.ts - About 2 hrs to fix

                                  Function ForeignKeySelectFilter has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const ForeignKeySelectFilter = (params: ForeignKeySelectFilterProps): JSX.Element => {
                                    const {
                                      name,
                                      label,
                                      resourceName,
                                  Severity: Major
                                  Found in src/ListView/components/Table/filters.tsx - About 2 hrs to fix

                                    Function makeTable has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function makeTable<Components extends TableComponents, Plugin extends TablePlugin>(
                                      tableComponents: Components,
                                      plugins: Plugin[] = []
                                    ): <T>(
                                      props: TableProps<
                                    Severity: Major
                                    Found in src/django-spa/cdk/tables/makeTable.tsx - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language