Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

Function OpenScience has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const OpenScience: React.FC = () => {
  return (
    <section className="relative py-12 space-y-12 bg-blue-600 bg-cover md:space-y-64 md:py-36 overflow-hidden">
      <Wrapper>
        <div className="grid grid-cols-2">
Severity: Major
Found in marketing/src/containers/methodology/open-science/component.tsx - About 2 hrs to fix

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

      useEffect(() => {
        const handleStop = () => setIsLoading(false);
    
        // Prefetch the analysis page
        router.prefetch('/analysis');
    Severity: Major
    Found in client/src/pages/auth/signin.tsx and 1 other location - About 2 hrs to fix
    client/src/pages/auth/signup.tsx on lines 81..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 84.

    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

      useEffect(() => {
        const handleStop = () => setIsLoading(false);
    
        // Prefetch the sign-in page
        router.prefetch('/auth/sign-in');
    Severity: Major
    Found in client/src/pages/auth/signup.tsx and 1 other location - About 2 hrs to fix
    client/src/pages/auth/signin.tsx on lines 64..74

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

    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-x-10 pb-8 md:space-y-5">
                <div className="space-y-10">
                  <h3 className="text-4xl font-medium md:text-5xl font-display">Contact forms.</h3>
                  <p className="text-lg">
                    You can get in touch by using our contact form. Or, if your prefer, send an email to
    Severity: Major
    Found in marketing/src/containers/privacy-policy/component.tsx and 1 other location - About 2 hrs to fix
    marketing/src/containers/privacy-policy/component.tsx on lines 424..435

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

    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-x-10 pb-8 md:space-y-5">
                <div className="space-y-10">
                  <h3 className="text-4xl font-medium md:text-5xl font-display">
                    Ownership of the website.
                  </h3>
    Severity: Major
    Found in marketing/src/containers/privacy-policy/component.tsx and 1 other location - About 2 hrs to fix
    marketing/src/containers/privacy-policy/component.tsx on lines 368..377

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

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

    const ScenariosComparison: FC = () => {
      const { query, push } = useRouter();
      const { scenarioId, compareScenarioId } = query;
      const dispatch = useAppDispatch();
    
    
    Severity: Major
    Found in client/src/containers/scenarios/comparison/component.tsx - About 2 hrs to fix

      File index.tsx has 268 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { useCallback, useMemo, useState } from 'react';
      import Head from 'next/head';
      import { useRouter } from 'next/router';
      import { PlusIcon, SortDescendingIcon } from '@heroicons/react/solid';
      import Lottie from 'lottie-react';
      Severity: Minor
      Found in client/src/pages/data/scenarios/index.tsx - About 2 hrs to fix

        File eudr.controller.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
          Controller,
          Get,
          Param,
          Query,
        Severity: Minor
        Found in api/src/modules/eudr-alerts/eudr.controller.ts - About 2 hrs to fix

          Function YearsRange has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          const YearsRange: React.FC = () => {
            const dispatch = useAppDispatch();
          
            const [years, setYears] = useState<number[]>([]);
            const { visualizationMode } = useAppSelector(analysisUI);

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

          const UserDropdown: React.FC = () => {
            const { x, y, refs, strategy } = useFloating({
              placement: 'top-start',
              middleware: [offset({ crossAxis: 20, mainAxis: 10 }), shift()],
            });
          Severity: Major
          Found in client/src/containers/user-dropdown/component.tsx - About 2 hrs to fix

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

                        <li>
                          <Link href="/compliance">
                            <a
                              className={cx({
                                'relative block font-light text-2xl lg:text-base py-1 lg:py-7 mx-5 lg:mx-0 px-5 lg:px-0':
            Severity: Major
            Found in marketing/src/containers/header/nav/component.tsx and 5 other locations - About 2 hrs to fix
            marketing/src/containers/header/nav/component.tsx on lines 46..62
            marketing/src/containers/header/nav/component.tsx on lines 64..80
            marketing/src/containers/header/nav/component.tsx on lines 81..97
            marketing/src/containers/header/nav/component.tsx on lines 115..131
            marketing/src/containers/header/nav/component.tsx on lines 132..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 83.

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

                        <li>
                          <Link href="/faq">
                            <a
                              className={cx({
                                'relative block font-light text-2xl lg:text-base py-1 lg:py-7 mx-5 lg:mx-0 px-5 lg:px-0':
            Severity: Major
            Found in marketing/src/containers/header/nav/component.tsx and 5 other locations - About 2 hrs to fix
            marketing/src/containers/header/nav/component.tsx on lines 46..62
            marketing/src/containers/header/nav/component.tsx on lines 64..80
            marketing/src/containers/header/nav/component.tsx on lines 81..97
            marketing/src/containers/header/nav/component.tsx on lines 98..114
            marketing/src/containers/header/nav/component.tsx on lines 115..131

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 83.

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

              async importEudr(filePath: string, taskId: string): Promise<any> {
                this.logger.log(`Starting eudr import process`);
                await this.fileService.isFilePresentInFs(filePath);
                try {
                  const parsedEudrData: any = await this.fileService.transformToJson(
            Severity: Major
            Found in api/src/modules/import-data/eudr/eudr.import.service.ts - About 2 hrs to fix

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

                          <li>
                            <Link href="/the-service">
                              <a
                                className={cx({
                                  'relative block font-light text-2xl lg:text-base py-1 lg:py-7 mx-5 lg:mx-0 px-5 lg:px-0':
              Severity: Major
              Found in marketing/src/containers/header/nav/component.tsx and 5 other locations - About 2 hrs to fix
              marketing/src/containers/header/nav/component.tsx on lines 46..62
              marketing/src/containers/header/nav/component.tsx on lines 81..97
              marketing/src/containers/header/nav/component.tsx on lines 98..114
              marketing/src/containers/header/nav/component.tsx on lines 115..131
              marketing/src/containers/header/nav/component.tsx on lines 132..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 83.

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

                          <li>
                            <Link href="/about">
                              <a
                                className={cx({
                                  'relative block font-light text-2xl lg:text-base py-1 lg:py-7 mx-5 lg:mx-0 px-5 lg:px-0':
              Severity: Major
              Found in marketing/src/containers/header/nav/component.tsx and 5 other locations - About 2 hrs to fix
              marketing/src/containers/header/nav/component.tsx on lines 46..62
              marketing/src/containers/header/nav/component.tsx on lines 64..80
              marketing/src/containers/header/nav/component.tsx on lines 81..97
              marketing/src/containers/header/nav/component.tsx on lines 98..114
              marketing/src/containers/header/nav/component.tsx on lines 132..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 83.

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

                            <li>
                              <Link href="/">
                                <a
                                  className={cx({
                                    'relative block font-light text-2xl lg:text-base py-1 lg:py-7 mx-5 lg:mx-0 px-5 lg:px-0':
              Severity: Major
              Found in marketing/src/containers/header/nav/component.tsx and 5 other locations - About 2 hrs to fix
              marketing/src/containers/header/nav/component.tsx on lines 64..80
              marketing/src/containers/header/nav/component.tsx on lines 81..97
              marketing/src/containers/header/nav/component.tsx on lines 98..114
              marketing/src/containers/header/nav/component.tsx on lines 115..131
              marketing/src/containers/header/nav/component.tsx on lines 132..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 83.

              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

                    filename: (
                      _req: any,
                      file: Express.Multer.File,
                      cb: (error: Error | null, filename: string) => void,
                    ) => {
              Severity: Major
              Found in api/src/modules/import-data/file-upload.interceptor.ts and 1 other location - About 2 hrs to fix
              api/src/modules/import-data/multer-config.service.ts on lines 24..30

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

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

                          <li>
                            <Link href="/methodology">
                              <a
                                className={cx({
                                  'relative block font-light text-2xl lg:text-base py-1 lg:py-7 mx-5 lg:mx-0 px-5 lg:px-0':
              Severity: Major
              Found in marketing/src/containers/header/nav/component.tsx and 5 other locations - About 2 hrs to fix
              marketing/src/containers/header/nav/component.tsx on lines 46..62
              marketing/src/containers/header/nav/component.tsx on lines 64..80
              marketing/src/containers/header/nav/component.tsx on lines 98..114
              marketing/src/containers/header/nav/component.tsx on lines 115..131
              marketing/src/containers/header/nav/component.tsx on lines 132..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 83.

              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

                      filename: (
                        _req: any,
                        file: Express.Multer.File,
                        cb: (error: Error | null, filename: string) => void,
                      ) => {
              Severity: Major
              Found in api/src/modules/import-data/multer-config.service.ts and 1 other location - About 2 hrs to fix
              api/src/modules/import-data/file-upload.interceptor.ts on lines 24..30

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

              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

                                  <Anchor
                                    href={`/data/scenarios/${data.id}/interventions/new`}
                                    variant="secondary"
                                    className="text-gray-900"
                                    icon={
              Severity: Major
              Found in client/src/pages/data/scenarios/[scenarioId]/edit.tsx and 1 other location - About 2 hrs to fix
              client/src/pages/data/scenarios/[scenarioId]/edit.tsx on lines 218..232

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

              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