Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`CREATE OR REPLACE FUNCTION sum_h3_weighted_cropland_area(
    geo_region_id uuid,
    material_id uuid,
    h3_data_type material_to_h3_type_enum
Severity: Major
Found in api/src/migrations/1664874035162-UpdatedMethodologyStoredFunctions.ts - About 6 hrs to fix

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

    export class GeoCodingProgressTracker {
      totalLocations: number;
      processedLocations: number = 0;
    
      constructor(
    api/src/modules/import-data/progress-tracker/validation.progress-tracker.ts on lines 3..28

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

    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 class ValidationProgressTracker {
      totalSteps: number;
      progress: number = 0;
    
      constructor(
    api/src/modules/geo-coding/progress-tracker/geo-coding.progress-tracker.ts on lines 3..28

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

    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

            <DeckGL
              id="anotherDeckMap"
              viewState={{ ...viewState }}
              onViewStateChange={({ viewState }) => {
                viewState.longitude = Math.min(
    Severity: Major
    Found in client/src/containers/analysis-eudr/map/component.tsx and 1 other location - About 6 hrs to fix
    client/src/containers/analysis-eudr/map/compare.tsx on lines 268..329

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

    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

            <DeckGL
              id="deckMainMap"
              viewState={{ ...viewState }}
              onViewStateChange={({ viewState }) => {
                viewState.longitude = Math.min(
    Severity: Major
    Found in client/src/containers/analysis-eudr/map/compare.tsx and 1 other location - About 6 hrs to fix
    client/src/containers/analysis-eudr/map/component.tsx on lines 255..289

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

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

    const MethodologyForm: React.FC = () => {
      const [submitting, setSubmitting] = useState(false);
    
      const { register, handleSubmit, formState } = useForm({
        resolver: yupResolver(schema),
    Severity: Major
    Found in marketing/src/containers/methodology-form/component.tsx - About 6 hrs to fix

      Function Developed has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Developed: React.FC = () => {
        return (
          <section className="relative py-32 bg-white bg-cover">
            <Wrapper>
              <div className="space-y-10 md:space-y-20">
      Severity: Major
      Found in marketing/src/containers/home/developed/component.tsx - About 6 hrs to fix

        Function Legend has 150 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const Legend: React.FC = () => {
          const [showLegend, setShowLegend] = useState<boolean>(true);
          const [showSettings, setShowSettings] = useState<boolean>(false);
        
          const dispatch = useAppDispatch();

          File component.tsx has 414 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { useCallback, useState, useMemo, useEffect } from 'react';
          import { FilterIcon } from '@heroicons/react/solid';
          import {
            offset,
            shift,

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

            import {
              Injectable,
              Logger,
              ServiceUnavailableException,
            } from '@nestjs/common';

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

                public async up(queryRunner: QueryRunner): Promise<void> {
                  await queryRunner.query(`
              
                  CREATE OR REPLACE FUNCTION ${get_annual_commodity_weighted_impact_over_georegion}(
                    geo_region_id uuid,
              Severity: Major
              Found in api/src/migrations/1695954091382-AddNewImpactStoredProcedure.ts - About 5 hrs to fix

                Function How has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const How: React.FC = () => {
                  const [ref, percentage] = useScrollPercentage({
                    threshold: 0,
                  });
                
                
                Severity: Major
                Found in marketing/src/containers/home/how/component.tsx - About 5 hrs to fix

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

                  export function useSaveContactMethodologySendgrid({
                    requestConfig = {
                      method: 'POST',
                    },
                  }: UseSaveContactProps) {
                  Severity: Major
                  Found in marketing/src/hooks/methodology/index.ts and 2 other locations - About 5 hrs to fix
                  marketing/src/hooks/contact/index.ts on lines 6..28
                  marketing/src/hooks/newsletter/index.ts on lines 6..28

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

                  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

                  export function useSaveNewsletter({
                    requestConfig = {
                      method: 'PUT',
                    },
                  }: UseSaveNewsletterProps) {
                  Severity: Major
                  Found in marketing/src/hooks/newsletter/index.ts and 2 other locations - About 5 hrs to fix
                  marketing/src/hooks/contact/index.ts on lines 6..28
                  marketing/src/hooks/methodology/index.ts on lines 6..28

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

                  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

                  export function useSaveContact({
                    requestConfig = {
                      method: 'POST',
                    },
                  }: UseSaveContactProps) {
                  Severity: Major
                  Found in marketing/src/hooks/contact/index.ts and 2 other locations - About 5 hrs to fix
                  marketing/src/hooks/methodology/index.ts on lines 6..28
                  marketing/src/hooks/newsletter/index.ts on lines 6..28

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

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

                  const AdminUsersPage: React.FC = () => {
                    const { query } = useRouter();
                    const [sorting, setSorting] = useState<SortingState>([]);
                    const [pagination, setPaginationState] = useState<PaginationState>({
                      pageIndex: 1,
                  Severity: Major
                  Found in client/src/pages/profile/users.tsx - About 5 hrs to fix

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

                                      {isScenarioVsScenario && (
                                        <>
                                          <Line
                                            animationEasing="ease"
                                            animationDuration={500}
                    client/src/containers/analysis-chart/comparison-chart/component.tsx on lines 205..229

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

                    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

                                      {!isScenarioVsScenario && (
                                        <>
                                          <Line
                                            animationEasing="ease"
                                            animationDuration={500}
                    client/src/containers/analysis-chart/comparison-chart/component.tsx on lines 255..279

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

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

                      public async up(queryRunner: QueryRunner): Promise<void> {
                        /**
                         * @description: This function is used to get the h3 table name and column name for a given indicator by its name code
                         */
                        await queryRunner.query(`
                    Severity: Major
                    Found in api/src/migrations/1692854789441-UpdateImpactStoredFunctions.ts - About 5 hrs to fix

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

                                    <LocationsSelect
                                      {...field}
                                      multiple
                                      placeholder="All regions"
                                      materialIds={currentMaterialIds?.map(({ value }) => value)}
                      Severity: Major
                      Found in client/src/containers/interventions/form/component.tsx and 1 other location - About 5 hrs to fix
                      client/src/containers/interventions/form/component.tsx on lines 502..514

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

                      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