Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

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

  const patchPassword = (data): AxiosPromise =>
    apiService
      .request({
        method: 'PATCH',
        data,
Severity: Major
Found in client/src/hooks/profile/index.ts and 1 other location - About 1 hr to fix
client/src/hooks/profile/index.ts on lines 31..41

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

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

          <div className="space-x-10 pb-4 md:space-y-5">
            <div className="space-y-10">
              <h3 className="text-4xl font-medium md:text-5xl font-display">
                What is the legal legitimacy for the treatment of your data?
              </h3>
Severity: Major
Found in marketing/src/containers/privacy-policy/component.tsx and 1 other location - About 1 hr to fix
marketing/src/containers/privacy-policy/component.tsx on lines 180..194

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

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 patchProfile = (data: ProfilePayload): AxiosPromise =>
    apiService
      .request({
        method: 'PATCH',
        data,
Severity: Major
Found in client/src/hooks/profile/index.ts and 1 other location - About 1 hr to fix
client/src/hooks/profile/index.ts on lines 50..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 66.

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

          <div className="space-x-10 pb-4 md:space-y-5">
            <div className="space-y-10">
              <h3 className="text-4xl font-medium md:text-5xl font-display">
                Data transfer and international transfer.
              </h3>
Severity: Major
Found in marketing/src/containers/privacy-policy/component.tsx and 1 other location - About 1 hr to fix
marketing/src/containers/privacy-policy/component.tsx on lines 165..179

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

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

export const ComparisonToggle = () => {
  const dispatch = useAppDispatch();
  const { comparisonMode } = useAppSelector(scenarios);

  const getHandleChangeComparison = useCallback(
Severity: Minor
Found in client/src/components/legend/item/comparisonModeToggle.tsx - About 1 hr to fix

    Function createNewSourcingLocationsForIntervention has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async createNewSourcingLocationsForIntervention(
        sourcingLocations: SourcingLocation[],
        canceledOrReplacing: SOURCING_LOCATION_TYPE_BY_INTERVENTION,
      ): Promise<SourcingLocation[]> {
        const cancelledSourcingLocations: SourcingLocation[] = [];

      Function getDataForActualVsScenarioImpactTable has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async getDataForActualVsScenarioImpactTable(
          getActualVsScenarioImpactTable: GetActualVsScenarioImpactTableDto,
        ): Promise<ImpactTableData[]> {
          const impactDataQueryBuilder: SelectQueryBuilder<SourcingRecord> =
            this.createBasicSelectQuery(getActualVsScenarioImpactTable);
      Severity: Minor
      Found in api/src/modules/impact/impact.repository.ts - About 1 hr to fix

        Function up has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public async up(queryRunner: QueryRunner): Promise<void> {
            await queryRunner.query(`
              CREATE OR REPLACE FUNCTION sum_satelligence_deforestation_over_georegion(
            geo_region_id uuid
        )

          Function paginateTable has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static paginateTable(data: any, fetchSpecification: FetchSpecification): any {
              if (fetchSpecification.disablePagination) {
                return {
                  data,
                  metadata: undefined,
          Severity: Minor
          Found in api/src/modules/impact/base-impact.service.ts - About 1 hr to fix

            Function validateActivationToken has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async validateActivationToken(
                token: Pick<
                  ApiEventsUserData.ActivationTokenGeneratedV1Alpha1,
                  'validationToken' | 'sub'
                >,
            Severity: Minor
            Found in api/src/modules/authentication/authentication.service.ts - About 1 hr to fix

              Function calculateImpactForAllSourcingRecords has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async calculateImpactForAllSourcingRecords(
                  activeIndicators: Indicator[],
                ): Promise<void> {
                  const totalEstimatedTime: number = 600000; // 10 minutos
                  const halfTime: number = totalEstimatedTime / 2; // La mitad del tiempo para esta tarea

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

                    const hsCodeToActivateMaterialsBy: string[] = materialsFromSheet
                      .filter((i: CreateMaterialDto) => i.status === MATERIALS_STATUS.ACTIVE)
                      .map((i: CreateMaterialDto) => i.hsCodeId);
                Severity: Major
                Found in api/src/modules/materials/materials.service.ts and 1 other location - About 1 hr to fix
                api/src/modules/indicators/indicators.service.ts on lines 92..94

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

                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 totalPercentage: number =
                        materials[key].detail.reduce(
                          (acc: number, cur: any) => acc + cur.value,
                          0,
                        ) / materials[key].detail.length;
                api/src/modules/eudr-alerts/dashboard/eudr-dashboard.service.ts on lines 339..343

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

                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 nameCodesToActivateIndicatorsBy: string[] = indicatorsFromSheet
                      .filter((i: CreateIndicatorDto) => i.status === INDICATOR_STATUS.ACTIVE)
                      .map((i: CreateIndicatorDto) => i.nameCode);
                Severity: Major
                Found in api/src/modules/indicators/indicators.service.ts and 1 other location - About 1 hr to fix
                api/src/modules/materials/materials.service.ts on lines 215..217

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

                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

                            <div>
                              <Label htmlFor="fname">First name</Label>
                              <Input
                                {...register('fname')}
                                error={errors.fname?.message}
                Severity: Major
                Found in client/src/pages/auth/signup.tsx and 1 other location - About 1 hr to fix
                client/src/pages/auth/signup.tsx on lines 119..126

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

                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

                            <div>
                              <Label htmlFor="lname">Last name</Label>
                              <Input
                                {...register('lname')}
                                error={errors.lname?.message}
                Severity: Major
                Found in client/src/pages/auth/signup.tsx and 1 other location - About 1 hr to fix
                client/src/pages/auth/signup.tsx on lines 111..118

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

                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 totalPercentage: number =
                        origins[key].detail.reduce(
                          (acc: number, cur: any) => acc + cur.value,
                          0,
                        ) / origins[key].detail.length;
                api/src/modules/eudr-alerts/dashboard/eudr-dashboard.service.ts on lines 289..293

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

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

                const Banner: React.FC = () => {
                  const { basePath } = useRouter();
                  const [slidesData, setSlidesData] = useState(initialSlidesData);
                
                  const handleAfterChange = useCallback((newIndex) => {
                Severity: Minor
                Found in landing/components/banner/component.tsx - About 1 hr to fix

                  Function generateNewReplacingSourcingLocationsForNewSupplierIntervention has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    generateNewReplacingSourcingLocationsForNewSupplierIntervention(
                      dto: CreateScenarioInterventionDto,
                      sourcingData: SourcingLocation[],
                      locationData: {
                        adminRegionId: string;

                    Function CreateScenarioPage has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const CreateScenarioPage: React.FC = () => {
                      const createScenario = useCreateScenario();
                      const handleCreateScenario = useCallback(
                        (scenarioFormData: ScenarioFormData) => {
                          createScenario.mutate(scenarioFormData, {
                    Severity: Minor
                    Found in client/src/pages/data/scenarios/new.tsx - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language