mundipagg/magento2

View on GitHub
view/frontend/web/js/core/checkout/PaymentMethodController.js

Summary

Maintainability
F
6 days
Test Coverage

File PaymentMethodController.js has 606 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var PaymentMethodController = function (methodCode, platformConfig) {
    this.methodCode = methodCode;
    this.platformConfig = platformConfig;
};

Severity: Major
Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 day to fix

    Function boletoCreditcardInit has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    PaymentMethodController.prototype.boletoCreditcardInit = function () {
        this.platformConfig = PlatformConfig.bind(this.platformConfig);
        this.formObject = FormObject.boletoCreditCardInit(this.platformConfig.isMultibuyerEnabled);
    
        if (!this.formObject) {
    Severity: Minor
    Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function twocreditcardsInit has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    PaymentMethodController.prototype.twocreditcardsInit = function () {
        this.platformConfig = PlatformConfig.bind(this.platformConfig);
        this.formObject = FormObject.twoCreditCardsInit(this.platformConfig.isMultibuyerEnabled);
    
        if (!this.formObject) {
    Severity: Minor
    Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function addSavedCreditCardsListener has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    PaymentMethodController.prototype.addSavedCreditCardsListener = function(formObject) {
    
        var paymentMethodController = this;
        var selector = formObject.savedCreditCardSelect.selector;
        var brand = jQuery(selector + ' option:selected').attr('brand');
    Severity: Minor
    Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 hr to fix

      Function addInputAmountBalanceListener has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      PaymentMethodController.prototype.addInputAmountBalanceListener = function(formObject, id) {
          var paymentMethodController = this;
          var id = id;
      
          formObject.inputAmount.on('change', function () {
      Severity: Minor
      Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 hr to fix

        Function boletoCreditcardInit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        PaymentMethodController.prototype.boletoCreditcardInit = function () {
            this.platformConfig = PlatformConfig.bind(this.platformConfig);
            this.formObject = FormObject.boletoCreditCardInit(this.platformConfig.isMultibuyerEnabled);
        
            if (!this.formObject) {
        Severity: Minor
        Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 hr to fix

          Function twocreditcardsInit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          PaymentMethodController.prototype.twocreditcardsInit = function () {
              this.platformConfig = PlatformConfig.bind(this.platformConfig);
              this.formObject = FormObject.twoCreditCardsInit(this.platformConfig.isMultibuyerEnabled);
          
              if (!this.formObject) {
          Severity: Minor
          Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 hr to fix

            Function fillInstallments has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            PaymentMethodController.prototype.fillInstallments = function (form) {
                var _self = this;
            
                if (form.creditCardBrand == undefined) {
                    return;
            Severity: Minor
            Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 1 hr to fix

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

              PaymentMethodController.prototype.sumInterests = function(interest, selectName) {
                  var interest = interest;
                  var paymentMethodController = this;
              
                  var formObject = paymentMethodController.formObject;
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 35 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function updateTotal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              PaymentMethodController.prototype.updateTotal = function(interest, grandTotal, selectName) {
                  var paymentMethodController = this;
              
                  /**@fixme Move gettotals() to PlatformFormBiding */
                  var total = paymentMethodController.platformConfig.updateTotals.getTotals()();
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js - About 25 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

              PaymentMethodController.prototype.boletoInit = function () {
                  this.platformConfig = PlatformConfig.bind(this.platformConfig);
                  this.formObject = FormObject.boletoInit(this.platformConfig.isMultibuyerEnabled);
              
                  if (!this.formObject) {
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 166..185

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

              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

              PaymentMethodController.prototype.pixInit = function () {
                  this.platformConfig = PlatformConfig.bind(this.platformConfig);
                  this.formObject = FormObject.pixInit(this.platformConfig.isMultibuyerEnabled);
              
                  if (!this.formObject) {
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 187..206

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

              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

              PaymentMethodController.prototype.limitCharacters = function (element, limit) {
                  var val = element.val();
              
                  if(val != "" && val.length > limit) {
                      element.val(val.substring(0, limit));
              view/adminhtml/web/js/core/checkout/Listeners.js on lines 140..146

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

              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

              PaymentMethodController.prototype.clearLetters = function (element) {
                  var val = element.val();
                  var newVal = val.replace(/[^0-9]+/g, '');
                  element.val(newVal);
              };
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 716..720

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 62.

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

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

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

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

              Refactorings

              Further Reading

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

              PaymentMethodController.prototype.clearNumbers = function (element) {
                  var val = element.val();
                  var newVal = val.replace(/[0-9.-]+/g, '');
                  element.val(newVal);
              };
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 710..714

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 62.

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

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

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

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

              Refactorings

              Further Reading

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

                      if (
                          typeof formObject.multibuyer != 'undefined' &&
                          typeof formObject.multibuyer.showMultibuyer != 'undefined'
                      ) {
                          formObject.multibuyer.showMultibuyer.parent().hide();
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 494..499

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

              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 formObject.multibuyer != 'undefined' &&
                              typeof formObject.multibuyer.showMultibuyer != 'undefined'
                          ) {
                              formObject.multibuyer.showMultibuyer.parent().show();
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 506..511

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

              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

              PaymentMethodController.prototype.addCreditCardHolderNameListener = function(formObject) {
                  var paymentMethodController = this;
                  formObject.creditCardHolderName.on('keyup', function () {
                      var element = jQuery(this);
                      paymentMethodController.clearNumbers(element);
              view/adminhtml/web/js/core/checkout/Listeners.js on lines 56..62

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

              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

                          if (this.formObject[i].inputAmount.val() === "" || !isTotalOnAmountInputs) {
                              this.fillCardAmount(this.formObject[i], 2, i);
                          }
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 139..141

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

              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

                          if (this.formObject[i].inputAmount.val() === "" || !isTotalOnAmountInputs) {
                              this.fillCardAmount(this.formObject[i], 2, i);
                          }
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 229..231

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

              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

                          if (this.platformConfig.isMultibuyerEnabled) {
                              this.fillMultibuyerStateSelect(this.formObject[i]);
                              this.addShowMultibuyerListener(this.formObject[i]);
                          }
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 55 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 237..240

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

              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

                          if (this.platformConfig.isMultibuyerEnabled) {
                              this.fillMultibuyerStateSelect(this.formObject[i]);
                              this.addShowMultibuyerListener(this.formObject[i]);
                          }
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 55 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 151..154

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

              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

              PaymentMethodController.prototype.hideCardAmount = function (formObject) {
                  formHandler = new FormHandler();
                  formHandler.init(formObject);
                  formHandler.hideInputAmount(formObject);
              };
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 55 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 777..781

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

              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

              PaymentMethodController.prototype.removeSavedCardsSelect = function (formObject) {
                  var formHandler = new FormHandler();
                  formHandler.init(formObject);
                  formHandler.removeSavedCardsSelect(formObject);
              }
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 55 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 592..596

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

              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

              PaymentMethodController.prototype.removeMultibuyerForm = function (formObject) {
                  formHandler = new FormHandler();
                  formHandler.init(formObject);
                  formHandler.removeMultibuyerForm(formObject);
              };
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 55 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 722..726

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

              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

              PaymentMethodController.prototype.removeInstallmentsSelect = function (formObject) {
                  var formHandler = new FormHandler();
                  formHandler.init(formObject);
                  formHandler.removeInstallmentsSelect(formObject);
              }
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 55 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 208..212

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

              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 (paymentMethod.methodCode === "boletoCreditcard") {
                      var boletoCreditCardTotalObject = paymentMethod.boletoCreditCardTotal(paymentMethod);
              
                      grandTotal = boletoCreditCardTotalObject.sumTotal;
                      interest = boletoCreditCardTotalObject.sumInterestTotal;
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 50 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 440..445

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

              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 (paymentMethod.methodCode === "twocreditcards") {
                      var twoCardsTotalObject = paymentMethod.twoCardsTotal(paymentMethod);
              
                      grandTotal = twoCardsTotalObject.sumTotal;
                      interest = twoCardsTotalObject.sumInterestTotal;
              Severity: Minor
              Found in view/frontend/web/js/core/checkout/PaymentMethodController.js and 1 other location - About 50 mins to fix
              view/frontend/web/js/core/checkout/PaymentMethodController.js on lines 447..452

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

              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