teamdigitale/italia-app

View on GitHub
ts/sagas/wallet/pagopaApis.ts

Summary

Maintainability
F
1 wk
Test Coverage

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

    Function updateWalletPspRequestHandler has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    export function* updateWalletPspRequestHandler(
      pagoPaClient: PaymentManagerClient,
      pmSessionManager: SessionManager<PaymentManagerToken>,
      action: ActionType<(typeof paymentUpdateWalletPsp)["request"]>
    ) {
    Severity: Minor
    Found in ts/sagas/wallet/pagopaApis.ts - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function updateWalletPspRequestHandler has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function* updateWalletPspRequestHandler(
      pagoPaClient: PaymentManagerClient,
      pmSessionManager: SessionManager<PaymentManagerToken>,
      action: ActionType<(typeof paymentUpdateWalletPsp)["request"]>
    ) {
    Severity: Major
    Found in ts/sagas/wallet/pagopaApis.ts - About 2 hrs to fix

      Function deleteWalletRequestHandler has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      export function* deleteWalletRequestHandler(
        pagoPaClient: PaymentManagerClient,
        pmSessionManager: SessionManager<PaymentManagerToken>,
        action: ActionType<typeof deleteWalletRequest>
      ): Generator<ReduxSagaEffect, void, any> {
      Severity: Minor
      Found in ts/sagas/wallet/pagopaApis.ts - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function deleteAllPaymentMethodsByFunctionRequestHandler has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function* deleteAllPaymentMethodsByFunctionRequestHandler(
        pagoPaClient: PaymentManagerClient,
        pmSessionManager: SessionManager<PaymentManagerToken>,
        action: ActionType<typeof deleteAllPaymentMethodsByFunction>
      ): Generator<ReduxSagaEffect, void, any> {
      Severity: Minor
      Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

        Function deleteWalletRequestHandler has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function* deleteWalletRequestHandler(
          pagoPaClient: PaymentManagerClient,
          pmSessionManager: SessionManager<PaymentManagerToken>,
          action: ActionType<typeof deleteWalletRequest>
        ): Generator<ReduxSagaEffect, void, any> {
        Severity: Minor
        Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

          Function fetchPspRequestHandler has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          export function* fetchPspRequestHandler(
            pagoPaClient: PaymentManagerClient,
            pmSessionManager: SessionManager<PaymentManagerToken>,
            action: ActionType<(typeof fetchPsp)["request"]>
          ): Generator<ReduxSagaEffect, void, any> {
          Severity: Minor
          Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function updatePaymentStatusSaga has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function* updatePaymentStatusSaga(
            pagoPaClient: PaymentManagerClient,
            pmSessionManager: SessionManager<PaymentManagerToken>,
            action: ActionType<typeof updatePaymentStatus.request>
          ): Generator<ReduxSagaEffect, void, any> {
          Severity: Minor
          Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

            Function getPspV2 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function* getPspV2(
              getPspV2: ReturnType<typeof PaymentManagerClient>["getPspV2"],
              pmSessionManager: SessionManager<PaymentManagerToken>,
              action: ActionType<(typeof pspForPaymentV2)["request"]>
            ) {
            Severity: Minor
            Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

              Function paymentAttivaRequestHandler has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function* paymentAttivaRequestHandler(
                postAttivaRpt: ReturnType<typeof BackendClient>["postAttivaRpt"],
                action: ActionType<(typeof paymentAttiva)["request"]>
              ) {
                try {
              Severity: Minor
              Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                Function commonPaymentVerificationProcedure has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function* commonPaymentVerificationProcedure<A extends Action>(
                  getVerificaRpt: ReturnType<typeof BackendClient>["getVerificaRpt"],
                  rptId: RptId,
                  successActionProvider: (paymentData: PaymentRequestsGetResponse) => A,
                  failureActionProvider: (details: Detail_v2Enum) => A,
                Severity: Minor
                Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                  Function updatePaymentStatusSaga has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function* updatePaymentStatusSaga(
                    pagoPaClient: PaymentManagerClient,
                    pmSessionManager: SessionManager<PaymentManagerToken>,
                    action: ActionType<typeof updatePaymentStatus.request>
                  ): Generator<ReduxSagaEffect, void, any> {
                  Severity: Minor
                  Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function fetchPspRequestHandler has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function* fetchPspRequestHandler(
                    pagoPaClient: PaymentManagerClient,
                    pmSessionManager: SessionManager<PaymentManagerToken>,
                    action: ActionType<(typeof fetchPsp)["request"]>
                  ): Generator<ReduxSagaEffect, void, any> {
                  Severity: Minor
                  Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                    Function addWalletCreditCardRequestHandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function* addWalletCreditCardRequestHandler(
                      pagoPaClient: PaymentManagerClient,
                      pmSessionManager: SessionManager<PaymentManagerToken>,
                      action: ActionType<typeof addWalletCreditCardRequest>
                    ) {
                    Severity: Minor
                    Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                      Function getWalletsV2 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function* getWalletsV2(
                        pagoPaClient: PaymentManagerClient,
                        pmSessionManager: SessionManager<PaymentManagerToken>
                      ): Generator<ReduxSagaEffect, E.Either<Error, ReadonlyArray<Wallet>>, any> {
                        try {
                      Severity: Minor
                      Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                        Function paymentCheckRequestHandler has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function* paymentCheckRequestHandler(
                          pagoPaClient: PaymentManagerClient,
                          pmSessionManager: SessionManager<PaymentManagerToken>,
                          action: ActionType<(typeof paymentCheck)["request"]>
                        ): Generator<ReduxSagaEffect, void, any> {
                        Severity: Minor
                        Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function paymentDeletePaymentRequestHandler has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function* paymentDeletePaymentRequestHandler(
                          pagoPaClient: PaymentManagerClient,
                          pmSessionManager: SessionManager<PaymentManagerToken>,
                          action: ActionType<(typeof paymentDeletePayment)["request"]>
                        ): Generator<ReduxSagaEffect, void, any> {
                        Severity: Minor
                        Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                        export function* paymentIdPollingRequestHandler(
                          getPaymentIdApi: ReturnType<ReturnType<typeof BackendClient>["getPaymentId"]>,
                          action: ActionType<(typeof paymentIdPolling)["request"]>
                        ) {
                          // successfully request the payment activation
                        Severity: Minor
                        Found in ts/sagas/wallet/pagopaApis.ts - About 1 hr to fix

                          Function getWalletsV2 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function* getWalletsV2(
                            pagoPaClient: PaymentManagerClient,
                            pmSessionManager: SessionManager<PaymentManagerToken>
                          ): Generator<ReduxSagaEffect, E.Either<Error, ReadonlyArray<Wallet>>, any> {
                            try {
                          Severity: Minor
                          Found in ts/sagas/wallet/pagopaApis.ts - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function setFavouriteWalletRequestHandler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function* setFavouriteWalletRequestHandler(
                            pagoPaClient: PaymentManagerClient,
                            pmSessionManager: SessionManager<PaymentManagerToken>,
                            action: ActionType<typeof setFavouriteWalletRequest>
                          ): Generator<ReduxSagaEffect, void, any> {
                          Severity: Minor
                          Found in ts/sagas/wallet/pagopaApis.ts - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function getPspV2 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function* getPspV2(
                            getPspV2: ReturnType<typeof PaymentManagerClient>["getPspV2"],
                            pmSessionManager: SessionManager<PaymentManagerToken>,
                            action: ActionType<(typeof pspForPaymentV2)["request"]>
                          ) {
                          Severity: Minor
                          Found in ts/sagas/wallet/pagopaApis.ts - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function addWalletCreditCardRequestHandler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function* addWalletCreditCardRequestHandler(
                            pagoPaClient: PaymentManagerClient,
                            pmSessionManager: SessionManager<PaymentManagerToken>,
                            action: ActionType<typeof addWalletCreditCardRequest>
                          ) {
                          Severity: Minor
                          Found in ts/sagas/wallet/pagopaApis.ts - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function commonPaymentVerificationProcedure has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function* commonPaymentVerificationProcedure<A extends Action>(
                            getVerificaRpt: ReturnType<typeof BackendClient>["getVerificaRpt"],
                            rptId: RptId,
                            successActionProvider: (paymentData: PaymentRequestsGetResponse) => A,
                            failureActionProvider: (details: Detail_v2Enum) => A,
                          Severity: Minor
                          Found in ts/sagas/wallet/pagopaApis.ts - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Avoid deeply nested control flow statements.
                          Open

                                      if (action.payload.onSuccess) {
                                        // signal the callee if requested
                                        action.payload.onSuccess(successAction);
                                      }
                          Severity: Major
                          Found in ts/sagas/wallet/pagopaApis.ts - About 45 mins to fix

                            Function paymentAttivaRequestHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export function* paymentAttivaRequestHandler(
                              postAttivaRpt: ReturnType<typeof BackendClient>["postAttivaRpt"],
                              action: ActionType<(typeof paymentAttiva)["request"]>
                            ) {
                              try {
                            Severity: Minor
                            Found in ts/sagas/wallet/pagopaApis.ts - About 45 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function fetchTransactionsRequestHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export function* fetchTransactionsRequestHandler(
                              pagoPaClient: PaymentManagerClient,
                              pmSessionManager: SessionManager<PaymentManagerToken>,
                              action: ActionType<typeof fetchTransactionsRequest>
                            ): Generator<ReduxSagaEffect, void, any> {
                            Severity: Minor
                            Found in ts/sagas/wallet/pagopaApis.ts - About 45 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function fetchTransactionRequestHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export function* fetchTransactionRequestHandler(
                              pagoPaClient: PaymentManagerClient,
                              pmSessionManager: SessionManager<PaymentManagerToken>,
                              action: ActionType<typeof fetchTransactionRequest>
                            ): Generator<ReduxSagaEffect, void, any> {
                            Severity: Minor
                            Found in ts/sagas/wallet/pagopaApis.ts - About 45 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function commonPaymentVerificationProcedure has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              getVerificaRpt: ReturnType<typeof BackendClient>["getVerificaRpt"],
                              rptId: RptId,
                              successActionProvider: (paymentData: PaymentRequestsGetResponse) => A,
                              failureActionProvider: (details: Detail_v2Enum) => A,
                              action?: ActionType<(typeof paymentVerifica)["request"]>
                            Severity: Minor
                            Found in ts/sagas/wallet/pagopaApis.ts - About 35 mins to fix

                              Function deleteAllPaymentMethodsByFunctionRequestHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function* deleteAllPaymentMethodsByFunctionRequestHandler(
                                pagoPaClient: PaymentManagerClient,
                                pmSessionManager: SessionManager<PaymentManagerToken>,
                                action: ActionType<typeof deleteAllPaymentMethodsByFunction>
                              ): Generator<ReduxSagaEffect, void, any> {
                              Severity: Minor
                              Found in ts/sagas/wallet/pagopaApis.ts - About 35 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function paymentIdPollingRequestHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function* paymentIdPollingRequestHandler(
                                getPaymentIdApi: ReturnType<ReturnType<typeof BackendClient>["getPaymentId"]>,
                                action: ActionType<(typeof paymentIdPolling)["request"]>
                              ) {
                                // successfully request the payment activation
                              Severity: Minor
                              Found in ts/sagas/wallet/pagopaApis.ts - About 35 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

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

                                try {
                                  const response: SagaCallReturnType<typeof request> = yield* call(request);
                                  if (E.isRight(response)) {
                                    if (response.right.status === 200) {
                                      yield* put(fetchTransactionSuccess(response.right.value.data));
                              Severity: Major
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 7 hrs to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 316..333

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

                              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

                                try {
                                  const response: SagaCallReturnType<typeof request> = yield* call(request);
                                  if (E.isRight(response)) {
                                    if (response.right.status === 200) {
                                      yield* put(setFavouriteWalletSuccess(response.right.value.data));
                              Severity: Major
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 7 hrs to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 182..199

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

                              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

                                try {
                                  const response: SagaCallReturnType<typeof checkPaymentWithRefresh> =
                                    yield* call(checkPaymentWithRefresh);
                                  if (E.isRight(response)) {
                                    if (
                              Severity: Major
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 1 hr to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 657..677

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

                              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

                                try {
                                  const response: SagaCallReturnType<typeof request> = yield* call(request);
                              
                                  if (E.isRight(response)) {
                                    if (response.right.status === 200) {
                              Severity: Major
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 1 hr to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 597..621

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

                              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

                                try {
                                  const response: SagaCallReturnType<typeof request> = yield* call(request);
                                  if (E.isRight(response)) {
                                    if (response.right.status === 200) {
                                      const psps = response.right.value.data;
                              Severity: Major
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 1 hr to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 260..297

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

                              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

                                try {
                                  const response: SagaCallReturnType<typeof request> = yield* call(request);
                                  if (E.isRight(response)) {
                                    if (response.right.status === 200) {
                                      if (response.right.value.data) {
                              Severity: Major
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 1 hr to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 866..903

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

                              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

                                if (O.isSome(pmSessionToken)) {
                                  yield* put(paymentExecuteStart.success(pmSessionToken.value));
                                } else {
                                  yield* put(
                                    paymentExecuteStart.failure(
                              Severity: Major
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 1 hr to fix
                              ts/features/wallet/onboarding/paypal/saga/networking/index.ts on lines 72..80

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

                              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

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

                                    } else if (
                                      response.right.status === 500 ||
                                      response.right.status === 504
                                    ) {
                                      // Attiva failed
                              Severity: Minor
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 50 mins to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 727..741

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

                              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

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

                                    } else if (
                                      response.right.status === 500 ||
                                      response.right.status === 504
                                    ) {
                                      // Verifica failed with a 500 or 504, that usually means there was an error
                              Severity: Minor
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 50 mins to fix
                              ts/sagas/wallet/pagopaApis.ts on lines 785..796

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

                              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 result = yield* take<
                                  ActionType<typeof pspForPaymentV2.success | typeof pspForPaymentV2.failure>
                                >([pspForPaymentV2.success, pspForPaymentV2.failure]);
                              Severity: Minor
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 40 mins to fix
                              ts/sagas/payments.ts on lines 23..28

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

                              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

                                    if (response.right.status === 200) {
                                      const psps = response.right.value.data;
                              
                                      const paymentStartOrigin = yield* select(paymentStartOriginSelector);
                                      const preferredPspsByOrigin = yield* select(
                              Severity: Minor
                              Found in ts/sagas/wallet/pagopaApis.ts and 1 other location - About 35 mins to fix
                              ts/features/zendesk/saga/networking/handleGetZendeskConfig.ts on lines 18..30

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

                              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

                              There are no issues that match your filters.

                              Category
                              Status