Vizzuality/landgriffon

View on GitHub

Showing 1,154 of 1,154 total issues

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

export class GeoRegionsController {
  constructor(public readonly geoRegionsService: GeoRegionsService) {}

  @ApiOperation({
    description: 'Find all geo regions',
Severity: Major
Found in api/src/modules/geo-regions/geo-regions.controller.ts and 2 other locations - About 4 days to fix
api/src/modules/indicator-coefficients/indicator-coefficients.controller.ts on lines 42..127
api/src/modules/indicator-records/indicator-records.controller.ts on lines 42..125

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

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 IndicatorRecordsController {
  constructor(
    public readonly indicatorRecordService: IndicatorRecordsService,
  ) {}

api/src/modules/geo-regions/geo-regions.controller.ts on lines 42..118
api/src/modules/indicator-coefficients/indicator-coefficients.controller.ts on lines 42..127

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

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 IndicatorCoefficientsController {
  constructor(
    public readonly indicatorCoefficientsService: IndicatorCoefficientsService,
  ) {}

api/src/modules/geo-regions/geo-regions.controller.ts on lines 42..118
api/src/modules/indicator-records/indicator-records.controller.ts on lines 42..125

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

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

const PrivacyPolicy: React.FC = () => {
  return (
    <section className="bg-white">
      <Wrapper>
        <div className="pt-12 pb-10 space-y-10 md:pt-32 md:pb-16 md:w-8/12">
Severity: Major
Found in marketing/src/containers/privacy-policy/component.tsx - About 3 days to fix

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

    export class InterventionLocationLatitudeInputValidator
      implements ValidatorConstraintInterface
    {
      validate(newLocationLatitude: number, args: ValidationArguments): boolean {
        const dto: CreateScenarioInterventionDto =
    api/src/modules/scenario-interventions/dto/custom-validators/longitude-input.custom.validator.ts on lines 10..67

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 500.

    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 InterventionLocationLongitudeInputValidator
      implements ValidatorConstraintInterface
    {
      validate(newLocationLongitude: number, args: ValidationArguments): boolean {
        const dto: CreateScenarioInterventionDto =
    api/src/modules/scenario-interventions/dto/custom-validators/latitude-input.custom.validator.ts on lines 10..67

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 500.

    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

      private populateValuesRecursively(
        entity: ScenarioVsScenarioImpactTableRows,
        entityDataMap: Map<
          string,
          Map<number, ScenarioVsScenarioImpactTableRowsValues>
    api/src/modules/impact/comparison/actual-vs-scenario.service.ts on lines 288..350

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

    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

      private populateValuesRecursively(
        entity: ActualVsScenarioImpactTableRows,
        entityDataMap: Map<
          string,
          Map<number, ActualVsScenarioImpactTableRowsValues>
    api/src/modules/impact/comparison/scenario-vs-scenario.service.ts on lines 202..271

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

    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

      private buildImpactTable(
        queryDto: GetScenarioVsScenarioImpactTableDto,
        indicators: Indicator[],
        dataForImpactTable: ScenarioVsScenarioImpactTableData[],
        entityTree: ImpactTableEntityType[],
    api/src/modules/impact/comparison/actual-vs-scenario.service.ts on lines 106..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 475.

    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

      private buildActualVsScenarioImpactTable(
        queryDto: GetActualVsScenarioImpactTableDto,
        indicators: Indicator[],
        dataForImpactTable: ActualVsScenarioImpactTableData[],
        entityTree: ImpactTableEntityType[],
    api/src/modules/impact/comparison/scenario-vs-scenario.service.ts on lines 123..196

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 475.

    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

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

    import { useEffect, useMemo, useRef } from 'react';
    import { useRouter } from 'next/router';
    import { useForm, Controller } from 'react-hook-form';
    import { RadioGroup, Disclosure } from '@headlessui/react';
    import { yupResolver } from '@hookform/resolvers/yup';
    Severity: Major
    Found in client/src/containers/interventions/form/component.tsx - About 2 days to fix

      File FlowMapSelectors.ts has 1034 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Copyright 2022 FlowmapBlue
       * Copyright 2018-2020 Teralytics, modified by FlowmapBlue
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
      Severity: Major
      Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 2 days to fix

        Function AnalysisTable has 381 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const AnalysisTable = () => {
          const [paginationState, setPaginationState] = useState<PaginationState>({
            pageIndex: 1,
            pageSize: DEFAULT_PAGE_SIZES[0],
          });

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

          export function IsGreaterOrEqualThan(
            property: string,
            validationOptions?: ValidationOptions,
          ) {
            return (object: Record<string, any>, propertyName: string): void => {
          Severity: Major
          Found in api/src/decorators/comparison.decorator.ts and 1 other location - About 1 day to fix
          api/src/decorators/comparison.decorator.ts on lines 44..79

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

          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 function IsSmallerOrEqualThan(
            property: string,
            validationOptions?: ValidationOptions,
          ) {
            return (object: Record<string, any>, propertyName: string): void => {
          Severity: Major
          Found in api/src/decorators/comparison.decorator.ts and 1 other location - About 1 day to fix
          api/src/decorators/comparison.decorator.ts on lines 7..42

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

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

          const MoreFilters = () => {
            const { query } = useRouter();
            const { scenarioId, compareScenarioId } = query;
          
            const dispatch = useAppDispatch();

            File h3-data.repository.ts has 673 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              Brackets,
              DataSource,
              ObjectLiteral,
              Repository,
            Severity: Major
            Found in api/src/modules/h3-data/h3-data.repository.ts - About 1 day to fix

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

              import Wrapper from 'containers/wrapper';
              import Link from 'next/link';
              
              const PrivacyPolicy: React.FC = () => {
                return (
              Severity: Major
              Found in marketing/src/containers/privacy-policy/component.tsx - About 1 day to fix

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

                            <FadeIn>
                              <h3 className="mb-5 text-4xl font-medium text-white uppercase font-display">
                                Core Team
                              </h3>
                              <ul className="grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3">
                Severity: Major
                Found in marketing/src/containers/about/team/component.tsx and 1 other location - About 1 day to fix
                marketing/src/containers/about/team/component.tsx on lines 78..108

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

                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

                            <FadeIn>
                              <h3 className="mb-5 text-4xl font-medium text-white uppercase font-display">
                                Supporting Roles
                              </h3>
                              <ul className="grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3">
                Severity: Major
                Found in marketing/src/containers/about/team/component.tsx and 1 other location - About 1 day to fix
                marketing/src/containers/about/team/component.tsx on lines 46..76

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

                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