Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

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

      <div className="absolute bottom-10 right-6 z-10 w-10 space-y-2">
        <BasemapControl />
        <ZoomControl viewState={viewState} onZoomIn={handleZoomIn} onZoomOut={handleZoomOut} />
        <LegendControl />
      </div>
Severity: Major
Found in client/src/containers/analysis-eudr/map/compare.tsx and 1 other location - About 1 hr to fix
client/src/containers/analysis-eudr/map/component.tsx on lines 317..321

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

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

  @ApiOperation({
    description: 'Find all EUDR geo regions',
  })
  @ApiOkResponse({
    type: GeoRegion,
Severity: Major
Found in api/src/modules/eudr-alerts/eudr.controller.ts and 2 other locations - About 1 hr to fix
api/src/modules/eudr-alerts/eudr.controller.ts on lines 120..139
api/src/modules/eudr-alerts/eudr.controller.ts on lines 141..162

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

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

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

      <div className="absolute bottom-10 right-6 z-10 w-10 space-y-2">
        <BasemapControl />
        <ZoomControl viewState={viewState} onZoomIn={handleZoomIn} onZoomOut={handleZoomOut} />
        <LegendControl />
      </div>
Severity: Major
Found in client/src/containers/analysis-eudr/map/component.tsx and 1 other location - About 1 hr to fix
client/src/containers/analysis-eudr/map/compare.tsx on lines 357..361

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

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

  @ApiOperation({
    description:
      'Find all EUDR admin regions and return them in a tree format. Data in the "children" will recursively extend for the full depth of the tree',
  })
  @ApiOkTreeResponse({
Severity: Major
Found in api/src/modules/eudr-alerts/eudr.controller.ts and 2 other locations - About 1 hr to fix
api/src/modules/eudr-alerts/eudr.controller.ts on lines 120..139
api/src/modules/eudr-alerts/eudr.controller.ts on lines 164..192

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

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

  @ApiOperation({
    description:
      'Find all EUDR materials and return them in a tree format. Data in the "children" will recursively extend for the full depth of the tree',
  })
  @ApiOkTreeResponse({
Severity: Major
Found in api/src/modules/eudr-alerts/eudr.controller.ts and 2 other locations - About 1 hr to fix
api/src/modules/eudr-alerts/eudr.controller.ts on lines 141..162
api/src/modules/eudr-alerts/eudr.controller.ts on lines 164..192

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

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 IMPORT_DATA_FEATURES = [
  {
    id: 'materials',
    name: 'Materials',
    icon: MATERIALS_SVG,
Severity: Major
Found in marketing/src/containers/home/how/constants.tsx and 1 other location - About 1 hr to fix
marketing/src/containers/home/how/constants.tsx on lines 76..92

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

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

  getShaders(): Record<string, unknown> {
    return super.getShaders({
      vs: VertexShader,
      fs: FragmentShader,
      modules: [project32, picking],
cookie-traceability/src/lib/flowmap/layers/FlowLinesLayer/FlowLinesLayer.ts on lines 70..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 62.

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

  getShaders(): Record<string, unknown> {
    return super.getShaders({
      vs: VertexShader,
      fs: FragmentShader,
      modules: [project32, picking],
cookie-traceability/src/lib/flowmap/layers/AnimatedFlowLinesLayer/AnimatedFlowLinesLayer.ts on lines 82..89

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

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 EXPLORE_FEATURES = [
  {
    id: 'work',
    name: 'Work with suppliers & producers',
    icon: WORK_SVG,
Severity: Major
Found in marketing/src/containers/home/how/constants.tsx and 1 other location - About 1 hr to fix
marketing/src/containers/home/how/constants.tsx on lines 17..33

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

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

const useH3MaterialData = <T = H3APIResponse>(
  params: Partial<MaterialH3APIParams> = {},
  options: Partial<UseQueryOptions<H3APIResponse, AxiosError, T>> = {},
) => {
  const colors = useColors('material', COLOR_RAMPS);
Severity: Minor
Found in client/src/hooks/h3-data/material.ts - About 1 hr to fix

    Function AnalysisTableFooter has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const AnalysisTableFooter: FC = () => {
      const searchParams = useSearchParams();
      const compareScenarioId = searchParams.get('compareScenarioId');
    
      const { data: scenarioName } = useScenario(compareScenarioId, undefined, {

      Function useSocket has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const useSocket = (
        events: { [key: string]: (...args: unknown[]) => void } = {},
        options?: SocketOptions,
      ) => {
        const socketRef = useRef<Socket | undefined>(undefined);
      Severity: Minor
      Found in client/src/hooks/socket/index.ts - About 1 hr to fix

        Function postProcessYearIndicatorData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private postProcessYearIndicatorData(
            entityMap: Map<
              string,
              Map<number, ScenarioVsScenarioImpactTableRowsValues>
            >,
        Severity: Minor
        Found in api/src/modules/impact/comparison/scenario-vs-scenario.service.ts - About 1 hr to fix

          Function CustomPointsMaterial has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function CustomPointsMaterial() {
            const materialRef = useRef<ShaderMaterial>(null);
          
            const { viewport } = useThree();
          
          
          Severity: Minor
          Found in cookie-traceability/src/components/snow/material/index.tsx - About 1 hr to fix

            Function ThirdParty has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ThirdParty: React.FC = () => {
              const [userConsent, setUserConsent] = useCookie('consent', undefined);
            
              const consent = useMemo(() => {
                if (userConsent === 'true') return true;
            Severity: Minor
            Found in marketing/src/containers/third-party-cookies/component.tsx - About 1 hr to fix

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

                        <Transition
                          as="div"
                          show={!isCollapsed}
                          enter="transform transition ease-in duration-100"
                          enterFrom="opacity-10"
              Severity: Major
              Found in client/src/pages/eudr/index.tsx and 2 other locations - About 1 hr to fix
              client/src/pages/eudr/suppliers/[supplierId].tsx on lines 62..98
              client/src/layouts/analysis/component.tsx on lines 25..38

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

              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

                public async up(queryRunner: QueryRunner): Promise<void> {
                  await queryRunner.query(`
                  CREATE OR REPLACE FUNCTION get_h3_material_table_column(h3DataId uuid)
                  RETURNS TABLE (h3_table_name varchar, h3_column_name varchar) AS
                  $$
              api/src/migrations/1668073310691-SatelligenceIndicatorCalculations.ts on lines 6..46
              api/src/migrations/1668073310691-SatelligenceIndicatorCalculations.ts on lines 48..55

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

              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

                        <Transition
                          as="div"
                          show={!isCollapsed}
                          enter="transform transition ease-in duration-100"
                          enterFrom="opacity-10"
              Severity: Major
              Found in client/src/pages/eudr/suppliers/[supplierId].tsx and 2 other locations - About 1 hr to fix
              client/src/pages/eudr/index.tsx on lines 43..65
              client/src/layouts/analysis/component.tsx on lines 25..38

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

              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 class ActualVsScenarioPaginatedImpactTable {
                @ApiProperty({ type: () => ActualVsScenarioImpactTable })
                data: ActualVsScenarioImpactTable;
                @ApiProperty({ type: () => PaginationMeta })
                metadata?: PaginationMeta;
              Severity: Major
              Found in api/src/modules/impact/dto/response-actual-scenario.dto.ts and 2 other locations - About 1 hr to fix
              api/src/modules/impact/dto/response-impact-table.dto.ts on lines 20..25
              api/src/modules/impact/dto/response-scenario-scenario.dto.ts on lines 23..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 61.

              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 class PaginatedImpactTable {
                @ApiProperty({ type: () => ImpactTable })
                data: ImpactTable;
                @ApiProperty({ type: () => PaginationMeta })
                metadata?: PaginationMeta;
              Severity: Major
              Found in api/src/modules/impact/dto/response-impact-table.dto.ts and 2 other locations - About 1 hr to fix
              api/src/modules/impact/dto/response-actual-scenario.dto.ts on lines 23..28
              api/src/modules/impact/dto/response-scenario-scenario.dto.ts on lines 23..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 61.

              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