teamdigitale/italia-app

View on GitHub

Showing 4,378 of 4,378 total issues

File DSListItems.tsx has 761 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import * as React from "react";

import {
  Divider,
Severity: Major
Found in ts/features/design-system/core/DSListItems.tsx - About 1 day to fix

    File pagopaApis.ts has 751 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { RptId, RptIdFromString } from "@pagopa/io-pagopa-commons/lib/pagopa";
    import * as E from "fp-ts/lib/Either";
    import { pipe } from "fp-ts/lib/function";
    import * as O from "fp-ts/lib/Option";
    import { call, put, select, take } from "typed-redux-saga/macro";
    Severity: Major
    Found in ts/sagas/wallet/pagopaApis.ts - About 1 day to fix

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

            describe(`and then a ${getType(
              loadNextPageMessages.success
            )} is sent`, () => {
              const initialState = reducer(undefined, actionRequest);
              const action = loadNextPageMessages.success({
      ts/features/messages/store/reducers/__tests__/allPaginated.test.ts on lines 219..254

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

      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

            describe(`and then a ${getType(
              loadNextPageMessages.success
            )} is sent`, () => {
              const initialState = reducer(undefined, actionRequest);
              const action = loadNextPageMessages.success({
      ts/features/messages/store/reducers/__tests__/allPaginated.test.ts on lines 156..191

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

      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 store.test.ts has 720 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import * as pot from "@pagopa/ts-commons/lib/pot";
      import { Action, createStore } from "redux";
      import {
        featuredInstitutionsSelector,
        featuredServicesSelector,
      Severity: Major
      Found in ts/features/services/home/store/reducers/__tests__/store.test.ts - About 1 day to fix

        Function EmailInsertScreen has 327 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const EmailInsertScreen = () => {
          const {
            isOnboarding,
            isFciEditEmailFlow,
            isEditingPreviouslyInsertedEmailMode
        Severity: Major
        Found in ts/screens/profile/EmailInsertScreen.tsx - About 1 day to fix

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

            it("should display the denied camera permissions view and let user grant permissions", () => {
              const mockRequestCameraPermission = jest.fn();
              const mockOpenCameraSettings = jest.fn();
          
              (useIOBarcodeCameraScanner as jest.Mock).mockImplementationOnce(
          ts/features/barcode/components/__tests__/BarcodeScanBaseScreenComponent.test.tsx on lines 53..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 294.

          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

            it("should display the undefined camera permissions view and let user grant permissions", () => {
              const mockRequestCameraPermission = jest.fn();
              const mockOpenCameraSettings = jest.fn();
          
              (useIOBarcodeCameraScanner as jest.Mock).mockImplementationOnce(
          ts/features/barcode/components/__tests__/BarcodeScanBaseScreenComponent.test.tsx on lines 93..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 294.

          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 machine.ts has 705 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import * as p from "@pagopa/ts-commons/lib/pot";
          import * as E from "fp-ts/lib/Either";
          import * as O from "fp-ts/lib/Option";
          import { pipe } from "fp-ts/lib/function";
          import { assign, createMachine, forwardTo } from "xstate";
          Severity: Major
          Found in ts/features/idpay/configuration/xstate/machine.ts - About 1 day to fix

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

                  it("should render the component correctly if transaction is cancelled", () => {
                    const T_DATE = new Date(2023, 4, 5, 16, 31);
                    const T_AMOUNT = 3456.1;
                    const T_ACCRUED = 234.56;
                    const T_ACCRUED_STRING = "-234,56 €";
            ts/features/idpay/details/components/__tests__/TimelineOperationListItem.test.tsx on lines 483..518

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

            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

                  it("should render the component correctly if transaction is cancelled", () => {
                    const T_DATE = new Date(2023, 4, 5, 16, 31);
                    const T_AMOUNT = 3456.1;
                    const T_ACCRUED = 234.56;
                    const T_ACCRUED_STRING = "-234,56 €";
            ts/features/idpay/details/components/__tests__/TimelineOperationListItem.test.tsx on lines 598..633

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

            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

            const EuCovidCertWrongFormatKoComponent: React.FC<{
              currentAuthCode: EUCovidCertificateAuthCode;
              messageId: string;
            }> = ({ currentAuthCode, messageId }) => (
              <>
            ts/features/euCovidCert/screens/ko/EuCovidCertNotFoundKoScreen.tsx on lines 51..85

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

            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

            const EuCovidCertNotFoundKoComponent: React.FC<{
              currentAuthCode: EUCovidCertificateAuthCode;
              messageId: string;
            }> = ({ currentAuthCode, messageId }) => (
              <>
            ts/features/euCovidCert/screens/ko/EuCovidCertWrongFormatKoScreen.tsx on lines 51..85

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

            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

              it("should match snapshot when cancelled with payments without completed payments", () => {
                const initialState = dsEnabledGlobalState();
                const paymentIds = [
                  "01234567890012345678912345610",
                  "01234567890012345678912345620",
            Severity: Major
            Found in ts/features/pn/components/__test__/MessagePayments.test.tsx and 1 other location - About 1 day to fix
            ts/features/pn/components/__test__/MessagePayments.test.tsx on lines 410..461

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

            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

              it("should match snapshot when not cancelled, with more-than-five (max-visible-payments) payable payments, without cancelled-completed-payments", () => {
                const initialState = dsEnabledGlobalState();
                const paymentIds = [
                  "01234567890012345678912345610",
                  "01234567890012345678912345620",
            Severity: Major
            Found in ts/features/pn/components/__test__/MessagePayments.test.tsx and 1 other location - About 1 day to fix
            ts/features/pn/components/__test__/MessagePayments.test.tsx on lines 50..101

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

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

            export function* handleGetInitiativeDetails(
              getInitiativeDetails: IDPayClient["getWalletDetail"],
              bearerToken: string,
              language: PreferredLanguageEnum,
              action: ActionType<(typeof idpayInitiativeGet)["request"]>
            ts/features/idpay/details/saga/handleGetBeneficiaryDetails.ts on lines 20..63
            ts/features/idpay/details/saga/handleGetOnboardingStatus.ts on lines 19..62

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

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

            export function* handleGetOnboardingStatus(
              onboardingStatus: IDPayClient["onboardingStatus"],
              bearerToken: string,
              language: PreferredLanguageEnum,
              action: ActionType<(typeof idPayOnboardingStatusGet)["request"]>
            Severity: Major
            Found in ts/features/idpay/details/saga/handleGetOnboardingStatus.ts and 2 other locations - About 1 day to fix
            ts/features/idpay/details/saga/handleGetBeneficiaryDetails.ts on lines 20..63
            ts/features/idpay/details/saga/handleGetInitiativeDetails.ts on lines 20..63

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

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

            export function* handleGetBeneficiaryDetails(
              getInitiativeBeneficiaryDetail: IDPayClient["getInitiativeBeneficiaryDetail"],
              bearerToken: string,
              language: PreferredLanguageEnum,
              action: ActionType<(typeof idPayBeneficiaryDetailsGet)["request"]>
            ts/features/idpay/details/saga/handleGetInitiativeDetails.ts on lines 20..63
            ts/features/idpay/details/saga/handleGetOnboardingStatus.ts on lines 19..62

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

            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

            const testRootModal = (
              minVersion: string,
              appVersion: string,
              isSupported: boolean
            ) => {
            Severity: Major
            Found in ts/screens/modal/__test__/RootModal.test.tsx and 1 other location - About 1 day to fix
            ts/screens/wallet/__tests__/WalletHomeScreen.test.tsx on lines 28..67

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

            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

            const testWalletHomeScreen = (
              minVersion: string,
              appVersion: string,
              isSupported: boolean
            ) => {
            Severity: Major
            Found in ts/screens/wallet/__tests__/WalletHomeScreen.test.tsx and 1 other location - About 1 day to fix
            ts/screens/modal/__test__/RootModal.test.tsx on lines 112..151

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

            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