Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

Function _getFlowLayerPickingInfo has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private async _getFlowLayerPickingInfo(
    info: Record<string, any>,
  ): Promise<FlowLayerPickingInfo<L, F> | undefined> {
    const { index, sourceLayer } = info;
    const { dataProvider, accessors } = this.state || {};
Severity: Major
Found in cookie-traceability/src/lib/flowmap/layers/FlowMapLayer.ts - About 2 hrs to fix

    Function chartData has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const chartData = useMemo(() => {
        const {
          indicatorShortName,
          rows,
          yearSum,
    Severity: Minor
    Found in client/src/containers/analysis-chart/impact-chart/component.tsx - About 2 hrs to fix

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

      export class ImpactTable {
        @ApiProperty({ type: () => ImpactTableDataByIndicator, isArray: true })
        impactTable: ImpactTableDataByIndicator[];
        @ApiProperty({ type: () => ImpactTablePurchasedTonnes, isArray: true })
        purchasedTonnes: ImpactTablePurchasedTonnes[];
      Severity: Major
      Found in api/src/modules/impact/dto/response-impact-table.dto.ts and 2 other locations - About 2 hrs to fix
      api/src/modules/impact/dto/response-actual-scenario.dto.ts on lines 10..21
      api/src/modules/impact/dto/response-scenario-scenario.dto.ts on lines 10..21

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

      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 ActualVsScenarioImpactTable {
        @ApiProperty({
          type: () => ActualVsScenarioImpactTableDataByIndicator,
          isArray: true,
        })
      Severity: Major
      Found in api/src/modules/impact/dto/response-actual-scenario.dto.ts and 2 other locations - About 2 hrs to fix
      api/src/modules/impact/dto/response-impact-table.dto.ts on lines 13..18
      api/src/modules/impact/dto/response-scenario-scenario.dto.ts on lines 10..21

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

      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

                  <div className="col-span-2">
                    <Label htmlFor="password">Password</Label>
                    <Input
                      {...register('password')}
                      type="password"
      Severity: Major
      Found in client/src/pages/auth/signup.tsx and 2 other locations - About 2 hrs to fix
      client/src/pages/auth/signup.tsx on lines 127..135
      client/src/pages/auth/signup.tsx on lines 147..155

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

      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

                  <div className="col-span-2">
                    <Label htmlFor="passwordConfirmation">Confirm password</Label>
                    <Input
                      {...register('passwordConfirmation')}
                      type="password"
      Severity: Major
      Found in client/src/pages/auth/signup.tsx and 2 other locations - About 2 hrs to fix
      client/src/pages/auth/signup.tsx on lines 127..135
      client/src/pages/auth/signup.tsx on lines 137..145

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

      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

        async createTree(importData: CreateSupplierDto[]): Promise<Supplier[]> {
          this.logger.log(`Creating Supplier tree with ${importData.length} nodes`);
          return this.supplierRepository.saveListToTree(importData, 'mpath');
        }
      Severity: Major
      Found in api/src/modules/suppliers/suppliers.service.ts and 1 other location - About 2 hrs to fix
      api/src/modules/business-units/business-units.service.ts on lines 60..65

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

      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

                  <div className="col-span-2">
                    <Label htmlFor="email">Email address</Label>
                    <Input
                      {...register('email')}
                      type="email"
      Severity: Major
      Found in client/src/pages/auth/signup.tsx and 2 other locations - About 2 hrs to fix
      client/src/pages/auth/signup.tsx on lines 137..145
      client/src/pages/auth/signup.tsx on lines 147..155

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

      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

        async createTree(
          importData: CreateBusinessUnitDto[],
        ): Promise<BusinessUnit[]> {
          this.logger.log(`Creating Business tree with ${importData.length} nodes`);
          return this.businessUnitRepository.saveListToTree(importData, 'mpath');
      Severity: Major
      Found in api/src/modules/business-units/business-units.service.ts and 1 other location - About 2 hrs to fix
      api/src/modules/suppliers/suppliers.service.ts on lines 128..131

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

      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 ScenarioVsScenarioImpactTable {
        @ApiProperty({
          type: () => ScenarioVsScenarioImpactTableDataByIndicator,
          isArray: true,
        })
      api/src/modules/impact/dto/response-actual-scenario.dto.ts on lines 10..21
      api/src/modules/impact/dto/response-impact-table.dto.ts on lines 13..18

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

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

          <Mode extends ComparisonMode>(year: number): ColumnDefinition<ImpactRowType<Mode>> => {
            const valueIsComparison = (
              value: ImpactTableValueItem<ComparisonMode>,
            ): value is ImpactTableValueItem<true> => {
              return !isScenarioComparison && isComparison;

        Function buildActualVsScenarioImpactTable has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private buildActualVsScenarioImpactTable(
            queryDto: GetActualVsScenarioImpactTableDto,
            indicators: Indicator[],
            dataForImpactTable: ActualVsScenarioImpactTableData[],
            entityTree: ImpactTableEntityType[],
        Severity: Minor
        Found in api/src/modules/impact/comparison/actual-vs-scenario.service.ts - About 1 hr to fix

          Function buildImpactTable has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            private buildImpactTable(
              queryDto: GetScenarioVsScenarioImpactTableDto,
              indicators: Indicator[],
              dataForImpactTable: ScenarioVsScenarioImpactTableData[],
              entityTree: ImpactTableEntityType[],
          Severity: Minor
          Found in api/src/modules/impact/comparison/scenario-vs-scenario.service.ts - About 1 hr to fix

            Function Step01 has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Step01: React.FC = () => {
              return (
                <article
                  className={cx({
                    'flex flex-col lg:flex-row justify-between space-y-10 lg:space-x-10 lg:space-y-0': true,
            Severity: Minor
            Found in marketing/src/containers/the-service/steps/01/component.tsx - About 1 hr to fix

              Function Hero has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function Hero() {
                return (
                  <div
                    className={cx({
                      'relative px-4 pt-20 xl:pt-24 xl:pb-40 2xl:pt-32 2xl:pb-60': true,
              Severity: Minor
              Found in cookie-traceability/src/components/hero/component.tsx - About 1 hr to fix

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

                            <div>
                              <Label htmlFor="password">Password</Label>
                              <Input
                                {...register('password')}
                                type="password"
                Severity: Major
                Found in client/src/pages/auth/signin.tsx and 2 other locations - About 1 hr to fix
                client/src/pages/auth/forgot-password.tsx on lines 99..107
                client/src/pages/auth/signin.tsx on lines 95..103

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

                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

                              <div className="col-span-2">
                                <Label htmlFor="passwordConfirmation">Confirm password</Label>
                                <Input
                                  {...registerPassword('passwordConfirmation')}
                                  type="password"
                Severity: Major
                Found in client/src/containers/update-password-form/component.tsx and 2 other locations - About 1 hr to fix
                client/src/containers/update-password-form/component.tsx on lines 66..73
                client/src/containers/update-password-form/component.tsx on lines 74..81

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

                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 MaterialsFilter = React.forwardRef(InnerMaterialsFilter) as <IsMulti extends boolean>(
                  props: MaterialsFilterProps<IsMulti> & { ref?: Ref<ComponentRef<typeof TreeSelect>> },
                ) => React.ReactElement;
                Severity: Major
                Found in client/src/containers/materials/select/component.tsx and 1 other location - About 1 hr to fix
                client/src/containers/locations/select/component.tsx on lines 104..106

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

                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

                              <div className="col-span-2">
                                <Label htmlFor="password">New password</Label>
                                <Input
                                  {...registerPassword('newPassword')}
                                  type="password"
                Severity: Major
                Found in client/src/containers/update-password-form/component.tsx and 2 other locations - About 1 hr to fix
                client/src/containers/update-password-form/component.tsx on lines 66..73
                client/src/containers/update-password-form/component.tsx on lines 83..90

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

                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>
                                <div className="space-y-8">
                                  <p className="text-white inline-block text-2xl font-light leading-tight">
                                    <span className="text-black bg-blue-500">
                                      Our service is built on the foundations of trust and transparency, 
                marketing/src/containers/about/values/component.tsx on lines 9..19

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

                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