best-doctor/ke

View on GitHub

Showing 95 of 332 total issues

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

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

    File AsyncDualSelectWidget.tsx has 254 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Flex, usePrevious } from '@chakra-ui/react'
    import React, { useCallback, useEffect, useState } from 'react'
    import type { Provider } from 'admin/providers/interfaces'
    import type { Pagination } from 'admin/providers/pagination/interfaces'
    import { ArrowLeft, ArrowRight } from 'react-feather'
    Severity: Minor
    Found in src/common/components/AsyncDualSelectWidget/AsyncDualSelectWidget.tsx - About 2 hrs to fix

      Function DateWidget has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function DateTimeWidget has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DateTimeWidget = (props: DateTimeWidgetProps): JSX.Element => {
          const {
            name,
            helpText,
            style,
        Severity: Minor
        Found in src/DetailView/widgets/DateTimeWidget.tsx - About 2 hrs to fix

          Function RowWidget has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function ReadOnlyWidget has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ReadOnlyWidget = (props: ReadOnlyWidgetProps): JSX.Element => {
              const {
                containerStore,
                style,
                helpText,
            Severity: Minor
            Found in src/DetailView/widgets/ReadOnlyWidget.tsx - About 2 hrs to fix

              Function CheckboxWidget has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const CheckboxWidget = (
                props: WidgetProps & { isDisabled?: Accessor<boolean>; isReadOnly?: Accessor<boolean> }
              ): JSX.Element => {
                const {
                  name,
              Severity: Minor
              Found in src/DetailView/widgets/CheckboxWidget.tsx - About 1 hr to fix

                Function RadioButtonWidget has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const RadioButtonWidget = (props: RadioButtonWidgetProps): JSX.Element => {
                  const {
                    name,
                    mainDetailObject,
                    containerStore,
                Severity: Minor
                Found in src/DetailView/widgets/RadioButtonWidget.tsx - About 1 hr to fix

                  Function EmailChipInputWidget has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const EmailChipInputWidget = (props: EmailChipInputWidgetProps): JSX.Element => {
                    const {
                      name,
                      helpText,
                      targetPayload,
                  Severity: Minor
                  Found in src/DetailView/widgets/EmailChipInputWidget.tsx - About 1 hr to fix

                    Function PhoneChipInputWidget has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const PhoneChipInputWidget = (props: PhoneChipInputWidgetProps): JSX.Element => {
                      const {
                        name,
                        helpText,
                        targetPayload,
                    Severity: Minor
                    Found in src/DetailView/widgets/PhoneChipInputWidget.tsx - About 1 hr to fix

                      Function WizardContainer has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const WizardContainer = (props: WizardContainerProps): JSX.Element => {
                        const {
                          wizard,
                          provider,
                          mainDetailObject,
                      Severity: Minor
                      Found in src/WizardMaster/components/WizardContainer.tsx - About 1 hr to fix

                        Function handleFileSelect has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            (event: ChangeEvent<HTMLInputElement>) => {
                              setFileErrors([])
                              const uploadingPromises = Array.from(event.target.files || []).map(
                                (file: File): Promise<CombinedFileDescriptor | null> => {
                                  const start = new Date()
                        Severity: Minor
                        Found in src/FormControls/FilesUpload/UploadButton.tsx - About 1 hr to fix

                          Function mountWizards has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const mountWizards = (kwargs: MountWizardsKwargs): JSX.Element => {
                            /*
                              Function mounts widgets for Wizard View.
                          
                              Widgets of Wizard View type use store.
                          Severity: Minor
                          Found in src/WizardMaster/mountWizards.tsx - About 1 hr to fix

                            Function DateTimeRangeWidget has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const DateTimeRangeWidget = (props: DateTimeRangeWidgetProps): JSX.Element => {
                              const {
                                name,
                                helpText,
                                targetPayload,
                            Severity: Minor
                            Found in src/DetailView/widgets/DateTimeRangeWidget.tsx - About 1 hr 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 MultiSelectFilter has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const MultiSelectFilter = (params: ResourceFilterProps): JSX.Element => {
                              const [options, setOptions] = React.useState<any>([])
                              const [storedOptions, setStoredOptions] = React.useState<Model[]>([])
                              const { name, label, filterResource, resourceName, gotoPage, provider, cacheTime, className } = params
                              const history = useHistory()
                            Severity: Minor
                            Found in src/ListView/components/Table/filters.tsx - About 1 hr to fix

                              Function useArrayValidation has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function useArrayValidation(
                                rootHook: (
                                  array: ArrayErrors,
                                  onChange: (updater: Updater<ArrayErrors>) => void,
                                  getKey: (value: unknown, index: number) => string | number
                              Severity: Minor
                              Found in src/django-spa/cdk/Forms/Validation/Array.hook.ts - About 1 hr to fix

                                Function TextValidationWidget has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const TextValidationWidget = (props: WidgetProps & { validateValue?: Accessor<any> }): JSX.Element => {
                                  const {
                                    containerStore,
                                    style,
                                    helpText,
                                Severity: Minor
                                Found in src/DetailView/widgets/TextValidationWidget.tsx - About 1 hr to fix

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

                                  export const Wizard = <Key extends string, Action extends string, StepData extends object>(
                                    props: WizardProps<Key, Action, StepData>
                                  ): JSX.Element => {
                                    const { start, steps, onFinish, onRestart, name, map } = props
                                    const [currentStep, setCurrentStep] = useState(start.step)
                                  Severity: Minor
                                  Found in src/Wizard/Wizard.tsx - About 1 hr to fix

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

                                    export function makeTable(
                                      TableComponent: StyledContainer | string = 'table',
                                      RowComponent: StyledContainer | string = 'tr',
                                      HeadComponent: StyledContainer | string = 'th',
                                      CellComponent: StyledContainer | string = 'td'
                                    Severity: Minor
                                    Found in src/django-spa/cdk/TablesOld/Table.factory.tsx - About 1 hr to fix

                                      Function useResourcesMenu has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      export const useResourcesMenu = (
                                        resources: ResourceComposerChildType | (ResourceComposerChildType | false)[] | false,
                                        permissions: string[]
                                      ): Array<MenuItemMeta> => {
                                        const menuItems = useMemo(
                                      Severity: Minor
                                      Found in src/ResourceComposer/hooks.ts - About 1 hr 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language