Vizzuality/landgriffon

View on GitHub

Showing 1,408 of 1,408 total issues

Function AnalysisTable has 460 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AnalysisTable = () => {
  const searchParams = useSearchParams();
  const isComparisonEnabled = Boolean(searchParams.get('compareScenarioId'));

  const [paginationState, setPaginationState] = useState<PaginationState>({
Severity: Major
Found in client/src/containers/analysis-visualization/analysis-table/index.tsx - About 2 days to fix

    Function MoreFilters has 353 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const MoreFilters = () => {
      const { query } = useRouter();
      const { scenarioId, compareScenarioId } = query;
    
      const dispatch = useAppDispatch();

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

      export function IsSmallerOrEqualThan(
        property: string,
        validationOptions?: ValidationOptions,
      ) {
        return (object: Record<string, any>, propertyName: string): void => {
      Severity: Major
      Found in api/src/decorators/comparison.decorator.ts and 1 other location - About 1 day to fix
      api/src/decorators/comparison.decorator.ts on lines 7..42

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

      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 function IsGreaterOrEqualThan(
        property: string,
        validationOptions?: ValidationOptions,
      ) {
        return (object: Record<string, any>, propertyName: string): void => {
      Severity: Major
      Found in api/src/decorators/comparison.decorator.ts and 1 other location - About 1 day to fix
      api/src/decorators/comparison.decorator.ts on lines 44..79

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

      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 h3-data.repository.ts has 679 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        Brackets,
        DataSource,
        ObjectLiteral,
        Repository,
      Severity: Major
      Found in api/src/modules/h3-data/h3-data.repository.ts - About 1 day to fix

        Function buildDashboard has 301 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async buildDashboard(dto: GetDashBoardDTO): Promise<EUDRDashboard> {
            if (dto.originIds) {
              dto.originIds = await this.adminRegionService.getAdminRegionDescendants(
                dto.originIds,
              );
        Severity: Major
        Found in api/src/modules/eudr-alerts/dashboard/eudr-dashboard.service.ts - About 1 day to fix

          File component.tsx has 665 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import Wrapper from 'containers/wrapper';
          import Link from 'next/link';
          
          const PrivacyPolicy: React.FC = () => {
            return (
          Severity: Major
          Found in marketing/src/containers/privacy-policy/component.tsx - About 1 day to fix

            Function EUDRCompareMap has 298 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

                          <FadeIn>
                            <h3 className="mb-5 text-4xl font-medium text-white uppercase font-display">
                              Core Team
                            </h3>
                            <ul className="grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3">
              Severity: Major
              Found in marketing/src/containers/about/team/component.tsx and 1 other location - About 1 day to fix
              marketing/src/containers/about/team/component.tsx on lines 78..108

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

              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

                          <FadeIn>
                            <h3 className="mb-5 text-4xl font-medium text-white uppercase font-display">
                              Supporting Roles
                            </h3>
                            <ul className="grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3">
              Severity: Major
              Found in marketing/src/containers/about/team/component.tsx and 1 other location - About 1 day to fix
              marketing/src/containers/about/team/component.tsx on lines 46..76

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

              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

                async getAvailableYearsForContextualLayer(yearsRequestParams: {
                  layerType: LAYER_TYPES;
                  h3DataIds?: string[] | null;
                  indicatorId?: string;
                }): Promise<number[]> {
              Severity: Major
              Found in api/src/modules/h3-data/h3-data.repository.ts and 1 other location - About 1 day to fix
              api/src/modules/h3-data/h3-data.repository.ts on lines 270..307

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

              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

                async getYears(yearsRequestParams: {
                  layerType: LAYER_TYPES;
                  h3DataIds?: string[] | null;
                  indicatorId?: string;
                }): Promise<number[]> {
              Severity: Major
              Found in api/src/modules/h3-data/h3-data.repository.ts and 1 other location - About 1 day to fix
              api/src/modules/h3-data/h3-data.repository.ts on lines 130..167

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

              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

                validate(longitudeInput: number, args: ValidationArguments): boolean {
                  if (
                    (args.object as SourcingDataExcelValidator).location_type ===
                      LOCATION_TYPES.UNKNOWN ||
                    (args.object as SourcingDataExcelValidator).location_type ===
              api/src/modules/import-data/sourcing-data/validation/validators/latitude-input.custom.validator.ts on lines 13..40

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

              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

                validate(latitudeInput: number, args: ValidationArguments): boolean {
                  if (
                    (args.object as SourcingDataExcelValidator).location_type ===
                      LOCATION_TYPES.UNKNOWN ||
                    (args.object as SourcingDataExcelValidator).location_type ===
              api/src/modules/import-data/sourcing-data/validation/validators/longitude-input.custom.validator.ts on lines 13..40

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

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

              const EUDRBasemapControl = () => {
                const currentDate = useMemo(() => new Date(), []);
                const dispatch = useAppDispatch();
                const { basemap, planetLayer, planetCompareLayer } = useAppSelector((state) => state.eudr);
                const basemapData = LayersData.find((layer) => layer.id === 'planet-data');
              Severity: Major
              Found in client/src/containers/analysis-eudr/map/basemap/component.tsx - About 1 day to fix

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

                      {hoverInfo?.object && (
                        <div
                          className="pointer-events-none absolute z-10 max-w-32 rounded-md bg-white p-2 text-2xs shadow-md"
                          style={{
                            left: hoverInfo?.x + 10,
                Severity: Major
                Found in client/src/containers/analysis-eudr/map/compare.tsx and 1 other location - About 1 day to fix
                client/src/containers/analysis-eudr/map/component.tsx on lines 291..316

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

                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

                      {hoverInfo?.object && (
                        <div
                          className="pointer-events-none absolute z-10 max-w-32 rounded-md bg-white p-2 text-2xs shadow-md"
                          style={{
                            left: hoverInfo?.x + 10,
                Severity: Major
                Found in client/src/containers/analysis-eudr/map/component.tsx and 1 other location - About 1 day to fix
                client/src/containers/analysis-eudr/map/compare.tsx on lines 331..356

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

                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 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 47..75
                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 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 47..75
                marketing/src/containers/home/how/component.tsx on lines 76..104
                marketing/src/containers/home/how/component.tsx on lines 105..133

                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 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 47..75
                marketing/src/containers/home/how/component.tsx on lines 76..104
                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

                Severity
                Category
                Status
                Source
                Language