Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

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

  const handleZoomIn = useCallback(() => {
    const zoom = viewState.maxZoom === viewState.zoom ? viewState.zoom : viewState.zoom + 1;
    setViewState({ ...viewState, zoom });
  }, [viewState]);
Severity: Major
Found in client/src/containers/analysis-eudr/map/component.tsx and 3 other locations - About 1 hr to fix
client/src/containers/analysis-eudr/map/compare.tsx on lines 225..228
client/src/containers/analysis-eudr/map/compare.tsx on lines 230..233
client/src/containers/analysis-eudr/map/component.tsx on lines 225..228

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

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 handleZoomIn = useCallback(() => {
    const zoom = viewState.maxZoom === viewState.zoom ? viewState.zoom : viewState.zoom + 1;
    setViewState({ ...viewState, zoom });
  }, [viewState]);
Severity: Major
Found in client/src/containers/analysis-eudr/map/compare.tsx and 3 other locations - About 1 hr to fix
client/src/containers/analysis-eudr/map/compare.tsx on lines 230..233
client/src/containers/analysis-eudr/map/component.tsx on lines 220..223
client/src/containers/analysis-eudr/map/component.tsx on lines 225..228

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

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

  @ApiProperty({ type: [Role] })
  @ManyToMany(() => Role, (role: Role) => role.user, { eager: true })
  @JoinTable({ name: 'user_roles' })
  roles: Role[];
