Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

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

                    <li>
                      <div
                        className={cx({
                          'flex items-center justify-center p-5 rounded-full w-52 h-52': true,
                          'transition-colors': true,
Severity: Major
Found in marketing/src/containers/home/how/component.tsx and 3 other locations - About 1 day to fix
marketing/src/containers/home/how/component.tsx on lines 76..104
marketing/src/containers/home/how/component.tsx on lines 105..133
marketing/src/containers/home/how/component.tsx on lines 134..162

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

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 const getServerSideProps: GetServerSideProps = async ({ req, res, query }) => {
  try {
    const tasks = await tasksSSR({ req, res });
    if (tasks && tasks[0]?.attributes.status === 'processing') {
      return {
Severity: Major
Found in client/src/pages/eudr/suppliers/[supplierId].tsx and 1 other location - About 1 day to fix
client/src/pages/eudr/index.tsx on lines 81..109

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

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 const getServerSideProps: GetServerSideProps = async ({ req, res, query }) => {
  try {
    const tasks = await tasksSSR({ req, res });
    if (tasks && tasks[0]?.attributes.status === 'processing') {
      return {
Severity: Major
Found in client/src/pages/eudr/index.tsx and 1 other location - About 1 day to fix
client/src/pages/eudr/suppliers/[supplierId].tsx on lines 114..141

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

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

  {
    id: '4',
    content: (
      <div className="w-full">
        <div className="space-y-5">
marketing/src/containers/methodology/data-providers/component.tsx on lines 107..150

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

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

  {
    id: '3',
    content: (
      <div className="w-full">
        <div className="space-y-5">
marketing/src/containers/methodology/data-providers/component.tsx on lines 151..186

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

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

const Contact: React.FC = () => {
  const [submitting, setSubmitting] = useState(false);
  const [success, setSuccess] = useState(false);

  const { query } = useRouter();
Severity: Major
Found in marketing/src/containers/contact/component.tsx - About 1 day to fix

    Function EUDRCompareMap has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
    Open

    const EUDRCompareMap = () => {
      const maps = useMap();
    
      const {
        planetLayer,
    Severity: Minor
    Found in client/src/containers/analysis-eudr/map/compare.tsx - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function EUDRMap has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
    Open

    const EUDRMap: React.FC<{ supplierId?: string }> = ({ supplierId }) => {
      const {
        planetLayer,
        supplierLayer,
        contextualLayers,
    Severity: Minor
    Found in client/src/containers/analysis-eudr/map/component.tsx - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    const FadeIn: React.FC<FadeInProps> = ({ children, className, options }: FadeInProps) => {
      const { ref, inView } = useInView(options);
    
      const variants = useMemo(() => {
        return {
    Severity: Major
    Found in marketing/src/components/fade/component.tsx and 1 other location - About 1 day to fix
    marketing/src/components/scale/component.tsx on lines 11..50

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

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

    export const getServerSideProps: GetServerSideProps = async ({ req, res, query }) => {
      try {
        const tasks = await tasksSSR({ req, res });
        if (tasks && tasks[0]?.attributes.status === 'processing') {
          return {
    Severity: Major
    Found in client/src/pages/analysis/table.tsx and 4 other locations - About 1 day to fix
    client/src/pages/analysis/chart.tsx on lines 78..105
    client/src/pages/analysis/map.tsx on lines 44..72
    client/src/pages/data/scenarios/index.tsx on lines 262..289
    client/src/pages/data/targets.tsx on lines 101..128

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

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

    export const getServerSideProps: GetServerSideProps = async ({ req, res, query }) => {
      try {
        const tasks = await tasksSSR({ req, res });
        if (tasks && tasks[0]?.attributes.status === 'processing') {
          return {
    Severity: Major
    Found in client/src/pages/analysis/chart.tsx and 4 other locations - About 1 day to fix
    client/src/pages/analysis/map.tsx on lines 44..72
    client/src/pages/analysis/table.tsx on lines 40..68
    client/src/pages/data/scenarios/index.tsx on lines 262..289
    client/src/pages/data/targets.tsx on lines 101..128

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

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

    export const getServerSideProps: GetServerSideProps = async ({ req, res, query }) => {
      try {
        const tasks = await tasksSSR({ req, res });
        if (tasks && tasks[0]?.attributes.status === 'processing') {
          return {
    Severity: Major
    Found in client/src/pages/analysis/map.tsx and 4 other locations - About 1 day to fix
    client/src/pages/analysis/chart.tsx on lines 78..105
    client/src/pages/analysis/table.tsx on lines 40..68
    client/src/pages/data/scenarios/index.tsx on lines 262..289
    client/src/pages/data/targets.tsx on lines 101..128

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

    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 ScaleIn: React.FC<ScaleInProps> = ({ children, className, options }: ScaleInProps) => {
      const { ref, inView } = useInView(options);
    
      const variants = useMemo(() => {
        return {
    Severity: Major
    Found in marketing/src/components/scale/component.tsx and 1 other location - About 1 day to fix
    marketing/src/components/fade/component.tsx on lines 11..50

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

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

    export const getServerSideProps: GetServerSideProps = async ({ req, res, query }) => {
      try {
        const tasks = await tasksSSR({ req, res });
        if (tasks && tasks[0]?.attributes.status === 'processing') {
          return {
    Severity: Major
    Found in client/src/pages/data/targets.tsx and 4 other locations - About 1 day to fix
    client/src/pages/analysis/chart.tsx on lines 78..105
    client/src/pages/analysis/map.tsx on lines 44..72
    client/src/pages/analysis/table.tsx on lines 40..68
    client/src/pages/data/scenarios/index.tsx on lines 262..289

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

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

    export const getServerSideProps: GetServerSideProps = async ({ req, res, query }) => {
      try {
        const tasks = await tasksSSR({ req, res });
        if (tasks && tasks[0]?.attributes.status === 'processing') {
          return {
    Severity: Major
    Found in client/src/pages/data/scenarios/index.tsx and 4 other locations - About 1 day to fix
    client/src/pages/analysis/chart.tsx on lines 78..105
    client/src/pages/analysis/map.tsx on lines 44..72
    client/src/pages/analysis/table.tsx on lines 40..68
    client/src/pages/data/targets.tsx on lines 101..128

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

    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="space-y-2">
                          <div className="flex items-top space-x-2.5">
                            <input
                              id="accept-terms"
                              type="checkbox"
    marketing/src/containers/contact/component.tsx on lines 260..293

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

    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="lg:col-span-2">
                      <div className="flex items-center space-x-2.5">
                        <input
                          id="terms"
                          type="checkbox"
    Severity: Major
    Found in marketing/src/containers/contact/component.tsx and 1 other location - About 1 day to fix
    marketing/src/containers/methodology/stay-up-to-date/component.tsx on lines 121..159

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File eudr-dashboard.service.ts has 583 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Inject, Injectable, NotFoundException } from '@nestjs/common';
    import { DataSource, EntityManager, SelectQueryBuilder } from 'typeorm';
    import {
      AlertedGeoregionsBySupplier,
      IEUDRAlertsRepository,
    Severity: Major
    Found in api/src/modules/eudr-alerts/dashboard/eudr-dashboard.service.ts - About 1 day to fix

      FlowMapSelectors has 66 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default class FlowMapSelectors<L, F> {
        accessors: FlowMapAggregateAccessors<L, F>;
      
        constructor(accessors: FlowMapDataAccessors<L, F>) {
          this.accessors = new FlowMapAggregateAccessors(accessors);
      Severity: Major
      Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 1 day to fix

        Function up has 240 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public async up(queryRunner: QueryRunner): Promise<void> {
            await queryRunner.query(`
              CREATE OR REPLACE FUNCTION get_h3_uncompact_geo_region(geo_region_id uuid, h3_resolution int)
              RETURNS TABLE (h3index h3index) AS
              $$
        Severity: Major
        Found in api/src/migrations/1645259040554-ImpactStoredFunctions.ts - About 1 day to fix
          Severity
          Category
          Status
          Source
          Language