Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

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

        <header className="relative">
          <div className="relative z-10 space-y-5 md:space-y-12">
            <h2 className="text-xl font-black uppercase font-display">Calculate</h2>
            <h3 className="text-4xl font-black uppercase md:text-6xl font-display">
              YOUR ENVIRONMENTAL IMPACTS.
Severity: Major
Found in marketing/src/containers/the-service/steps/03/component.tsx and 3 other locations - About 2 hrs to fix
marketing/src/containers/the-service/steps/01/component.tsx on lines 11..19
marketing/src/containers/the-service/steps/02/component.tsx on lines 18..28
marketing/src/containers/the-service/steps/04/component.tsx on lines 12..22

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

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 4 locations. Consider refactoring.
Open

        <header className="relative">
          <div className="relative z-10 space-y-5 md:space-y-12">
            <h2 className="text-xl font-black uppercase font-display">Map</h2>
            <h3 className="text-4xl font-black uppercase md:text-6xl font-display">
              Your supply chain.
Severity: Major
Found in marketing/src/containers/the-service/steps/02/component.tsx and 3 other locations - About 2 hrs to fix
marketing/src/containers/the-service/steps/01/component.tsx on lines 11..19
marketing/src/containers/the-service/steps/03/component.tsx on lines 13..23
marketing/src/containers/the-service/steps/04/component.tsx on lines 12..22

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

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 4 locations. Consider refactoring.
Open

