gerencianet/gn-api-sdk-node

View on GitHub

Showing 128 of 128 total issues

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

        DEFAULT: {
            URL: {
                PRODUCTION: 'https://api.gerencianet.com.br/v1',
                SANDBOX: 'https://sandbox.gerencianet.com.br/v1',
            },
Severity: Major
Found in lib/constants.js and 1 other location - About 4 days to fix
lib/constants.js on lines 183..362

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

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

        PIX: {
            URL: {
                PRODUCTION: 'https://api-pix.gerencianet.com.br',
                SANDBOX: 'https://api-pix-h.gerencianet.com.br',
            },
Severity: Major
Found in lib/constants.js and 1 other location - About 4 days to fix
lib/constants.js on lines 3..182

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File constants.js has 468 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module.exports = {
    APIS: {
        DEFAULT: {
            URL: {
                PRODUCTION: 'https://api.gerencianet.com.br/v1',
Severity: Minor
Found in lib/constants.js - About 7 hrs to fix

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

        payment: {
            credit_card: {
                installments: 1,
                payment_token: 'InsiraAquiUmPayeementeCode',
                billing_address: {
    examples/charges/card/createOneStepCard.js on lines 5..25
    examples/charges/card/defineCardPayMethod.js on lines 5..25
    examples/charges/subscription/createOneStepCardSubscription.js on lines 16..36

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        payment: {
            credit_card: {
                installments: 1,
                payment_token: '6426f3abd8688639c6772963669bbb8e0eb3c319',
                billing_address: {
    Severity: Major
    Found in examples/charges/card/defineCardPayMethod.js and 3 other locations - About 2 hrs to fix
    examples/charges/card/createOneStepCard.js on lines 5..25
    examples/charges/marketplace/createOneStepCardMarketplace.js on lines 5..25
    examples/charges/subscription/createOneStepCardSubscription.js on lines 16..36

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        payment: {
            credit_card: {
                installments: 1,
                payment_token: '83d52dbd590d9ebc991938c711ddd31f65df89a5',
                billing_address: {
    examples/charges/card/createOneStepCard.js on lines 5..25
    examples/charges/card/defineCardPayMethod.js on lines 5..25
    examples/charges/marketplace/createOneStepCardMarketplace.js on lines 5..25

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        payment: {
            credit_card: {
                installments: 1,
                payment_token: '83d52dbd590d9ebc991938c711ddd31f65df89a5',
                billing_address: {
    Severity: Major
    Found in examples/charges/card/createOneStepCard.js and 3 other locations - About 2 hrs to fix
    examples/charges/card/defineCardPayMethod.js on lines 5..25
    examples/charges/marketplace/createOneStepCardMarketplace.js on lines 5..25
    examples/charges/subscription/createOneStepCardSubscription.js on lines 16..36

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

    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

    let body = {
        calendario: {
            expiracao: 3600,
        },
        devedor: {
    Severity: Major
    Found in examples/pix/cob/pixCreateCharge.js and 1 other location - About 2 hrs to fix
    examples/pix/cob/pixCreateImmediateCharge.js on lines 4..26

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

    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

    let body = {
        calendario: {
            expiracao: 3600,
        },
        devedor: {
    Severity: Major
    Found in examples/pix/cob/pixCreateImmediateCharge.js and 1 other location - About 2 hrs to fix
    examples/pix/cob/pixCreateCharge.js on lines 4..26

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        async createRequest(route) {
            let regex = /\:(\w+)/g
            let query = ''
            let placeholders = route.match(regex) || []
            let params = {}
    Severity: Major
    Found in lib/endpoints.js - About 2 hrs to fix

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

              if (this.options.baseUrl != this.constants.APIS.DEFAULT.URL.PRODUCTION && this.options.baseUrl != this.constants.APIS.DEFAULT.URL.SANDBOX) {
                  req['httpsAgent'] = this.agent
              }
      Severity: Major
      Found in lib/endpoints.js and 1 other location - About 1 hr to fix
      lib/endpoints.js on lines 129..131

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 70.

      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 (this.options.baseUrl == this.constants.APIS.OPENFINANCE.URL.PRODUCTION || this.options.baseUrl == this.constants.APIS.OPENFINANCE.URL.SANDBOX) {
                  headers['x-idempotency-key'] = randomstring.generate({ length: 72, charset: 'alphanumeric' })
              }
      Severity: Major
      Found in lib/endpoints.js and 1 other location - About 1 hr to fix
      lib/endpoints.js on lines 140..142

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

      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

                          this.options.baseUrl = this.options.sandbox ? this.constants.APIS[key].URL.SANDBOX : this.constants.APIS[key].URL.PRODUCTION
      Severity: Major
      Found in lib/endpoints.js and 1 other location - About 1 hr to fix
      lib/endpoints.js on lines 17..17

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

      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

                  this.options.baseUrl = this.options.sandbox ? this.constants.APIS.DEFAULT.URL.SANDBOX : this.constants.APIS.DEFAULT.URL.PRODUCTION
      Severity: Major
      Found in lib/endpoints.js and 1 other location - About 1 hr to fix
      lib/endpoints.js on lines 22..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 69.

      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

          items: [
              {
                  name: 'Product 1',
                  value: 500,
                  amount: 1,
      examples/charges/marketplace/createOneStepCardMarketplace.js on lines 27..48

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function getAccessToken has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          async getAccessToken() {
              let postParams
              if (this.constants.APIS.DEFAULT.URL.PRODUCTION == this.baseUrl || this.constants.APIS.DEFAULT.URL.SANDBOX == this.baseUrl) {
                  postParams = {
                      method: 'POST',
      Severity: Minor
      Found in lib/auth.js - About 1 hr to fix

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

            items: [
                {
                    name: 'Product 1',
                    value: 500,
                    amount: 1,
        examples/charges/marketplace/createOneStepBilletMarketplace.js on lines 18..39

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

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

        gerencianet.updateAccountConfig([], body)
            .then((resposta) => {
                console.log(resposta)
            })
            .catch((error) => {
        Severity: Major
        Found in examples/exclusives/account/updateAccountConfig.js and 9 other locations - About 1 hr to fix
        examples/charges/billet/createOneStepBillet.js on lines 35..41
        examples/charges/card/createOneStepCard.js on lines 44..50
        examples/charges/marketplace/createOneStepBilletMarketplace.js on lines 50..56
        examples/charges/marketplace/createOneStepCardMarketplace.js on lines 59..65
        examples/exclusives/report/createReport.js on lines 28..34
        examples/open-finance/config/ofConfigUpdate.js on lines 11..17
        examples/open-finance/payment/ofStartPixPayment.js on lines 26..32
        examples/pix/cob/pixCreateImmediateCharge.js on lines 30..36
        examples/pix/location/pixCreateLocation.js on lines 10..16

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

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

        gerencianet.pixCreateLocation([], body)
            .then((resposta) => {
                console.log(resposta)
            })
            .catch((error) => {
        Severity: Major
        Found in examples/pix/location/pixCreateLocation.js and 9 other locations - About 1 hr to fix
        examples/charges/billet/createOneStepBillet.js on lines 35..41
        examples/charges/card/createOneStepCard.js on lines 44..50
        examples/charges/marketplace/createOneStepBilletMarketplace.js on lines 50..56
        examples/charges/marketplace/createOneStepCardMarketplace.js on lines 59..65
        examples/exclusives/account/updateAccountConfig.js on lines 22..28
        examples/exclusives/report/createReport.js on lines 28..34
        examples/open-finance/config/ofConfigUpdate.js on lines 11..17
        examples/open-finance/payment/ofStartPixPayment.js on lines 26..32
        examples/pix/cob/pixCreateImmediateCharge.js on lines 30..36

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

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

        gerencianet.ofConfigUpdate([], body)
            .then((resposta) => {
                console.log(resposta)
            })
            .catch((error) => {
        Severity: Major
        Found in examples/open-finance/config/ofConfigUpdate.js and 9 other locations - About 1 hr to fix
        examples/charges/billet/createOneStepBillet.js on lines 35..41
        examples/charges/card/createOneStepCard.js on lines 44..50
        examples/charges/marketplace/createOneStepBilletMarketplace.js on lines 50..56
        examples/charges/marketplace/createOneStepCardMarketplace.js on lines 59..65
        examples/exclusives/account/updateAccountConfig.js on lines 22..28
        examples/exclusives/report/createReport.js on lines 28..34
        examples/open-finance/payment/ofStartPixPayment.js on lines 26..32
        examples/pix/cob/pixCreateImmediateCharge.js on lines 30..36
        examples/pix/location/pixCreateLocation.js on lines 10..16

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language