Vizzuality/landgriffon

View on GitHub

Showing 438 of 1,408 total issues

Function getAvailableYearsForContextualLayer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async getAvailableYearsForContextualLayer(yearsRequestParams: {
    layerType: LAYER_TYPES;
    h3DataIds?: string[] | null;
    indicatorId?: string;
  }): Promise<number[]> {
Severity: Minor
Found in api/src/modules/h3-data/h3-data.repository.ts - About 1 hr to fix

    Function getYears has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async getYears(yearsRequestParams: {
        layerType: LAYER_TYPES;
        h3DataIds?: string[] | null;
        indicatorId?: string;
      }): Promise<number[]> {
    Severity: Minor
    Found in api/src/modules/h3-data/h3-data.repository.ts - About 1 hr to fix

      Function saveGeoRegionAsRadius has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async saveGeoRegionAsRadius(
          newGeoRegionValues: LocationGeoRegionDto,
        ): Promise<string> {
          const selectQuery: SelectQueryBuilder<any> = this.dataSource
            .createQueryBuilder()
      Severity: Minor
      Found in api/src/modules/geo-regions/geo-region.repository.ts - About 1 hr to fix

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

          public async up(queryRunner: QueryRunner): Promise<void> {
            await queryRunner.query(`
              CREATE OR REPLACE FUNCTION sum_weighted_water_over_georegion(
            geo_region_id uuid
           )
        Severity: Minor
        Found in api/src/migrations/1654502331040-WaterIndicatorColumnNameUpdate.ts - About 1 hr to fix

          Function intercept has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async intercept(
              context: ExecutionContext,
              next: CallHandler,
            ): Promise<Observable<any>> {
              if (this.scenarioAcl.isUserAdmin()) {

            Function getEntityAncestryFlatArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async getEntityAncestryFlatArray<Entity extends ObjectLiteral>(
                queryBuilder: SelectQueryBuilder<Entity>,
                entityName: string,
              ): Promise<Entity[]> {
                const [subQuery, subQueryParams]: [string, any[]] =
            Severity: Minor
            Found in api/src/utils/tree.repository.ts - About 1 hr to fix

              Function isComparisonRequestAuthorized has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private async isComparisonRequestAuthorized(
                  request: Request,
                  additionalChecks: ScenarioCheckWhiteListOptions,
                ): Promise<boolean> {
                  const baseScenarioId: string = request.query.baseScenarioId as string;

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

                  public async up(queryRunner: QueryRunner): Promise<void> {
                    await queryRunner.query(
                      'DROP MATERIALIZED VIEW IF EXISTS impact_materialized_view;',
                    );
                    await queryRunner.query(`

                  Function down has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public async down(queryRunner: QueryRunner): Promise<void> {
                      await queryRunner.query(`
                      CREATE OR REPLACE FUNCTION sum_weighted_water_over_georegion(
                      geo_region_id uuid
                     )
                  Severity: Minor
                  Found in api/src/migrations/1654502331040-WaterIndicatorColumnNameUpdate.ts - About 1 hr to fix

                    Function handleSourceDataSelect has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      private handleSourceDataSelect(
                        queryBuilder: SelectQueryBuilder<SourcingRecord>,
                        dto: GetImpactTableDto,
                      ): SelectQueryBuilder<SourcingRecord> {
                        if (dto.scenarioId) {
                    Severity: Minor
                    Found in api/src/modules/impact/impact.repository.ts - About 1 hr to fix

                      Function Search has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const Search: FC<SearchProps> = ({ ...props }: SearchProps) => {
                        const { placeholder } = props;
                        const state = useSearchFieldState(props);
                      
                        const ref = useRef();
                      Severity: Minor
                      Found in marketing/src/components/search/component.tsx - About 1 hr to fix

                        Function TheServicePage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Function PrivacyPolicyPage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function Compliance has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function handleDownloadData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const handleDownloadData = useCallback(async () => {
                                  let csv = null;
                                  // actual vs scenario
                                  if (!currentScenario && scenarioToCompare) {
                                    csv = await downloadActualVsScenarioData.mutateAsync({

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

                                  render(): JSX.Element {
                                    return (
                                      <Html className="h-full bg-gray-100">
                                        <Head>
                                          <meta
                                Severity: Minor
                                Found in client/src/pages/_document.tsx - About 1 hr to fix

                                  Function Page404 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const Page404: React.FC = () => {
                                    const handleGoBack = useCallback(() => Router.back(), []);
                                  
                                    return (
                                      <div className="flex h-screen place-items-center justify-center">
                                  Severity: Minor
                                  Found in client/src/pages/404.tsx - About 1 hr to fix

                                    Function paramsToQueryInjector has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const paramsToQueryInjector = (
                                      params: string[],
                                      query: string,
                                    ): string => {
                                      while (query.includes('$')) {
                                    Severity: Minor
                                    Found in api/src/utils/helpers/params-to-query-injector.helper.ts - About 1 hr to fix

                                      Function generateNewLocationForChangeProductionEfficiency has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        generateNewLocationForChangeProductionEfficiency(
                                          sourcingLocations: SourcingLocation[],
                                        ): SourcingLocation[] {
                                          const newLocations: SourcingLocation[] = [];
                                          for (const location of sourcingLocations) {

                                        Function baseQueryExtend has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            const baseQueryExtend = (baseQuery: SelectQueryBuilder<any>): void => {
                                              //Add selection criteria to also select both comparedScenario in the select statement
                                              baseQuery
                                                .leftJoin(
                                                  ScenarioIntervention,
                                        Severity: Minor
                                        Found in api/src/modules/h3-data/h3-data.repository.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language