const omitFieldsQueryParam: <T>(
  target: Record<string, any>,
  propertyKey: string | symbol,
  descriptor: TypedPropertyDescriptor<T>,
) => TypedPropertyDescriptor<T> | void = ApiQuery({
Severity: Major
Found in api/src/decorators/json-api-parameters.decorator.ts and 3 other locations - About 2 hrs to fix
api/src/decorators/json-api-parameters.decorator.ts on lines 41..51
api/src/decorators/json-api-parameters.decorator.ts on lines 63..73
api/src/decorators/json-api-parameters.decorator.ts on lines 84..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 89.

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 4 locations. Consider refactoring.
Open

const sortQueryParam: <T>(
  target: Record<string, any>,
  propertyKey: string | symbol,
  descriptor: TypedPropertyDescriptor<T>,
) => TypedPropertyDescriptor<T> | void = ApiQuery({
Severity: Major
Found in api/src/decorators/json-api-parameters.decorator.ts and 3 other locations - About 2 hrs to fix
api/src/decorators/json-api-parameters.decorator.ts on lines 41..51
api/src/decorators/json-api-parameters.decorator.ts on lines 52..62
api/src/decorators/json-api-parameters.decorator.ts on lines 84..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 89.

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 4 locations. Consider refactoring.
Open

        <header className="relative">
          <div className="relative z-10 space-y-5 md:space-y-12">
            <h2 className="text-xl font-black uppercase font-display">Import</h2>
            <h3 className="text-4xl font-black uppercase md:text-6xl font-display">Your data.</h3>
          </div>
Severity: Major
Found in marketing/src/containers/the-service/steps/01/component.tsx and 3 other locations - About 2 hrs to fix
marketing/src/containers/the-service/steps/02/component.tsx on lines 18..28
marketing/src/containers/the-service/steps/03/component.tsx on lines 13..23
marketing/src/containers/the-service/steps/04/component.tsx on lines 12..22

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

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 4 locations. Consider refactoring.
Open

const pageNumberQueryParam: <T>(
  target: Record<string, any>,
  propertyKey: string | symbol,
  descriptor: TypedPropertyDescriptor<T>,
) => TypedPropertyDescriptor<T> | void = ApiQuery({
Severity: Major
Found in api/src/decorators/json-api-parameters.decorator.ts and 3 other locations - About 2 hrs to fix
api/src/decorators/json-api-parameters.decorator.ts on lines 41..51
api/src/decorators/json-api-parameters.decorator.ts on lines 52..62
api/src/decorators/json-api-parameters.decorator.ts on lines 63..73

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

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 4 locations. Consider refactoring.
Open

const fieldsQueryParam: <T>(
  target: Record<string, any>,
  propertyKey: string | symbol,
  descriptor: TypedPropertyDescriptor<T>,
) => TypedPropertyDescriptor<T> | void = ApiQuery({
Severity: Major
Found in api/src/decorators/json-api-parameters.decorator.ts and 3 other locations - About 2 hrs to fix
api/src/decorators/json-api-parameters.decorator.ts on lines 52..62
api/src/decorators/json-api-parameters.decorator.ts on lines 63..73
api/src/decorators/json-api-parameters.decorator.ts on lines 84..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 89.

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

  it('a user types a name with more than 40 characters', () => {
    cy.url().should('contain', '/data/scenarios/new');
    cy.get('[data-testid="scenario-name-input"]').type(
      'this is a very looong name for an scenario',
    );
Severity: Major
Found in client/cypress/e2e/scenario-creation.cy.ts and 1 other location - About 2 hrs to fix
client/cypress/e2e/scenario-creation.cy.ts on lines 44..49

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

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

                <ul className="space-y-5 font-light">
                  <li className="relative pl-5 before:absolute before:top-2 before:left-0 before:w-1.5 before:h-1.5 before:bg-white">
                    Sector wide net zero GHG emissions.
                  </li>
                  <li className="relative pl-5 before:absolute before:top-2 before:left-0 before:w-1.5 before:h-1.5 before:bg-white">
Severity: Major
Found in marketing/src/containers/about/reason/component.tsx and 2 other locations - About 2 hrs to fix
marketing/src/containers/privacy-policy/component.tsx on lines 346..351
marketing/src/containers/privacy-policy/component.tsx on lines 552..573

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

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

    if (this.dto?.startAlertDate && this.dto?.endAlertDate) {
      this.addAlertDateRange();
    } else if (this.dto?.startAlertDate) {
      this.addAlertDateGreaterThanOrEqual();
    } else if (this.dto?.endAlertDate) {
api/src/modules/eudr-alerts/alerts-query-builder/big-query-alerts-query.builder.ts on lines 97..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 89.

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 sendPasswordRecoveryEmail(email: string, token: string): Promise<void> {
    const htmlContent: string = `
    <h1>Dear User,</h1>
    <br/>
    <p>We recently received a request to reset your password for your Landgriffon account. If you made this request, please click on the link below to securely change your password:</p>
Severity: Major
Found in api/src/modules/authentication/password-mail.service.ts and 1 other location - About 2 hrs to fix
api/src/modules/authentication/password-mail.service.ts on lines 14..35

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

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

  it('a user types a name with a single character', () => {
    cy.url().should('contain', '/data/scenarios/new');
    cy.get('[data-testid="scenario-name-input"]').type('?');
    cy.get('[data-testid="create-scenario-button"]').should('be.disabled');
    cy.contains('Name must be at least 2 characters.').should('exist');
Severity: Major
Found in client/cypress/e2e/scenario-creation.cy.ts and 1 other location - About 2 hrs to fix
client/cypress/e2e/scenario-creation.cy.ts on lines 51..58

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

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

            <ul className="list-disc pb-2">
              <li className="pb-3">
                engaging in illegal activities, illegal or contrary to good faith and public order;
              </li>
              <li className="pb-3">
Severity: Major
Found in marketing/src/containers/privacy-policy/component.tsx and 2 other locations - About 2 hrs to fix
marketing/src/containers/about/reason/component.tsx on lines 39..52
marketing/src/containers/privacy-policy/component.tsx on lines 346..351

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

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 sendUserActivationEmail(email: string, token: string): Promise<void> {
    const htmlContent: string = `
    <h1>Welcome to Landgriffon!</h1>
    <p>An account has been created for you by an administrator. As this is your first time logging in, we request you create a new password for your account.</p>
    <br/>
Severity: Major
Found in api/src/modules/authentication/password-mail.service.ts and 1 other location - About 2 hrs to fix
api/src/modules/authentication/password-mail.service.ts on lines 37..56

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

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

    if (this.dto?.startYear && this.dto?.endYear) {
      this.addYearRange();
    } else if (this.dto?.startYear) {
      this.addYearGreaterThanOrEqual();
    } else if (this.dto?.endYear) {
api/src/modules/eudr-alerts/alerts-query-builder/big-query-alerts-query.builder.ts on lines 105..111

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

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

            <ul className="list-disc pb-2">
              <li className="pb-3">Name of cookies: ga, _gat</li>
              <li className="pb-3">Issuer’s website: google.com</li>
              <li className="pb-3">Cookie Type: Analysis Cookie</li>
              <li className="pb-3">Description: Web traffic analysis</li>
Severity: Major
Found in marketing/src/containers/privacy-policy/component.tsx and 2 other locations - About 2 hrs to fix
marketing/src/containers/about/reason/component.tsx on lines 39..52
marketing/src/containers/privacy-policy/component.tsx on lines 552..573

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

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

const EditInterventionPage: React.FC = () => {
  const router = useRouter();
  const { query } = router;
  const { data, isLoading } = useIntervention({
    interventionId: query?.interventionId as string,

    Function getEntityTree has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async getEntityTree(
        impactTableDto: AnyImpactTableDto,
      ): Promise<ImpactTableEntityType[]> {
        const treeOptions: CommonFiltersDto = {
          ...(impactTableDto.materialIds && {
    Severity: Major
    Found in api/src/modules/impact/base-impact.service.ts - About 2 hrs to fix

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

        @ApiOperation({ description: 'Delete a scenario intervention' })
        @ApiOkResponse()
        @ApiNotFoundResponse({ description: 'Scenario intervention not found' })
        @Delete(':id')
        async delete(@Param('id') id: string): Promise<void> {
      api/src/modules/sourcing-location-groups/sourcing-location-groups.controller.ts on lines 123..129
      api/src/modules/sourcing-records/sourcing-records.controller.ts on lines 147..153
      api/src/modules/suppliers/suppliers.controller.ts on lines 155..161
      api/src/modules/unit-conversions/unit-conversions.controller.ts on lines 110..116
      api/src/modules/units/units.controller.ts on lines 108..114
      api/src/modules/url-params/url-params.controller.ts on lines 46..52

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

      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 7 locations. Consider refactoring.
      Open

        @ApiOperation({ description: 'Deletes a sourcing location group' })
        @ApiOkResponse()
        @ApiNotFoundResponse({ description: 'Sourcing location group not found' })
        @Delete(':id')
        async delete(@Param('id') id: string): Promise<void> {
      api/src/modules/scenario-interventions/scenario-interventions.controller.ts on lines 124..130
      api/src/modules/sourcing-records/sourcing-records.controller.ts on lines 147..153
      api/src/modules/suppliers/suppliers.controller.ts on lines 155..161
      api/src/modules/unit-conversions/unit-conversions.controller.ts on lines 110..116
      api/src/modules/units/units.controller.ts on lines 108..114
      api/src/modules/url-params/url-params.controller.ts on lines 46..52

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

      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