gerencianet/gn-api-sdk-node

View on GitHub
examples/pix/cobv/pixUpdateDueCharge.js

Summary

Maintainability
A
1 hr
Test Coverage

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

gerencianet.pixUpdateDueCharge(params, body)
    .then((resposta) => {
        console.log(resposta)
    })
    .catch((error) => {
Severity: Major
Found in examples/pix/cobv/pixUpdateDueCharge.js and 38 other locations - About 1 hr to fix
examples/charges/billet/createBilletHistory.js on lines 14..20
examples/charges/billet/defineBalanceSheetBillet.js on lines 75..81
examples/charges/billet/defineBilletPayMethod.js on lines 25..31
examples/charges/billet/sendBilletEmail.js on lines 14..20
examples/charges/billet/updateBillet.js on lines 14..20
examples/charges/billet/updateBilletMetadata.js on lines 15..21
examples/charges/card/createCardHistory.js on lines 14..20
examples/charges/card/defineCardPayMethod.js on lines 34..40
examples/charges/card/updateCardMetadata.js on lines 15..21
examples/charges/carnet/createCarnetHistory.js on lines 14..20
examples/charges/carnet/sendCarnetEmail.js on lines 14..20
examples/charges/carnet/sendCarnetParcelEmail.js on lines 15..21
examples/charges/carnet/updateCarnetMetadata.js on lines 15..21
examples/charges/carnet/updateCarnetParcel.js on lines 15..21
examples/charges/payment-link/createChargeLinkHistory.js on lines 14..20
examples/charges/payment-link/createOneStepLink.js on lines 27..33
examples/charges/payment-link/defineLinkPayMethod.js on lines 19..25
examples/charges/payment-link/sendLinkEmail.js on lines 14..20
examples/charges/payment-link/updateLink.js on lines 19..25
examples/charges/payment-link/updateLinkMetadata.js on lines 15..21
examples/charges/subscription/createOneStepBilletSubscription.js on lines 32..36
examples/charges/subscription/createOneStepCardSubscription.js on lines 41..45
examples/charges/subscription/createOneStepSubscriptionLink.js on lines 25..29
examples/charges/subscription/createPlan.js on lines 14..20
examples/charges/subscription/createSubscriptionHistory.js on lines 14..20
examples/charges/subscription/defineSubscriptionBillet.js on lines 25..31
examples/charges/subscription/defineSubscriptionCard.js on lines 33..39
examples/charges/subscription/sendSubscriptionLinkEmail.js on lines 14..20
examples/charges/subscription/updatePlan.js on lines 14..20
examples/charges/subscription/updateSubscriptionMetadata.js on lines 15..21
examples/open-finance/payment/ofDevolutionPix.js on lines 14..20
examples/payments/billets/payRequestBarCode.js on lines 16..22
examples/pix/cob/pixCreateCharge.js on lines 34..40
examples/pix/cob/pixUpdateCharge.js on lines 35..41
examples/pix/cobv/pixCreateDueCharge.js on lines 46..52
examples/pix/pix/pixDevolution.js on lines 15..21
examples/pix/send/pixSend.js on lines 20..26
examples/pix/webhooks/pixConfigWebhook.js on lines 16..22

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

There are no issues that match your filters.

Category
Status