best-doctor/ke

View on GitHub

Showing 332 of 332 total issues

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

  patch = async (resourceUrl: string, payload: object): Promise<Model> => {
    const { requestConfig } = this.options
    try {
      const response: BaseResponse = await this.http.patch(resourceUrl, payload, requestConfig)
      return response.data.data
Severity: Major
Found in src/admin/providers/index.ts and 1 other location - About 4 hrs to fix
src/admin/providers/index.ts on lines 152..161

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

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

test('DateInput properly rendered', () => {
  const component = mount(getComponent())

  expect(component.find(DatePicker).length).toEqual(1)
  expect(component.find(ChakraDateInput).length).toEqual(1)
src/django-spa/components/controls/DateInput/DateTimeInput.test.tsx on lines 13..19

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

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

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

          return (
            <StyledFilter>
              <Select
                className="styled-filter"
                onChange={(value: any) => handleChange(value)}
        Severity: Major
        Found in src/ListView/components/Table/filters.tsx and 1 other location - About 3 hrs to fix
        src/ListView/components/Table/filters.tsx on lines 283..295

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

        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

          return (
            <StyledFilter>
              <Select
                className="styled-filter"
                onChange={(value: any) => handleChange(value)}
        Severity: Major
        Found in src/ListView/components/Table/filters.tsx and 1 other location - About 3 hrs to fix
        src/ListView/components/Table/filters.tsx on lines 238..250

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

        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 Order: PolymorphComponent<{
          order: unknown
          onChange: (order: unknown) => void
          isLoading?: boolean
        }> = makeCommonConsumer(
        Severity: Major
        Found in src/django-spa/components/integrators/Lists/Order.ts and 1 other location - About 3 hrs to fix
        src/django-spa/components/integrators/Lists/Filters.ts on lines 10..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 113.

        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 Filters: PolymorphComponent<{
          filters: unknown
          onChange: (filters: unknown) => undefined
          isLoading?: boolean
        }> = makeCommonConsumer(
        Severity: Major
        Found in src/django-spa/components/integrators/Lists/Filters.ts and 1 other location - About 3 hrs to fix
        src/django-spa/components/integrators/Lists/Order.ts on lines 10..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 113.

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

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

            test.each([[LogLevel.TRACE], [LogLevel.DEBUG], [LogLevel.INFO]])(
              'Should call console log for levels below WARNING - %s',
              (level) => {
                const logger = getLogger()
            
            
            Severity: Major
            Found in src/django-spa/aspects/logger/adapters/console.test.ts and 1 other location - About 3 hrs to fix
            src/django-spa/aspects/logger/adapters/console.test.ts on lines 32..43

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

            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

            test.each([[LogLevel.WARNING], [LogLevel.ERROR], [LogLevel.OFF]])(
              'Should call console error for levels above WARNING - %s',
              (level) => {
                const logger = getLogger()
            
            
            Severity: Major
            Found in src/django-spa/aspects/logger/adapters/console.test.ts and 1 other location - About 3 hrs to fix
            src/django-spa/aspects/logger/adapters/console.test.ts on lines 19..30

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

            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

            testProp('Коллбэк применяется ко всем значениям', [dictArbitrary], (dict) => {
              const cbSpy = jest.fn()
            
              mapValue(dict, cbSpy)
            
            
            Severity: Major
            Found in src/django-spa/utils/dicts/mapValue.test.ts and 1 other location - About 3 hrs to fix
            src/django-spa/utils/dicts/mapKey.test.ts on lines 8..17

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

            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

            testProp('Коллбэк применяется ко всем ключам', [dictArbitrary], (dict) => {
              const cbSpy = jest.fn()
            
              mapKey(dict, cbSpy)
            
            
            Severity: Major
            Found in src/django-spa/utils/dicts/mapKey.test.ts and 1 other location - About 3 hrs to fix
            src/django-spa/utils/dicts/mapValue.test.ts on lines 8..17

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

            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

                render(
                  <dataContext.Provider value={dataCtx}>
                    <selectedContext.Provider value={[selected, onSelectedChangeSpy]}>
                      <statusContext.Provider value={statusCtx}>
                        <SelectData as={targetSpy} />
            src/django-spa/components/integrators/Lists/Selected.test.tsx on lines 17..25

            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

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

                render(
                  <dataContext.Provider value={dataCtx}>
                    <selectedContext.Provider value={[selected, onSelectedChangeSpy]}>
                      <statusContext.Provider value={statusCtx}>
                        <Selected as={targetSpy} />
            src/django-spa/components/integrators/Lists/SelectData.test.tsx on lines 17..25

            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

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

              const { getByText } = render(
                <SelectListPattern data={testData} status={testStatus} params={testParams} getKey={(item) => item}>
                  <SelectListPattern.Data as={TestData} />
                  <SelectListPattern.Selected as={TestSelected} changedSelected={testSelected} />
                </SelectListPattern>
            src/django-spa/components/patterns/Lists/SelectListPattern.spec.tsx on lines 56..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 105.

            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 { getByText } = render(
                <SelectListPattern data={testData} status={testStatus} params={testParams} getKey={(item) => item}>
                  <SelectListPattern.Data as={TestData} />
                  <SelectListPattern.Selected as={TestSelected} changedSelected={extTestSelected} />
                </SelectListPattern>
            src/django-spa/components/patterns/Lists/SelectListPattern.spec.tsx on lines 42..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 105.

            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 type ListConsumerMaker<Contexts extends ContextsRecord> = <
              K extends keyof Contexts,
              ConsumerProps = ContextsData<Pick<Contexts, K>>
            >(
              keys: K[],
            Severity: Major
            Found in src/django-spa/components/integrators/Lists/types.ts and 1 other location - About 3 hrs to fix
            src/django-spa/cdk/multiple-contexts/types.ts on lines 12..18

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

            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