Vizzuality/landgriffon

View on GitHub

Showing 438 of 1,408 total issues

File impact-calculator.service.ts has 412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Injectable,
  Logger,
  ServiceUnavailableException,
} from '@nestjs/common';

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

      public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
    
        CREATE OR REPLACE FUNCTION ${get_annual_commodity_weighted_impact_over_georegion}(
          geo_region_id uuid,
    Severity: Major
    Found in api/src/migrations/1695954091382-AddNewImpactStoredProcedure.ts - About 5 hrs to fix

      Function How has 145 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const How: React.FC = () => {
        const [ref, percentage] = useScrollPercentage({
          threshold: 0,
        });
      
      
      Severity: Major
      Found in marketing/src/containers/home/how/component.tsx - About 5 hrs to fix

        Function AdminUsersPage has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const AdminUsersPage: React.FC = () => {
          const { query } = useRouter();
          const [sorting, setSorting] = useState<SortingState>([]);
          const [pagination, setPaginationState] = useState<PaginationState>({
            pageIndex: 1,
        Severity: Major
        Found in client/src/pages/profile/users.tsx - About 5 hrs to fix

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

            public async up(queryRunner: QueryRunner): Promise<void> {
              /**
               * @description: This function is used to get the h3 table name and column name for a given indicator by its name code
               */
              await queryRunner.query(`
          Severity: Major
          Found in api/src/migrations/1692854789441-UpdateImpactStoredFunctions.ts - About 5 hrs to fix

            Function Regulations has 141 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Regulations: React.FC = () => {
              return (
                <section className="relative bg-white">
                  <Wrapper>
                    <div className="relative py-12 border-t border-black/10">
            Severity: Major
            Found in marketing/src/containers/methodology/regulations/component.tsx - About 5 hrs to fix

              Function StayUpToDate has 140 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const StayUpToDate: FC = () => {
                const [submitting, setSubmitting] = useState(false);
                const [success, setSuccess] = useState(false);
                const { register, handleSubmit, formState, reset } = useForm<SubSchema>({
                  resolver: yupResolver(schema),
              Severity: Major
              Found in marketing/src/containers/methodology/stay-up-to-date/component.tsx - About 5 hrs to fix

                Function EURDLegend has 139 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const EURDLegend = () => {
                  const dispatch = useAppDispatch();
                  const { supplierLayer, contextualLayers } = useAppSelector((state) => state.eudr);
                
                  const [isOpen, setIsOpen] = useState(false);
                Severity: Major
                Found in client/src/containers/analysis-eudr/map/legend/component.tsx - About 5 hrs to fix

                  File base-impact.service.ts has 387 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { Injectable, Logger } from '@nestjs/common';
                  import {
                    AnyImpactTableDto,
                    GetActualVsScenarioImpactTableDto,
                    GetImpactTableDto,
                  Severity: Minor
                  Found in api/src/modules/impact/base-impact.service.ts - About 5 hrs to fix

                    Function buildIndex has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function buildIndex<F>(clusterLevels: ClusterLevels): ClusterIndex<F> {
                      const nodesByZoom = new Map<number, ClusterNode[]>();
                      const clustersById = new Map<string, Cluster>();
                      const minZoomByLocationId = new Map<string, number>();
                      for (const { zoom, nodes } of clusterLevels) {
                    Severity: Major
                    Found in cookie-traceability/src/lib/flowmap/data/cluster/ClusterIndex.ts - About 5 hrs to fix

                      Function Cookie has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Cookie(props: any) {
                        const [selected, setSelected] = useState(false);
                      
                        const cookieRef = useRef<Group>();
                      
                      
                      Severity: Major
                      Found in cookie-traceability/src/components/cookie/component.tsx - About 5 hrs to fix

                        File impact.service.ts has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { Injectable, Logger } from '@nestjs/common';
                        import {
                          GetImpactTableDto,
                          GetRankedImpactTableDto,
                          GROUP_BY_VALUES,
                        Severity: Minor
                        Found in api/src/modules/impact/impact.service.ts - About 5 hrs to fix

                          Function SignUp has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const SignUp: NextPageWithLayout = () => {
                            const [isLoading, setIsLoading] = useState(false);
                            const router = useRouter();
                          
                            const {
                          Severity: Major
                          Found in client/src/pages/auth/signup.tsx - About 5 hrs to fix

                            Function Hero has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const Hero: React.FC = () => {
                              const videoRef = useRef<HTMLVideoElement>();
                              const [playing, setPlaying] = useState(false);
                            
                              const onTogglePlay = useCallback(() => {
                            Severity: Major
                            Found in marketing/src/containers/methodology/hero/component.tsx - About 4 hrs to fix

                              Function CategoryList has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const CategoryList = (): JSX.Element => {
                                const {
                                  viewBy,
                                  filters: { dates, suppliers, origins, materials, plots },
                                  table: { filters: tableFilters },
                              Severity: Major
                              Found in client/src/containers/analysis-eudr/category-list/index.tsx - About 4 hrs to fix

                                Function geoCodeAggregationPoint has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  async geoCodeAggregationPoint(sourcingData: SourcingData): Promise<any> {
                                    /**
                                     * The user must specify a country, and either an address OR coordinates
                                     */
                                    if (this.hasBothAddressAndCoordinates(sourcingData))

                                  File actual-vs-scenario.service.ts has 358 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { Injectable, Logger } from '@nestjs/common';
                                  import {
                                    GetActualVsScenarioImpactTableDto,
                                    GROUP_BY_VALUES,
                                    ORDER_BY,
                                  Severity: Minor
                                  Found in api/src/modules/impact/comparison/actual-vs-scenario.service.ts - About 4 hrs to fix

                                    Function SourcingModel has 114 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const SourcingModel: React.FC = () => {
                                      return (
                                        <section className="relative py-12 space-y-12 bg-blue-600 bg-cover md:space-y-64 md:py-32">
                                          <Wrapper>
                                            <div className="space-y-10 text-white md:space-y-20">
                                    Severity: Major
                                    Found in marketing/src/containers/methodology/sourcing-model/component.tsx - About 4 hrs to fix

                                      Function SignIn has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const SignIn: NextPageWithLayout = () => {
                                        const [isLoading, setIsLoading] = useState<boolean>(false);
                                        const router = useRouter();
                                      
                                        const {
                                      Severity: Major
                                      Found in client/src/pages/auth/signin.tsx - About 4 hrs to fix

                                        File FlowMapLayer.ts has 351 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        // @ts-nocheck
                                        /*
                                         * Copyright 2022 FlowmapBlue
                                         *
                                         * Licensed under the Apache License, Version 2.0 (the "License");
                                        Severity: Minor
                                        Found in cookie-traceability/src/lib/flowmap/layers/FlowMapLayer.ts - About 4 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language