Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

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

export class TargetsRepository extends Repository<Target> {
  constructor(private dataSource: DataSource) {
    super(Target, dataSource.createEntityManager());
  }
}
Severity: Major
Found in api/src/modules/targets/targets.repository.ts and 10 other locations - About 1 hr to fix
api/src/modules/cached-data/cached-data.repository.ts on lines 6..10
api/src/modules/indicator-coefficients/indicator-coefficient.repository.ts on lines 6..10
api/src/modules/indicators/indicator.repository.ts on lines 9..13
api/src/modules/materials/material-indicator-to-h3.service.ts on lines 7..11
api/src/modules/scenarios/scenario.repository.ts on lines 6..10
api/src/modules/sourcing-location-groups/sourcing-location-group.repository.ts on lines 6..10
api/src/modules/tasks/tasks.repository.ts on lines 6..10
api/src/modules/unit-conversions/unit-conversion.repository.ts on lines 6..10
api/src/modules/units/unit.repository.ts on lines 6..10
api/src/modules/url-params/url-param.repository.ts on lines 6..10

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

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

export class TasksRepository extends Repository<Task> {
  constructor(private dataSource: DataSource) {
    super(Task, dataSource.createEntityManager());
  }
}
Severity: Major
Found in api/src/modules/tasks/tasks.repository.ts and 10 other locations - About 1 hr to fix
api/src/modules/cached-data/cached-data.repository.ts on lines 6..10
api/src/modules/indicator-coefficients/indicator-coefficient.repository.ts on lines 6..10
api/src/modules/indicators/indicator.repository.ts on lines 9..13
api/src/modules/materials/material-indicator-to-h3.service.ts on lines 7..11
api/src/modules/scenarios/scenario.repository.ts on lines 6..10
api/src/modules/sourcing-location-groups/sourcing-location-group.repository.ts on lines 6..10
api/src/modules/targets/targets.repository.ts on lines 6..10
api/src/modules/unit-conversions/unit-conversion.repository.ts on lines 6..10
api/src/modules/units/unit.repository.ts on lines 6..10
api/src/modules/url-params/url-param.repository.ts on lines 6..10

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

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

export class MaterialIndicatorToH3Service extends Repository<MaterialIndicatorToH3> {
  constructor(private dataSource: DataSource) {
    super(MaterialIndicatorToH3, dataSource.createEntityManager());
  }
}
api/src/modules/cached-data/cached-data.repository.ts on lines 6..10
api/src/modules/indicator-coefficients/indicator-coefficient.repository.ts on lines 6..10
api/src/modules/indicators/indicator.repository.ts on lines 9..13
api/src/modules/scenarios/scenario.repository.ts on lines 6..10
api/src/modules/sourcing-location-groups/sourcing-location-group.repository.ts on lines 6..10
api/src/modules/targets/targets.repository.ts on lines 6..10
api/src/modules/tasks/tasks.repository.ts on lines 6..10
api/src/modules/unit-conversions/unit-conversion.repository.ts on lines 6..10
api/src/modules/units/unit.repository.ts on lines 6..10
api/src/modules/url-params/url-param.repository.ts on lines 6..10

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

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

export class IndicatorRepository extends Repository<Indicator> {
  constructor(private dataSource: DataSource) {
    super(Indicator, dataSource.createEntityManager());
  }
}
Severity: Major
Found in api/src/modules/indicators/indicator.repository.ts and 10 other locations - About 1 hr to fix
api/src/modules/cached-data/cached-data.repository.ts on lines 6..10
api/src/modules/indicator-coefficients/indicator-coefficient.repository.ts on lines 6..10
api/src/modules/materials/material-indicator-to-h3.service.ts on lines 7..11
api/src/modules/scenarios/scenario.repository.ts on lines 6..10
api/src/modules/sourcing-location-groups/sourcing-location-group.repository.ts on lines 6..10
api/src/modules/targets/targets.repository.ts on lines 6..10
api/src/modules/tasks/tasks.repository.ts on lines 6..10
api/src/modules/unit-conversions/unit-conversion.repository.ts on lines 6..10
api/src/modules/units/unit.repository.ts on lines 6..10
api/src/modules/url-params/url-param.repository.ts on lines 6..10

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

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

export class UnitRepository extends Repository<Unit> {
  constructor(private dataSource: DataSource) {
    super(Unit, dataSource.createEntityManager());
  }
}
Severity: Major
Found in api/src/modules/units/unit.repository.ts and 10 other locations - About 1 hr to fix
api/src/modules/cached-data/cached-data.repository.ts on lines 6..10
api/src/modules/indicator-coefficients/indicator-coefficient.repository.ts on lines 6..10
api/src/modules/indicators/indicator.repository.ts on lines 9..13
api/src/modules/materials/material-indicator-to-h3.service.ts on lines 7..11
api/src/modules/scenarios/scenario.repository.ts on lines 6..10
api/src/modules/sourcing-location-groups/sourcing-location-group.repository.ts on lines 6..10
api/src/modules/targets/targets.repository.ts on lines 6..10
api/src/modules/tasks/tasks.repository.ts on lines 6..10
api/src/modules/unit-conversions/unit-conversion.repository.ts on lines 6..10
api/src/modules/url-params/url-param.repository.ts on lines 6..10

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

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

