best-doctor/ke

View on GitHub

Showing 332 of 332 total issues

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

MultiSelectWithSelectedValue.args = {
  value: [
    { text: 'first', value: '1' },
    { text: 'third', value: '3' },
  ],
Severity: Major
Found in src/django-spa/components/controls/Select/Select.stories.tsx and 1 other location - About 2 hrs to fix
src/django-spa/components/controls/Select/Select.stories.tsx on lines 92..102

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

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

ClearableMultiSelect.args = {
  value: [
    { text: 'first', value: '1' },
    { text: 'third', value: '3' },
  ],
Severity: Major
Found in src/django-spa/components/controls/Select/Select.stories.tsx and 1 other location - About 2 hrs to fix
src/django-spa/components/controls/Select/Select.stories.tsx on lines 79..89

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

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

test.each([['https://some_before_url.bestdoctor.ru'], [null]])('Cursor paginator prevUrl', (prevUrl) => {
  const meta = { ...testMeta }
  meta.before_url = prevUrl
  const paginator = new CursorPagination(meta)

Severity: Major
Found in src/admin/providers/pagination/CursorPagination.test.ts and 3 other locations - About 2 hrs to fix
src/admin/providers/pagination/CursorPagination.test.ts on lines 38..46
src/admin/providers/pagination/PagedPagination.test.ts on lines 43..51
src/admin/providers/pagination/PagedPagination.test.ts on lines 53..61

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

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

test.each([['https://some_before_url.bestdoctor.ru'], [null]])('Paged paginator prevUrl', (prevUrl) => {
  const meta = { ...testMeta }
  meta.prev_url = prevUrl
  const paginator = new PagedPagination(meta)

Severity: Major
Found in src/admin/providers/pagination/PagedPagination.test.ts and 3 other locations - About 2 hrs to fix
src/admin/providers/pagination/CursorPagination.test.ts on lines 38..46
src/admin/providers/pagination/CursorPagination.test.ts on lines 48..56
src/admin/providers/pagination/PagedPagination.test.ts on lines 43..51

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

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

test.each([['https://some_after_url.bestdoctor.ru'], [null]])('Paged paginator nextUrl', (nextUrl) => {
  const meta = { ...testMeta }
  meta.next_url = nextUrl
  const paginator = new PagedPagination(meta)

Severity: Major
Found in src/admin/providers/pagination/PagedPagination.test.ts and 3 other locations - About 2 hrs to fix
src/admin/providers/pagination/CursorPagination.test.ts on lines 38..46
src/admin/providers/pagination/CursorPagination.test.ts on lines 48..56
src/admin/providers/pagination/PagedPagination.test.ts on lines 53..61

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

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

test.each([['https://some_after_url.bestdoctor.ru'], [null]])('Cursor paginator nextUrl', (nextUrl) => {
  const meta = { ...testMeta }
  meta.after_url = nextUrl
  const paginator = new CursorPagination(meta)

Severity: Major
Found in src/admin/providers/pagination/CursorPagination.test.ts and 3 other locations - About 2 hrs to fix
src/admin/providers/pagination/CursorPagination.test.ts on lines 48..56
src/admin/providers/pagination/PagedPagination.test.ts on lines 43..51
src/admin/providers/pagination/PagedPagination.test.ts on lines 53..61

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

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

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

              <WidgetWrapper
                name={name}
                style={style}
                helpText={helpText}
                description={widgetDescription}
          Severity: Major
          Found in src/DetailView/widgets/ForeignKeySelect.tsx and 2 other locations - About 2 hrs to fix
          src/DetailView/widgets/InputWidget.tsx on lines 70..95
          src/DetailView/widgets/RegexInputWidget.tsx on lines 75..97

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

          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

              <WidgetWrapper
                name={name}
                style={style}
                helpText={helpText}
                description={widgetDescription}
          Severity: Major
          Found in src/DetailView/widgets/InputWidget.tsx and 2 other locations - About 2 hrs to fix
          src/DetailView/widgets/ForeignKeySelect.tsx on lines 117..163
          src/DetailView/widgets/RegexInputWidget.tsx on lines 75..97

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

          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

                <WidgetWrapper
                  name={name}
                  style={style}
                  helpText={helpText}
                  description={widgetDescription}
          Severity: Major
          Found in src/DetailView/widgets/RegexInputWidget.tsx and 2 other locations - About 2 hrs to fix
          src/DetailView/widgets/ForeignKeySelect.tsx on lines 117..163
          src/DetailView/widgets/InputWidget.tsx on lines 70..95

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

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

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

                  {mountComponents({
                    setInitialValue,
                    submitChange,
                    resourceName,
                    mainDetailObject: mainWizardObject,
            src/DetailView/widgets/ContainerWidget.tsx on lines 43..59

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

            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

              const containerContent = mountComponents({
                setInitialValue,
                submitChange,
                resourceName,
                mainDetailObject,
            Severity: Major
            Found in src/DetailView/widgets/ContainerWidget.tsx and 1 other location - About 2 hrs to fix
            src/WizardMaster/components/WizardStepContainer/WizardStepComponents.tsx on lines 51..67

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

            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

              const {
                name,
                mainDetailObject,
                optionLabel,
                optionValue,
            Severity: Major
            Found in src/DetailView/widgets/MultiSelectWidget.tsx and 1 other location - About 2 hrs to fix
            src/common/utils/mountComponents.tsx on lines 59..76

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

            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

            const mountComponents = ({
              setInitialValue,
              submitChange,
              resourceName,
              mainDetailObject,
            Severity: Major
            Found in src/common/utils/mountComponents.tsx and 1 other location - About 2 hrs to fix
            src/DetailView/widgets/MultiSelectWidget.tsx on lines 30..47

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

            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

              const handleChange = (value: ValueType): void => {
                const filterValue = value ? value.value : ''
            
                pushAnalytics({
                  eventName: EventNameEnum.SELECT_OPTION_CHANGE,
            Severity: Major
            Found in src/ListView/components/Table/filters.tsx and 1 other location - About 2 hrs to fix
            src/ListView/components/Table/filters.tsx on lines 271..281

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

            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