Severity: Major
Found in api/src/modules/users/user.entity.ts and 1 other location - About 1 hr to fix
api/src/modules/authorization/roles/role.entity.ts on lines 30..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 72.

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 origin: {
        originName: string;
        suppliers: Set<any>;
        zeroGeoRegionSuppliers: number;
        dfsSuppliers: number;
api/src/modules/eudr-alerts/dashboard/eudr-dashboard-breakdown.builder.ts on lines 104..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 72.

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 handleZoomOut = useCallback(() => {
    const zoom = viewState.maxZoom === viewState.zoom ? viewState.zoom : viewState.zoom - 1;
    setViewState({ ...viewState, zoom });
  }, [viewState]);
Severity: Major
Found in client/src/containers/analysis-eudr/map/component.tsx and 3 other locations - About 1 hr to fix
client/src/containers/analysis-eudr/map/compare.tsx on lines 225..228
client/src/containers/analysis-eudr/map/compare.tsx on lines 230..233
client/src/containers/analysis-eudr/map/component.tsx on lines 220..223

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

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 handleZoomOut = useCallback(() => {
    const zoom = viewState.maxZoom === viewState.zoom ? viewState.zoom : viewState.zoom - 1;
    setViewState({ ...viewState, zoom });
  }, [viewState]);
Severity: Major
Found in client/src/containers/analysis-eudr/map/compare.tsx and 3 other locations - About 1 hr to fix
client/src/containers/analysis-eudr/map/compare.tsx on lines 225..228
client/src/containers/analysis-eudr/map/component.tsx on lines 220..223
client/src/containers/analysis-eudr/map/component.tsx on lines 225..228

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

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 material: {
        materialName: string;
        suppliers: Set<any>;
        zeroGeoRegionSuppliers: number;
        dfsSuppliers: number;
api/src/modules/eudr-alerts/dashboard/eudr-dashboard-breakdown.builder.ts on lines 112..119

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

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

  @ApiProperty({ type: [Permission] })
  @ManyToMany(() => Permission, (permission: Permission) => permission.roles, {
    eager: true,
  })
  @JoinTable({ name: 'roles_permissions' })
Severity: Major
Found in api/src/modules/authorization/roles/role.entity.ts and 1 other location - About 1 hr to fix
api/src/modules/users/user.entity.ts on lines 119..122

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

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

const RADDSlider = () => {
  const dispatch = useAppDispatch();
  const [values, setValues] = useState<number[]>([0, 0]);
  const data = layersData.find((layer) => layer.id === LAYERD_ID);
  const dates = data?.legend?.dates;
Severity: Minor
Found in client/src/containers/analysis-eudr/map/legend/radd-slider.tsx - About 1 hr to fix

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

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

      Function groupAndFillAlertsByMonth has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const groupAndFillAlertsByMonth = (
        alerts: AlertsOutput[],
        geoRegionMap: Map<string, any>,
        startDate: Date,
        endDate: Date,
      Severity: Minor
      Found in api/src/modules/eudr-alerts/dashboard/dashboard-utils.ts - About 1 hr to fix

        Function ImpactBeyondCompliance has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const ImpactBeyondCompliance: React.FC = () => {
          return (
            <section className="relative space-y-12 bg-blue-600 md:space-y-64">
              <Wrapper>
                <div className="space-y-10 text-white md:space-y-20 md:py-32 py-12">

          Function createUser has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async createUser(dto: CreateUserDTO): Promise<Partial<User>> {
              const user: User = new User();
              user.fname = dto.fname ?? DEFAULT_USER_NAME;
              user.lname = dto.lname;
              user.title = dto.title;
          Severity: Minor
          Found in api/src/modules/authentication/authentication.service.ts - About 1 hr to fix

            Function addEntityFiltersToQuery has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              private addEntityFiltersToQuery(
                selectQueryBuilder: SelectQueryBuilder<SourcingRecord>,
                impactDataDto: GetActualVsScenarioImpactTableDto | GetImpactTableDto,
              ): SelectQueryBuilder<SourcingRecord> {
                if (impactDataDto.materialIds) {
            Severity: Minor
            Found in api/src/modules/impact/impact.repository.ts - About 1 hr to fix

              Function geoCodeAdministrativeRegionOfProduction has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async geoCodeAdministrativeRegionOfProduction(
                  sourcingData: SourcingData,
                ): Promise<SourcingData> {
                  // TODO: Since this has become required for all location types, we should validate this at DTO level
                  if (!sourcingData.locationCountryInput) {

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

                            <ul className="list-disc pt-3 pb-2">
                              <li className="pb-3">
                                By sending an e-mail to hello@landgriffon.com, indicating the right you wish to
                                exercise and your personal details.
                              </li>
                Severity: Major
                Found in marketing/src/containers/privacy-policy/component.tsx and 2 other locations - About 1 hr to fix
                client/src/containers/targets/input-list/component.tsx on lines 13..17
                marketing/src/containers/privacy-policy/component.tsx on lines 58..80

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

                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="flex flex-row pb-2 text-sm font-semibold uppercase text-gray-500">
                      <span className="mr-2.5 basis-1/6">Year</span>
                      <span className="mr-2.5 basis-1/4">Percentage</span>
                      <span className="mr-2.5 basis-1/2">Value</span>
                    </div>
                Severity: Major
                Found in client/src/containers/targets/input-list/component.tsx and 2 other locations - About 1 hr to fix
                marketing/src/containers/privacy-policy/component.tsx on lines 58..80
                marketing/src/containers/privacy-policy/component.tsx on lines 240..254

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

                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

                              <div className="mt-5 md:mt-40">
                                <Link href="/about">
                                  <a className="flex items-center space-x-5 font-semibold text-orange-500">
                                    <span>Know more about us</span>
                                    <Icon icon={ARROW_RIGHT_SVG} className="w-12 h-12 fill-orange-500" />
                Severity: Major
                Found in marketing/src/containers/testimonials/component.tsx and 1 other location - About 1 hr to fix
                marketing/src/containers/about/how/component.tsx on lines 27..34

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

                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.materialSuppliersMap.has(materialId)) {
                        this.materialSuppliersMap.set(materialId, {
                          materialName,
                          suppliers: new Set(),
                          zeroGeoRegionSuppliers: 0,
                api/src/modules/eudr-alerts/dashboard/eudr-dashboard-breakdown.builder.ts on lines 94..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 71.

                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

                      select: (_materials) =>
                        recursiveSort(_materials, 'name')?.map((item) =>
                          recursiveMap(item, ({ id, name, status }) => ({
                            value: id,
                            label: name,
                Severity: Major
                Found in client/src/containers/materials/select/component.tsx and 1 other location - About 1 hr to fix
                client/src/containers/analysis-visualization/analysis-filters/more-filters/component.tsx on lines 168..175

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

                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