pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

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

    placeOrder: function () {
      var self = this;
      var paymentData = quote.paymentMethod();
      var messageContainer = this.messageContainer;
      fullScreenLoader.startLoader();

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

      function _fnBrowserDetect(settings) {
        // We don't need to do this every time DataTables is constructed, the values
        // calculated are specific to the browser and OS configuration which we
        // don't expect to change between initialisations
        if (!DataTable.__browser) {
    Severity: Minor
    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

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

      function validateCpf(self) {
        var cpf = unmask(self.value);
        var numeros, digitos, soma, i, resultado, digitos_iguais;
        digitos_iguais = 1;
        if (cpf.length < 11) {
      Severity: Minor
      Found in view/frontend/web/js/model/direct-payment-validator.js - About 1 hr to fix

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

            var run = function (sel) {
              var selInt = _intVal(sel);
              var i, ien;
        
              // Short cut - selector is a number and no options provided (default is
        Severity: Minor
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

          Function show has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              (c.prototype.show = function(b) {
                  var d = this,
                      e = a.Event('show.bs.modal', { relatedTarget: b });
                  this.$element.trigger(e),
                      this.isShown ||
          Severity: Minor
          Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

            Function show has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                (d.prototype.show = function() {
                    if (!this.transitioning && !this.$element.hasClass('in')) {
                        var b,
                            e =
                            this.$parent &&
            Severity: Minor
            Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

              Function Transport has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    Transport: function (url) {
                      var t = jQuery('#pagseguro-datatable').DataTable();
                      var rows = jQuery('#pagseguro-datatable').find(
                        '[data-target=abandoned]:checked'
                      );
              Severity: Minor
              Found in view/adminhtml/web/js/public.js - About 1 hr to fix

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

                              if (
                                result.creditorFees.intermediationRateAmount !== undefined &&
                                result.creditorFees.intermediationRateAmount !== false
                              ) {
                                listData.append(
                Severity: Major
                Found in view/adminhtml/web/js/public.js and 4 other locations - About 1 hr to fix
                view/adminhtml/web/js/public.js on lines 836..845
                view/adminhtml/web/js/public.js on lines 847..856
                view/adminhtml/web/js/public.js on lines 869..878
                view/adminhtml/web/js/public.js on lines 880..889

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

                              if (
                                result.creditorFees.intermediationFeeAmount !== undefined &&
                                result.creditorFees.intermediationFeeAmount !== false
                              ) {
                                listData.append(
                Severity: Major
                Found in view/adminhtml/web/js/public.js and 4 other locations - About 1 hr to fix
                view/adminhtml/web/js/public.js on lines 836..845
                view/adminhtml/web/js/public.js on lines 847..856
                view/adminhtml/web/js/public.js on lines 858..867
                view/adminhtml/web/js/public.js on lines 880..889

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

                              if (
                                result.creditorFees.comissionFeeAmount !== undefined &&
                                result.creditorFees.comissionFeeAmount !== false
                              ) {
                                listData.append(
                Severity: Major
                Found in view/adminhtml/web/js/public.js and 4 other locations - About 1 hr to fix
                view/adminhtml/web/js/public.js on lines 836..845
                view/adminhtml/web/js/public.js on lines 847..856
                view/adminhtml/web/js/public.js on lines 858..867
                view/adminhtml/web/js/public.js on lines 869..878

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

                              if (
                                result.creditorFees.installmentFeeAmount !== undefined &&
                                result.creditorFees.installmentFeeAmount !== false
                              ) {
                                listData.append(
                Severity: Major
                Found in view/adminhtml/web/js/public.js and 4 other locations - About 1 hr to fix
                view/adminhtml/web/js/public.js on lines 847..856
                view/adminhtml/web/js/public.js on lines 858..867
                view/adminhtml/web/js/public.js on lines 869..878
                view/adminhtml/web/js/public.js on lines 880..889

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

                              if (
                                result.creditorFees.operationalFeeAmount !== undefined &&
                                result.creditorFees.operationalFeeAmount !== false
                              ) {
                                listData.append(
                Severity: Major
                Found in view/adminhtml/web/js/public.js and 4 other locations - About 1 hr to fix
                view/adminhtml/web/js/public.js on lines 836..845
                view/adminhtml/web/js/public.js on lines 858..867
                view/adminhtml/web/js/public.js on lines 869..878
                view/adminhtml/web/js/public.js on lines 880..889

                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

                Function Conciliate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      Conciliate: function (url) {
                        var t = jQuery('#pagseguro-datatable').DataTable();
                        var rows = jQuery('#pagseguro-datatable').find(
                          '[data-target=conciliation]:checked'
                        );
                Severity: Minor
                Found in view/adminhtml/web/js/public.js - About 1 hr to fix

                  Function _fnFilterComplete has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function _fnFilterComplete(oSettings, oInput, iForce) {
                      var oPrevSearch = oSettings.oPreviousSearch;
                      var aoPrevSearch = oSettings.aoPreSearchCols;
                      var fnSaveFilter = function (oFilter) {
                        /* Save the filtering values */
                  Severity: Minor
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                    Function placeOrder has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        placeOrder: function () {
                          var self = this;
                          var paymentData = quote.paymentMethod();
                          var messageContainer = this.messageContainer;
                          PagSeguroDirectPayment.setSessionId(
                    Severity: Minor
                    Found in view/frontend/web/js/view/payment/method-renderer/boleto-method.js - About 1 hr to fix

                      Function _fnInvalidate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function _fnInvalidate(settings, rowIdx, src, colIdx) {
                          var row = settings.aoData[rowIdx];
                          var i, ien;
                          var cellWrite = function (cell, col) {
                            // This is very frustrating, but in IE if you just write directly
                      Severity: Minor
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

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

                                \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                                \Magento\Framework\App\ResourceConnection $resourceConnection,
                                \Magento\Framework\Model\ResourceModel\Db\Context $context,
                                \Magento\Backend\Model\Session $session,
                                \Magento\Sales\Model\Order $order,
                        Severity: Major
                        Found in Model/Transactions/Methods/Transactions.php - About 1 hr to fix

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

                                  jQuery
                                    .ajax({
                                      url: url + '/pagseguro/cancellation/request',
                                      data: {
                                        form_key: window.FORM_KEY,
                          Severity: Major
                          Found in view/adminhtml/web/js/public.js and 3 other locations - About 1 hr to fix
                          view/adminhtml/web/js/public.js on lines 27..82
                          view/adminhtml/web/js/public.js on lines 141..195
                          view/adminhtml/web/js/public.js on lines 347..409

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  jQuery
                                    .ajax({
                                      url: url + '/pagseguro/refund/request',
                                      data: {
                                        form_key: window.FORM_KEY,
                          Severity: Major
                          Found in view/adminhtml/web/js/public.js and 3 other locations - About 1 hr to fix
                          view/adminhtml/web/js/public.js on lines 27..82
                          view/adminhtml/web/js/public.js on lines 141..195
                          view/adminhtml/web/js/public.js on lines 255..306

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  jQuery
                                    .ajax({
                                      url: url + '/pagseguro/abandoned/request',
                                      data: {
                                        form_key: window.FORM_KEY,
                          Severity: Major
                          Found in view/adminhtml/web/js/public.js and 3 other locations - About 1 hr to fix
                          view/adminhtml/web/js/public.js on lines 27..82
                          view/adminhtml/web/js/public.js on lines 255..306
                          view/adminhtml/web/js/public.js on lines 347..409

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

                          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