pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

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

        $.extend({}, settings.oPreviousSearch, {
          sSearch: input + '',
          bRegex: regex === null ? false : regex,
          bSmart: smart === null ? true : smart,
          bCaseInsensitive: caseInsen === null ? true : caseInsen,
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
view/adminhtml/web/js/jquery.dataTables.min.js on lines 8726..8731

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

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

  _api_register('ajax.params()', function () {
    var ctx = this.context;

    if (ctx.length > 0) {
      return ctx[0].oAjaxData;
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
view/adminhtml/web/js/jquery.dataTables.min.js on lines 7246..7254

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

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

      _fnApplyToChildren(function (nSizer, i) {
        nSizer.innerHTML =
          '<div class="dataTables_sizing" style="height:0;overflow:hidden;">' +
          footerContent[i] +
          '</div>';
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
view/adminhtml/web/js/jquery.dataTables.min.js on lines 5113..5119

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

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

  _api_register('ajax.json()', function () {
    var ctx = this.context;

    if (ctx.length > 0) {
      return ctx[0].json;
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
view/adminhtml/web/js/jquery.dataTables.min.js on lines 7259..7267

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

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

    _fnApplyToChildren(function (nSizer, i) {
      nSizer.innerHTML =
        '<div class="dataTables_sizing" style="height:0;overflow:hidden;">' +
        headerContent[i] +
        '</div>';
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
view/adminhtml/web/js/jquery.dataTables.min.js on lines 5122..5128

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

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 _ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      _: function (settings, cell, column, classes) {
        // No additional mark-up required
        // Attach a sort listener to update on sort - note that using the
        // `DT` namespace will allow the event to be removed automatically
        // on destroy, while the `dt` namespaced event is the one we are
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

    Function _fnLog has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function _fnLog(settings, level, msg, tn) {
        msg =
          'DataTables warning: ' +
          (settings ? 'table id=' + settings.sTableId + ' - ' : '') +
          msg;
    Severity: Minor
    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

      Function Cancel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            Cancel: function (url, data, row) {
              var t = jQuery('#pagseguro-datatable').DataTable();
      
              jQuery
                .ajax({
      Severity: Minor
      Found in view/adminhtml/web/js/public.js - About 1 hr to fix

        Method updateOrderStatus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function updateOrderStatus()
            {
                $this->_library->setEnvironment();
                $this->_library->setCharset();
                $this->_library->setLog();
        Severity: Minor
        Found in Model/NotificationMethod.php - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

            if (
              event.keyCode === 8 ||
              event.keyCode === 9 ||
              event.keyCode === 46 ||
              event.keyCode < 48 ||
          Severity: Major
          Found in view/frontend/web/js/model/direct-payment-validator.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  e === 8 ||
                  e === 9 ||
                  e === 46 ||
                  (e > 47 && e < 58) ||
            Severity: Major
            Found in view/frontend/web/js/model/direct-payment-validator.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if (this.hasContent() && this.enabled) {
                          this.$element.trigger(b);
                          var d = a.contains(
                              this.$element[0].ownerDocument.documentElement,
                              this.$element[0]
              Severity: Major
              Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

                Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        \Magento\Framework\Model\Context $context,
                        \Magento\Framework\Registry $registry,
                        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
                        \Magento\Framework\Api\AttributeValueFactory $attributeFactory,
                        \Magento\Payment\Helper\Data $paymentData,
                Severity: Major
                Found in Model/PaymentBoleto.php - About 1 hr to fix

                  Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          \Magento\Framework\Model\Context $context,
                          \Magento\Framework\Registry $registry,
                          \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
                          \Magento\Framework\Api\AttributeValueFactory $attributeFactory,
                          \Magento\Payment\Helper\Data $paymentData,
                  Severity: Major
                  Found in Model/PaymentCreditCard.php - About 1 hr to fix

                    Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            \Magento\Framework\Model\Context $context,
                            \Magento\Framework\Registry $registry,
                            \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
                            \Magento\Framework\Api\AttributeValueFactory $attributeFactory,
                            \Magento\Payment\Helper\Data $paymentData,
                    Severity: Major
                    Found in Model/PaymentDefaultlLightbox.php - About 1 hr to fix

                      Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              \Magento\Framework\Model\Context $context,
                              \Magento\Framework\Registry $registry,
                              \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
                              \Magento\Framework\Api\AttributeValueFactory $attributeFactory,
                              \Magento\Payment\Helper\Data $paymentData,
                      Severity: Major
                      Found in Model/PaymentOnlineDebit.php - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                        if (!isset($paymentData['additional_information']['credit_card_document'])
                                            || ! isset($paymentData['additional_information']['hash'])
                                            || ! isset($paymentData['additional_information']['credit_card_token'])
                                            || ! isset($paymentData['additional_information']['credit_card_holder_name'])
                                            || ! isset($paymentData['additional_information']['credit_card_holder_birthdate'])
                        Severity: Major
                        Found in Controller/Payment/Request.php - About 1 hr to fix

                          Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  \Magento\Framework\Model\Context $context,
                                  \Magento\Framework\Registry $registry,
                                  \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
                                  \Magento\Framework\Api\AttributeValueFactory $attributeFactory,
                                  \Magento\Payment\Helper\Data $paymentData,
                          Severity: Major
                          Found in Model/Payment.php - About 1 hr to fix

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

                                _fnApplyToChildren(function (nSizer) {
                                  headerContent.push(nSizer.innerHTML);
                                  headerWidths.push(_fnStringToCss($(nSizer).css('width')));
                                }, headerSrcEls);
                            Severity: Major
                            Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
                            view/adminhtml/web/js/jquery.dataTables.min.js on lines 5093..5096

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

                            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

                                  _fnApplyToChildren(function (nSizer) {
                                    footerContent.push(nSizer.innerHTML);
                                    footerWidths.push(_fnStringToCss($(nSizer).css('width')));
                                  }, footerSrcEls);
                            Severity: Major
                            Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
                            view/adminhtml/web/js/jquery.dataTables.min.js on lines 5073..5076

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

                            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