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";
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"]>
) {
- Read upRead up
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"]>
) {
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> {
- Read upRead up
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> {
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> {
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> {
- Read upRead up
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> {
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"]>
) {
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 {
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,
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> {
- Read upRead up
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> {
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>
) {
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 {
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> {
- Read upRead up
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> {
- Read upRead up
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
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 {
- Read upRead up
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> {
- Read upRead up
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"]>
) {
- Read upRead up
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>
) {
- Read upRead up
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,
- Read upRead up
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);
}
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 {
- Read upRead up
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> {
- Read upRead up
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> {
- Read upRead up
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"]>
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> {
- Read upRead up
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
- Read upRead up
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));
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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));
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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 (
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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) {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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) {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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(
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
} else if (
response.right.status === 500 ||
response.right.status === 504
) {
// Attiva failed
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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]);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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(
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76