Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

File base-impact.service.ts has 387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Injectable, Logger } from '@nestjs/common';
import {
  AnyImpactTableDto,
  GetActualVsScenarioImpactTableDto,
  GetImpactTableDto,
Severity: Minor
Found in api/src/modules/impact/base-impact.service.ts - About 5 hrs to fix

    Function buildIndex has 131 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function buildIndex<F>(clusterLevels: ClusterLevels): ClusterIndex<F> {
      const nodesByZoom = new Map<number, ClusterNode[]>();
      const clustersById = new Map<string, Cluster>();
      const minZoomByLocationId = new Map<string, number>();
      for (const { zoom, nodes } of clusterLevels) {
    Severity: Major
    Found in cookie-traceability/src/lib/flowmap/data/cluster/ClusterIndex.ts - About 5 hrs to fix

      Function Cookie has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Cookie(props: any) {
        const [selected, setSelected] = useState(false);
      
        const cookieRef = useRef<Group>();
      
      
      Severity: Major
      Found in cookie-traceability/src/components/cookie/component.tsx - About 5 hrs to fix

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

          const treeOptions: TreeSelectProps<IsMulti>['options'] = useMemo(
            () =>
              sortBy(
                data?.map(({ name, id, children }) => ({
                  label: name,
        Severity: Major
        Found in client/src/containers/locations/select/component.tsx and 1 other location - About 5 hrs to fix
        client/src/containers/business-units/select/component.tsx on lines 43..58

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

        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 treeOptions: TreeSelectProps['options'] = useMemo(
            () =>
              sortBy(
                data?.map(({ name, id, children }) => ({
                  label: name,
        Severity: Major
        Found in client/src/containers/business-units/select/component.tsx and 1 other location - About 5 hrs to fix
        client/src/containers/locations/select/component.tsx on lines 52..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 139.

        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

          constructor(
            protected readonly adminRegionRepository: AdminRegionRepository,
            @Inject(forwardRef(() => MaterialsService))
            protected readonly materialService: MaterialsService,
            @Inject(forwardRef(() => SuppliersService))
        Severity: Major
        Found in api/src/modules/admin-regions/admin-regions.service.ts and 3 other locations - About 5 hrs to fix
        api/src/modules/materials/materials.service.ts on lines 39..55
        api/src/modules/sourcing-locations/sourcing-locations.service.ts on lines 44..60
        api/src/modules/suppliers/suppliers.service.ts on lines 31..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 138.

        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

          constructor(
            protected readonly sourcingLocationRepository: SourcingLocationRepository,
            @Inject(forwardRef(() => AdminRegionsService))
            protected readonly adminRegionService: AdminRegionsService,
            @Inject(forwardRef(() => BusinessUnitsService))
        api/src/modules/admin-regions/admin-regions.service.ts on lines 37..53
        api/src/modules/materials/materials.service.ts on lines 39..55
        api/src/modules/suppliers/suppliers.service.ts on lines 31..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 138.

        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

          constructor(
            protected readonly materialRepository: MaterialRepository,
            @Inject(forwardRef(() => AdminRegionsService))
            protected readonly adminRegionService: AdminRegionsService,
            @Inject(forwardRef(() => BusinessUnitsService))
        Severity: Major
        Found in api/src/modules/materials/materials.service.ts and 3 other locations - About 5 hrs to fix
        api/src/modules/admin-regions/admin-regions.service.ts on lines 37..53
        api/src/modules/sourcing-locations/sourcing-locations.service.ts on lines 44..60
        api/src/modules/suppliers/suppliers.service.ts on lines 31..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 138.

        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

          constructor(
            protected readonly supplierRepository: SupplierRepository,
            @Inject(forwardRef(() => AdminRegionsService))
            protected readonly adminRegionService: AdminRegionsService,
            @Inject(forwardRef(() => BusinessUnitsService))
        Severity: Major
        Found in api/src/modules/suppliers/suppliers.service.ts and 3 other locations - About 5 hrs to fix
        api/src/modules/admin-regions/admin-regions.service.ts on lines 37..53
        api/src/modules/materials/materials.service.ts on lines 39..55
        api/src/modules/sourcing-locations/sourcing-locations.service.ts on lines 44..60

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

        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

          async getSuppliersDescendants(supplierIds: string[]): Promise<string[]> {
            // using type casting not to search for and provide the full entity, since only id is used by the method (to improve performance)
            let suppliers: Supplier[] = [];
            for (const id of supplierIds) {
              const result: Supplier[] = await this.supplierRepository.findDescendants({
        Severity: Major
        Found in api/src/modules/suppliers/suppliers.service.ts and 2 other locations - About 5 hrs to fix
        api/src/modules/business-units/business-units.service.ts on lines 100..114
        api/src/modules/materials/materials.service.ts on lines 199..210

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

        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

          async getMaterialsDescendants(materialIds: string[]): Promise<string[]> {
            // using type casting not to search for and provide the full entity, since only id is used by the method (to improve performance)
            let materials: Material[] = [];
            for (const id of materialIds) {
              const result: Material[] = await this.materialRepository.findDescendants({
        Severity: Major
        Found in api/src/modules/materials/materials.service.ts and 2 other locations - About 5 hrs to fix
        api/src/modules/business-units/business-units.service.ts on lines 100..114
        api/src/modules/suppliers/suppliers.service.ts on lines 179..190

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

        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

          async getBusinessUnitsDescendants(
            businessUnitIds: string[],
          ): Promise<string[]> {
            // using type casting not to search for and provide the full entity, since only id is used by the method (to improve performance)
            let businessUnits: BusinessUnit[] = [];
        Severity: Major
        Found in api/src/modules/business-units/business-units.service.ts and 2 other locations - About 5 hrs to fix
        api/src/modules/materials/materials.service.ts on lines 199..210
        api/src/modules/suppliers/suppliers.service.ts on lines 179..190

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

        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

            await queryRunner.query(
              'CREATE OR REPLACE FUNCTION sum_weighted_deforestation_over_georegion(\n' +
                '    geo_region_id uuid,\n' +
                '    material_id uuid,\n' +
                '    h3_data_type material_to_h3_type_enum\n' +
        api/src/migrations/1687505698725-UpdateDatasetColumnNamesForStoredProcedures.ts on lines 81..114

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

        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 useEUDRSuppliers = <T = Supplier[]>(
          params?: EUDRParams,
          options: UseQueryOptions<Supplier[], unknown, T> = {},
        ) => {
          return useQuery(
        Severity: Major
        Found in client/src/hooks/eudr/index.ts and 1 other location - About 5 hrs to fix
        client/src/hooks/eudr/index.ts on lines 59..77

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

        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 useEUDRMaterialsTree = <T = MaterialTreeItem[]>(
          params?: EUDRParams,
          options: UseQueryOptions<MaterialTreeItem[], unknown, T> = {},
        ) => {
          return useQuery(
        Severity: Major
        Found in client/src/hooks/eudr/index.ts and 1 other location - About 5 hrs to fix
        client/src/hooks/eudr/index.ts on lines 17..35

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

        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

            await queryRunner.query(
              'CREATE OR REPLACE FUNCTION sum_weighted_deforestation_over_georegion(\n' +
                '    geo_region_id uuid,\n' +
                '    material_id uuid,\n' +
                '    h3_data_type material_to_h3_type_enum\n' +
        api/src/migrations/1687505698725-UpdateDatasetColumnNamesForStoredProcedures.ts on lines 7..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 137.

        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

          @ApiOperation({ description: 'Updates a sourcing location group' })
          @ApiOkResponse({ type: SourcingLocationGroup })
          @ApiNotFoundResponse({ description: 'Sourcing location group not found' })
          @UseInterceptors(SetUserInterceptor)
          @Patch(':id')
        api/src/modules/sourcing-records/sourcing-records.controller.ts on lines 133..145

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

        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

          @ApiOperation({ description: 'Updates a sourcing record' })
          @ApiOkResponse({ type: SourcingRecord })
          @ApiNotFoundResponse({ description: 'Sourcing record not found' })
          @UseInterceptors(SetUserInterceptor)
          @Patch(':id')
        api/src/modules/sourcing-location-groups/sourcing-location-groups.controller.ts on lines 109..121

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

        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

                          {!open && !loading && (
                            <div className="flex items-center gap-1">
                              {!isEmptySelection && clearable && (
                                <button type="button" onClick={clearSelection}>
                                  <XIcon
        client/src/components/forms/select/autocomplete/component.tsx on lines 159..177

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

        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

                          {open && !loading && (
                            <div className="flex items-center gap-1">
                              {!isEmptySelection && clearable && (
                                <button type="button" onClick={clearSelection}>
                                  <XIcon
        client/src/components/forms/select/autocomplete/component.tsx on lines 178..196

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

        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