export class IndicatorCoefficientRepository extends Repository<IndicatorCoefficient> {
  constructor(private dataSource: DataSource) {
    super(IndicatorCoefficient, dataSource.createEntityManager());
  }
}
api/src/modules/cached-data/cached-data.repository.ts on lines 6..10
api/src/modules/indicators/indicator.repository.ts on lines 9..13
api/src/modules/materials/material-indicator-to-h3.service.ts on lines 7..11
api/src/modules/scenarios/scenario.repository.ts on lines 6..10
api/src/modules/sourcing-location-groups/sourcing-location-group.repository.ts on lines 6..10
api/src/modules/targets/targets.repository.ts on lines 6..10
api/src/modules/tasks/tasks.repository.ts on lines 6..10
api/src/modules/unit-conversions/unit-conversion.repository.ts on lines 6..10
api/src/modules/units/unit.repository.ts on lines 6..10
api/src/modules/url-params/url-param.repository.ts on lines 6..10

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

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

export class ScenarioRepository extends Repository<Scenario> {
  constructor(private dataSource: DataSource) {
    super(Scenario, dataSource.createEntityManager());
  }
}
Severity: Major
Found in api/src/modules/scenarios/scenario.repository.ts and 10 other locations - About 1 hr to fix
api/src/modules/cached-data/cached-data.repository.ts on lines 6..10
api/src/modules/indicator-coefficients/indicator-coefficient.repository.ts on lines 6..10
api/src/modules/indicators/indicator.repository.ts on lines 9..13
api/src/modules/materials/material-indicator-to-h3.service.ts on lines 7..11
api/src/modules/sourcing-location-groups/sourcing-location-group.repository.ts on lines 6..10
api/src/modules/targets/targets.repository.ts on lines 6..10
api/src/modules/tasks/tasks.repository.ts on lines 6..10
api/src/modules/unit-conversions/unit-conversion.repository.ts on lines 6..10
api/src/modules/units/unit.repository.ts on lines 6..10
api/src/modules/url-params/url-param.repository.ts on lines 6..10

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

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

    <header className="px-10 py-7 lg:p-10 flex justify-center items-start xl:justify-start lg:w-1/5">
      <Link href="/">
        <a>
          <Logo />
        </a>
Severity: Major
Found in landing/pages/index.tsx and 1 other location - About 1 hr to fix
landing/layout/static-page.tsx on lines 16..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 56.

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

    <header className="px-10 py-7 lg:p-10 flex justify-center items-start xl:justify-start lg:w-1/5">
      <Link href="/">
        <a>
          <Logo />
        </a>
Severity: Major
Found in landing/layout/static-page.tsx and 1 other location - About 1 hr to fix
landing/pages/index.tsx on lines 17..23

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

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 isClusterPoint(p: Point): p is ClusterPoint {
  const { id } = p as ClusterPoint;
  return id != null;
}
Severity: Major
Found in cookie-traceability/src/lib/flowmap/data/cluster/cluster.ts and 1 other location - About 1 hr to fix
cookie-traceability/src/lib/flowmap/data/cluster/cluster.ts on lines 83..86

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

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

      {
        materialIds: baseImpactMap.materialIds,
        originIds: baseImpactMap.originIds,
        t1SupplierIds: baseImpactMap.t1SupplierIds,
        producerIds: baseImpactMap.producerIds,
Severity: Major
Found in api/src/modules/h3-data/h3-data.repository.ts and 1 other location - About 1 hr to fix
api/src/modules/scenario-interventions/scenario-interventions.service.ts on lines 366..373

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

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

  ({
    layer,
    startYear,
    endYear,
    by,
Severity: Major
Found in client/src/store/features/analysis/selector.ts and 1 other location - About 1 hr to fix
api/src/modules/eudr-alerts/dashboard/eudr-dashboard.service.ts on lines 136..148

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

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 isLeafPoint(p: Point): p is LeafPoint {
  const { index } = p as LeafPoint;
  return index != null;
}
Severity: Major
Found in cookie-traceability/src/lib/flowmap/data/cluster/cluster.ts and 1 other location - About 1 hr to fix
cookie-traceability/src/lib/flowmap/data/cluster/cluster.ts on lines 88..91

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

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

      slider.current.moveTo(slide).catch((err) => {
        if (
          !(
            err instanceof FlickingError &&
            (err.code === ERROR_CODE.ANIMATION_ALREADY_PLAYING ||
Severity: Major
Found in marketing/src/components/carousel/component.tsx and 1 other location - About 1 hr to fix
marketing/src/components/carousel/component.tsx on lines 38..48

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

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

          slider.current.next().catch((err) => {
            if (
              !(
                err instanceof FlickingError &&
                (err.code === ERROR_CODE.ANIMATION_ALREADY_PLAYING ||
Severity: Major
Found in marketing/src/components/carousel/component.tsx and 1 other location - About 1 hr to fix
marketing/src/components/carousel/component.tsx on lines 60..70

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

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

      return this.geoCodingService.geoCodeSourcingLocation({
        locationAdminRegionInput: dto.newLocationAdminRegionInput,
        locationLongitude: dto.newLocationLongitude,
        locationLatitude: dto.newLocationLatitude,
        locationAddressInput: dto.newLocationAddressInput,
api/src/modules/h3-data/h3-data.repository.ts on lines 523..530

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

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 {
        supplierId,
        materialId,
        adminRegionId,
        totalSourcingLocations,
client/src/store/features/analysis/selector.ts on lines 10..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 56.

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

  const handleDownloadData = useCallback(async () => {
    let csv = null;
    // actual vs scenario
    if (!currentScenario && scenarioToCompare) {
      csv = await downloadActualVsScenarioData.mutateAsync({

    Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render(): JSX.Element {
        return (
          <Html className="h-full bg-gray-100">
            <Head>
              <meta
    Severity: Minor
    Found in client/src/pages/_document.tsx - About 1 hr to fix

      Function Page404 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Page404: React.FC = () => {
        const handleGoBack = useCallback(() => Router.back(), []);
      
        return (
          <div className="flex h-screen place-items-center justify-center">
      Severity: Minor
      Found in client/src/pages/404.tsx - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language