Vizzuality/landgriffon

View on GitHub

Showing 438 of 1,408 total issues

Function getActualVsScenarioImpactTable has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async getActualVsScenarioImpactTable(
    dto: GetActualVsScenarioImpactTableDto,
    fetchSpecification: FetchSpecification,
  ): Promise<ActualVsScenarioPaginatedImpactTable> {
    const indicators: Indicator[] =
Severity: Minor
Found in api/src/modules/impact/comparison/actual-vs-scenario.service.ts - About 1 hr to fix

    Function labelSelect has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const labelSelect = useMemo(() => {
        if (isArray(selected) && selected?.[0]?.label) {
          return (
            <div className="flex flex-wrap gap-2">
              {(sortBy(selected, ['label']) as Option<T>[] | Option<string>[]).map((option) => (
    Severity: Minor
    Found in client/src/components/forms/select/component.tsx - About 1 hr to fix

      Function querySyncMiddleware has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const querySyncMiddleware: Middleware = () => (next) => (action) => {
        const { query, isReady } = router;
        if (!isReady) return next(action);
      
        Object.entries(QUERY_PARAMS_MAP).forEach(async ([param, queryState]) => {
      Severity: Minor
      Found in client/src/store/index.ts - About 1 hr to fix

        Function useSourcingLocationsMaterials has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function useSourcingLocationsMaterials(
          params: SourcingLocationsParams,
          queryOptions?: UseQueryOptions<SourcingLocationsMaterialsAPIResponse>,
        ): SourcingLocationsMaterialsDataResponse {
          const query = useQuery<SourcingLocationsMaterialsAPIResponse>(
        Severity: Minor
        Found in client/src/hooks/sourcing-locations/index.ts - About 1 hr to fix

          Function catch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            catch(exception: Error, host: ArgumentsHost): void {
              const ctx: HttpArgumentsHost = host.switchToHttp();
              const response: any = ctx.getResponse();
              const request: any = ctx.getRequest();
          
          
          Severity: Minor
          Found in api/src/filters/all-exceptions.exception.filter.ts - About 1 hr to fix

            Function getMaterialMapByResolution has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async getMaterialMapByResolution(
                materialH3Data: H3Data,
                resolution: number,
              ): Promise<{ materialMap: H3IndexValueData[]; quantiles: number[] }> {
                const tmpTableName: string = H3DataRepository.generateRandomTableName();
            Severity: Minor
            Found in api/src/modules/h3-data/h3-data.repository.ts - About 1 hr to fix

              Function updateImportTask has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async updateImportTask(updateTask: UpdateImportTask): Promise<Task> {
                  /**
                   * @debt
                   * TypeORM does not provide a friendly API to handle json fields on a UPDATE statement
                   * For now we are retrieving the event, update data withing the API and save it back
              Severity: Minor
              Found in api/src/modules/tasks/tasks.service.ts - About 1 hr to fix

                Function AboutPage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const AboutPage: NextPage<PageProps> = () => {
                  return (
                    <ApplicationLayout>
                      <>
                        <Head>
                Severity: Minor
                Found in marketing/src/pages/about.tsx - About 1 hr to fix

                  Function main has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def main(
                  Severity: Major
                  Found in data/h3_data_importer/vector_folder_to_h3_table.py - About 1 hr to fix

                    Function useContextualLayers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const useContextualLayers = (
                      options: Omit<UseQueryOptions<LayerCategoriesApiResponse['data']>, 'select'> = {},
                    ) => {
                      const dispatch = useAppDispatch();
                      return useQuery(
                    Severity: Minor
                    Found in client/src/hooks/layers/getContextualLayers.ts - About 1 hr to fix

                      Function useUsers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const useUsers = (
                        params: Record<string, unknown> = {},
                        options: UseQueryOptions<UserPayload> = {},
                      ) => {
                        const queryOptions: UseQueryOptions<UserPayload> = {
                      Severity: Minor
                      Found in client/src/hooks/users/index.ts - About 1 hr to fix

                        Function ProjectedDataIcon has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function ProjectedDataIcon(props) {
                          return (
                            <svg
                              width={12}
                              height={12}
                        Severity: Minor
                        Found in client/src/components/icons/projected-data.tsx - About 1 hr to fix

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

                            render(): JSX.Element {
                              return (
                                <Html>
                                  <Head>
                                    <link rel="preconnect" href="https://fonts.gstatic.com" />
                          Severity: Minor
                          Found in landing/pages/_document.tsx - About 1 hr to fix

                            Function getAdminRegionAndGeoRegionIdByCoordinatesAndLevel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              async getAdminRegionAndGeoRegionIdByCoordinatesAndLevel(
                                searchParams: {
                                  lng: number;
                                  lat: number;
                                  level: number;
                            Severity: Minor
                            Found in api/src/modules/admin-regions/admin-region.repository.ts - About 1 hr to fix

                              Function getRankedImpactTable has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                async getRankedImpactTable(
                                  rankedImpactTableDto: GetRankedImpactTableDto,
                                ): Promise<ImpactTable> {
                                  const indicators: Indicator[] =
                                    await this.indicatorService.getIndicatorsById(
                              Severity: Minor
                              Found in api/src/modules/impact/impact.service.ts - About 1 hr to fix

                                Function saveChunks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  async saveChunks<Entity>(
                                    entities: Entity[],
                                    options?: SaveOptions,
                                  ): Promise<Entity[]> {
                                    const queryRunner: QueryRunner = this.dataSource.createQueryRunner();
                                Severity: Minor
                                Found in api/src/utils/app-base.repository.ts - About 1 hr to fix

                                  Function initializeState has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    initializeState() {
                                      this.getAttributeManager().addInstanced({
                                        instancePositions: {
                                          size: 3,
                                          type: GL.DOUBLE,

                                    Function aggregateFlows has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function aggregateFlows<F>(flows: F[], flowAccessors: FlowAccessors<F>): AggregateFlow[] {
                                      // Sum up flows with same origin, dest
                                      const byOriginDest = nest<F, AggregateFlow>()
                                        .key(flowAccessors.getFlowOriginId)
                                        .key(flowAccessors.getFlowDestId)
                                    Severity: Minor
                                    Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 1 hr to fix

                                      Function validate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        validate(addressInput: string, args: ValidationArguments): boolean {
                                          if (
                                            (args.object as SourcingDataExcelValidator).location_type ===
                                              LOCATION_TYPES.UNKNOWN ||
                                            (args.object as SourcingDataExcelValidator).location_type ===

                                        Function Methodology has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const Methodology: React.FC = () => {
                                          useEffect(() => {
                                            let timerId: number;
                                        
                                            if (window.location.hash && document.querySelector(window.location.hash)) {
                                        Severity: Minor
                                        Found in marketing/src/containers/methodology/component.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language