mundipagg/magento2

View on GitHub

Showing 453 of 453 total issues

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

<?php
/**
 * Class ConfigProvider
 *
 * @author      MundiPagg Embeddables Team <embeddables@mundipagg.com>
Severity: Major
Found in Model/Ui/TwoCreditCard/ConfigProvider.php and 1 other location - About 3 days to fix
Model/Ui/BilletCreditCard/ConfigProvider.php on lines 1..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 658.

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

<?php
/**
 * Class ConfigProvider
 *
 * @author      MundiPagg Embeddables Team <embeddables@mundipagg.com>
Severity: Major
Found in Model/Ui/BilletCreditCard/ConfigProvider.php and 1 other location - About 3 days to fix
Model/Ui/TwoCreditCard/ConfigProvider.php on lines 1..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 658.

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 InstallSchema.php has 1314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php


namespace MundiPagg\MundiPagg\Setup;

Severity: Major
Found in Setup/InstallSchema.php - About 3 days to fix

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

    define(
        [
            "MundiPagg_MundiPagg/js/view/payment/default",
            "MundiPagg_MundiPagg/js/core/checkout/PaymentModuleBootstrap",
            "MundiPagg_MundiPagg/js/core/models/DebitModel",
    Severity: Major
    Found in view/frontend/web/js/view/payment/debit.js and 1 other location - About 3 days to fix
    view/frontend/web/js/view/payment/voucher.js on lines 4..130

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

    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

    define(
        [
            "MundiPagg_MundiPagg/js/view/payment/default",
            "MundiPagg_MundiPagg/js/core/checkout/PaymentModuleBootstrap",
            "MundiPagg_MundiPagg/js/core/models/VoucherModel",
    Severity: Major
    Found in view/frontend/web/js/view/payment/voucher.js and 1 other location - About 3 days to fix
    view/frontend/web/js/view/payment/debit.js on lines 4..130

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

    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 (
            typeof this.formObject[0].multibuyer != 'undefined' &&
            typeof this.formObject[0].multibuyer.showMultibuyer != 'undefined' &&
            this.formObject[0].multibuyer.showMultibuyer.prop( "checked" ) == true
        ) {
    Severity: Major
    Found in view/frontend/web/js/core/models/BoletoCreditcardModel.js and 1 other location - About 2 days to fix
    view/frontend/web/js/core/models/BoletoCreditcardModel.js on lines 155..176

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

    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 (
            typeof this.formObject[1].multibuyer != 'undefined' &&
            typeof this.formObject[1].multibuyer.showMultibuyer != 'undefined' &&
            this.formObject[1].multibuyer.showMultibuyer.prop( "checked" ) == true
        ) {
    Severity: Major
    Found in view/frontend/web/js/core/models/BoletoCreditcardModel.js and 1 other location - About 2 days to fix
    view/frontend/web/js/core/models/BoletoCreditcardModel.js on lines 132..153

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

    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 (
            typeof this.formObject.multibuyer != 'undefined' &&
            typeof this.formObject.multibuyer.showMultibuyer != 'undefined' &&
            this.formObject.multibuyer.showMultibuyer.prop( "checked" ) == true
        ) {
    Severity: Major
    Found in view/frontend/web/js/core/models/BoletoModel.js and 1 other location - About 2 days to fix
    view/frontend/web/js/core/models/PixModel.js on lines 35..57

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

    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 (
            typeof this.formObject.multibuyer != 'undefined' &&
            typeof this.formObject.multibuyer.showMultibuyer != 'undefined' &&
            this.formObject.multibuyer.showMultibuyer.prop( "checked" ) == true
        ) {
    Severity: Major
    Found in view/frontend/web/js/core/models/PixModel.js and 1 other location - About 2 days to fix
    view/frontend/web/js/core/models/BoletoModel.js on lines 36..58

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

    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 (
            typeof this.formObject[0].multibuyer.showMultibuyer != 'undefined' &&
            this.formObject[0].multibuyer.showMultibuyer.prop( "checked" ) == true
        ) {
            multibuyer = this.formObject[0].multibuyer;
    Severity: Major
    Found in view/frontend/web/js/core/models/TwoCreditcardsModel.js and 1 other location - About 2 days to fix
    view/frontend/web/js/core/models/TwoCreditcardsModel.js on lines 125..145

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

    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 (
            typeof this.formObject[1].multibuyer.showMultibuyer != 'undefined' &&
            this.formObject[1].multibuyer.showMultibuyer.prop( "checked" ) == true
        ) {
            multibuyer = this.formObject[1].multibuyer;
    Severity: Major
    Found in view/frontend/web/js/core/models/TwoCreditcardsModel.js and 1 other location - About 2 days to fix
    view/frontend/web/js/core/models/TwoCreditcardsModel.js on lines 103..123

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

    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 Magento2PlatformOrderDecorator.php has 945 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace MundiPagg\MundiPagg\Concrete;
    
    use Magento\Customer\Model\ResourceModel\CustomerRepository;
    Severity: Major
    Found in Concrete/Magento2PlatformOrderDecorator.php - About 2 days to fix

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

      CreditCardModel.prototype.fillMultibuyerData = function(data) {
          multibuyer = this.formObject.multibuyer;
          fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val();
      
          data.additional_data.cc_buyer_checkbox = 1,
      Severity: Major
      Found in view/frontend/web/js/core/models/CreditCardModel.js and 2 other locations - About 2 days to fix
      view/frontend/web/js/core/models/DebitModel.js on lines 102..121
      view/frontend/web/js/core/models/VoucherModel.js on lines 112..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 370.

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

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

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

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

      Refactorings

      Further Reading

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

      VoucherModel.prototype.fillMultibuyerData = function(data) {
          multibuyer = this.formObject.multibuyer;
          fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val();
      
          data.additional_data.cc_buyer_checkbox = 1,
      Severity: Major
      Found in view/frontend/web/js/core/models/VoucherModel.js and 2 other locations - About 2 days to fix
      view/frontend/web/js/core/models/CreditCardModel.js on lines 102..121
      view/frontend/web/js/core/models/DebitModel.js on lines 102..121

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

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

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

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

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

      Refactorings

      Further Reading

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

      DebitModel.prototype.fillMultibuyerData = function(data) {
          multibuyer = this.formObject.multibuyer;
          fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val();
      
          data.additional_data.cc_buyer_checkbox = 1,
      Severity: Major
      Found in view/frontend/web/js/core/models/DebitModel.js and 2 other locations - About 2 days to fix
      view/frontend/web/js/core/models/CreditCardModel.js on lines 102..121
      view/frontend/web/js/core/models/VoucherModel.js on lines 112..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 370.

      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

      FormObject.pixInit = function (isMultibuyerEnabled) {
      
          this.FormObject = {};
      
          var containerSelector = '#mundipagg_pix-form';
      Severity: Major
      Found in view/frontend/web/js/core/checkout/PlatformFormBiding.js and 1 other location - About 2 days to fix
      view/frontend/web/js/core/checkout/PlatformFormBiding.js on lines 342..382

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

      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

      FormObject.boletoInit = function (isMultibuyerEnabled) {
      
          this.FormObject = {};
      
          var containerSelector = '#mundipagg_billet-form';
      Severity: Major
      Found in view/frontend/web/js/core/checkout/PlatformFormBiding.js and 1 other location - About 2 days to fix
      view/frontend/web/js/core/checkout/PlatformFormBiding.js on lines 300..340

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

      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 UpgradeData.php has 708 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      
      namespace MundiPagg\MundiPagg\Setup;
      
      
      Severity: Major
      Found in Setup/UpgradeData.php - About 1 day to fix

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

            protected function addInstallment($qty)
            {
                $installmentAmount = $this->getGrandTotal() / $qty;
                $interest = false;
                $interestLabel = __('without interest');
        Severity: Major
        Found in Model/Installments/Builder.php and 2 other locations - About 1 day to fix
        Model/Installments/BuilderByBrand.php on lines 91..122
        Model/Installments/BuilderByBrandAndAmount.php on lines 91..121

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

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

            protected function addInstallment($qty)
            {
        
                $installmentAmount = $this->getGrandTotal() / $qty;
                $interest = false;
        Severity: Major
        Found in Model/Installments/BuilderByBrand.php and 2 other locations - About 1 day to fix
        Model/Installments/Builder.php on lines 70..100
        Model/Installments/BuilderByBrandAndAmount.php on lines 91..121

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

        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