Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

Function useH3ContextualData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const useH3ContextualData = <T = H3APIResponse>(
  id: Layer['id'],
  options?: UseQueryOptions<
    H3APIResponse,
    ErrorResponse,
Severity: Minor
Found in client/src/hooks/h3-data/contextual.ts - About 1 hr to fix

    Function IsSmallerOrEqualThan has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function IsSmallerOrEqualThan(
      property: string,
      validationOptions?: ValidationOptions,
    ) {
      return (object: Record<string, any>, propertyName: string): void => {
    Severity: Minor
    Found in api/src/decorators/comparison.decorator.ts - About 1 hr to fix

      Function IsGreaterOrEqualThan has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function IsGreaterOrEqualThan(
        property: string,
        validationOptions?: ValidationOptions,
      ) {
        return (object: Record<string, any>, propertyName: string): void => {
      Severity: Minor
      Found in api/src/decorators/comparison.decorator.ts - About 1 hr to fix

        Function defaultMessage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          defaultMessage(args: ValidationArguments): string {
            if (
              (args.object as SourcingDataExcelValidator).location_type ===
                LOCATION_TYPES.UNKNOWN ||
              (args.object as SourcingDataExcelValidator).location_type ===

          Function getImpactTable has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async getImpactTable(
              impactTableDto: GetImpactTableDto,
              fetchSpecification: FetchSpecification,
            ): Promise<PaginatedImpactTable> {
              const indicators: Indicator[] =
          Severity: Minor
          Found in api/src/modules/impact/impact.service.ts - About 1 hr to fix

            Function serializerConfig has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              get serializerConfig(): JSONAPISerializerConfig<ScenarioIntervention> {
                return {
                  attributes: [
                    'title',
                    'description',

              Function processDataForComparison has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                static processDataForComparison(
                  impactTableData: ImpactTableData[],
                ): ActualVsScenarioImpactTableData[] {
                  // Separate the data into different maps depending on whether data is from a scenario or not
                  const actualData: Map<string, ActualVsScenarioImpactTableData> = new Map();
              Severity: Minor
              Found in api/src/modules/impact/base-impact.service.ts - About 1 hr to fix

                Function getClosestAdminRegionByCoordinates has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  async getClosestAdminRegionByCoordinates(
                    coordinates: {
                      lng: number;
                      lat: number;
                    },
                Severity: Minor
                Found in api/src/modules/admin-regions/admin-region.repository.ts - About 1 hr to fix

                  Function getAlertSummary has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async getAlertSummary(dto: any): Promise<EUDRAlertDatabaseResult[]> {
                      const bigQueryBuilder: BigQueryAlertsQueryBuilder =
                        this.createQueryBuilder(dto);
                      bigQueryBuilder
                        .from(this.baseDataset, 'alerts')
                  Severity: Minor
                  Found in api/src/modules/eudr-alerts/alerts.repository.ts - About 1 hr to fix

                    Function getLocationTypes has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      async getLocationTypes(
                        locationTypesOptions: GetLocationTypesDto,
                      ): Promise<LocationTypesDto> {
                        if (locationTypesOptions.supported) {
                          return this.getAllSupportedLocationTypes({
                    Severity: Minor
                    Found in api/src/modules/sourcing-locations/sourcing-locations.service.ts - About 1 hr to fix

                      Function getActualVsScenarioImpactTable has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async getActualVsScenarioImpactTable(
                          dto: GetActualVsScenarioImpactTableDto,
                          fetchSpecification: FetchSpecification,
                        ): Promise<ActualVsScenarioPaginatedImpactTable> {
                          const indicators: Indicator[] =
                      Severity: Minor
                      Found in api/src/modules/impact/comparison/actual-vs-scenario.service.ts - About 1 hr to fix

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

                          const { data: t1SupplierOptions, isLoading: t1SupplierOptionsIsLoading } = useSuppliersTypes(
                            {
                              type: 't1supplier',
                              producerIds,
                              materialIds,
                        client/src/containers/analysis-visualization/analysis-filters/more-filters/component.tsx on lines 205..216

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

                        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 {
                            register: registerPassword,
                            handleSubmit: handleSubmitPassword,
                            formState: { errors },
                          } = useForm<yup.InferType<typeof passwordSchemaValidation>>({
                        Severity: Major
                        Found in client/src/containers/update-password-form/component.tsx and 1 other location - About 1 hr to fix
                        client/src/containers/update-profile-form/component.tsx on lines 20..26

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

                        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

                            () =>
                              apiService
                                .request({
                                  method: 'GET',
                                  url: `/scenario-interventions/${interventionId}`,
                        Severity: Major
                        Found in client/src/hooks/interventions/index.ts and 1 other location - About 1 hr to fix
                        client/src/hooks/interventions/index.ts on lines 29..36

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

                        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 {
                            register,
                            handleSubmit,
                            formState: { errors },
                          } = useForm<yup.InferType<typeof schemaValidation>>({
                        Severity: Major
                        Found in client/src/containers/update-profile-form/component.tsx and 1 other location - About 1 hr to fix
                        client/src/containers/update-password-form/component.tsx on lines 23..29

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

                        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 queryBuilder: SelectQueryBuilder<H3Data> = this.dataSource
                              .createQueryBuilder()
                              .select(' h3data.*')
                              .from(H3Data, 'h3data')
                              .leftJoin('indicator', 'indicator', 'h3data.indicatorId = indicator.id')
                        Severity: Major
                        Found in api/src/modules/h3-data/h3-data.repository.ts and 1 other location - About 1 hr to fix
                        api/src/modules/h3-data/h3-data.repository.ts on lines 207..219

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

                        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

                            () =>
                              apiService
                                .request({
                                  method: 'GET',
                                  url: `/scenarios/${scenarioId}/interventions`,
                        Severity: Major
                        Found in client/src/hooks/interventions/index.ts and 1 other location - About 1 hr to fix
                        client/src/hooks/interventions/index.ts on lines 53..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 59.

                        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 queryBuilder: SelectQueryBuilder<H3Data> = this.dataSource
                              .createQueryBuilder()
                              .select('h3data.*')
                              .from(H3Data, 'h3data')
                              .leftJoin(
                        Severity: Major
                        Found in api/src/modules/h3-data/h3-data.repository.ts and 1 other location - About 1 hr to fix
                        api/src/modules/h3-data/h3-data.repository.ts on lines 236..242

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

                        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 { data: producerOptions, isLoading: producerOptionsIsLoading } = useSuppliersTypes(
                            {
                              type: 'producer',
                              t1SupplierIds,
                              materialIds,
                        client/src/containers/analysis-visualization/analysis-filters/more-filters/component.tsx on lines 192..203

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

                        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 labelSelect has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const labelSelect = useMemo(() => {
                            if (isArray(selected) && selected?.[0]?.label) {
                              return (
                                <div className="flex flex-wrap gap-2">
                                  {(sortBy(selected, ['label']) as Option<T>[] | Option<string>[]).map((option) => (
                        Severity: Minor
                        Found in client/src/components/forms/select/component.tsx - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language