pagseguro/magento2

View on GitHub

Showing 261 of 385 total issues

Function __column_selector has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var __column_selector = function (settings, selector, opts) {
    var columns = settings.aoColumns,
      names = _pluck(columns, 'sName'),
      nodes = _pluck(columns, 'nTh');

Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

    Function Search has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          Search: function (url) {
            jQuery
              .ajax({
                url: url + '/pagseguro/transactions/request',
                data: {
    Severity: Major
    Found in view/adminhtml/web/js/public.js - About 2 hrs to fix

      Function validateCnpj has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function validateCnpj(self) {
        var cnpj = unmask(self.value);
        var numbersVal;
        var digits;
        var sum;
      Severity: Major
      Found in view/frontend/web/js/model/direct-payment-validator.js - About 2 hrs to fix

        Function getTransactionTypeName has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getTransactionTypeName($transactionTypeCode)
            {
                if ($transactionTypeCode) {
                    switch ($transactionTypeCode) {
                        case 1:
        Severity: Minor
        Found in Helper/Data.php - About 2 hrs 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 _fnDrawHead has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function _fnDrawHead(oSettings, aoSource, bIncludeHidden) {
            var i, iLen, j, jLen, k, kLen, n, nLocalTr;
            var aoLocal = [];
            var aApplied = [];
            var iColumns = oSettings.aoColumns.length;
        Severity: Major
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

          Function _fnFeatureHtmlFilter has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function _fnFeatureHtmlFilter(settings) {
              var classes = settings.oClasses;
              var tableId = settings.sTableId;
              var language = settings.oLanguage;
              var previousSearch = settings.oPreviousSearch;
          Severity: Major
          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

            Function _fnLoadState has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function _fnLoadState(settings, oInit) {
                var i, ien;
                var columns = settings.aoColumns;
            
                if (!settings.oFeatures.bStateSave) {
            Severity: Major
            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

              Function Search has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    Search: function (url) {
                      jQuery
                        .ajax({
                          url: url + '/pagseguro/refund/request',
                          data: {
              Severity: Major
              Found in view/adminhtml/web/js/public.js - About 2 hrs to fix

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

                  function _fnSortFlatten(settings) {
                    var i,
                      iLen,
                      k,
                      kLen,
                Severity: Major
                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

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

                    function _fnCreateTr(oSettings, iRow, nTrIn, anTds) {
                      var row = oSettings.aoData[iRow],
                        rowData = row._aData,
                        cells = [],
                        nTr,
                  Severity: Major
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

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

                        var run = function (s) {
                          var selInt = _intVal(s);
                    
                          // Selector - all
                          if (s === '') {
                    Severity: Major
                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                      Function setPagSeguroDiscountsByPaymentMethod has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function setPagSeguroDiscountsByPaymentMethod()
                          {
                              $storeId = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
                              if ($this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_credit_card', $storeId)=== 1) {
                                  $creditCard = (double)$this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_credit_card_value', $storeId);
                      Severity: Minor
                      Found in Model/PaymentMethod.php - About 2 hrs 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 _fnInitialise has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function _fnInitialise(settings) {
                          var i,
                            iLen,
                            iAjaxStart = settings.iInitDisplayStart;
                          var columns = settings.aoColumns,
                      Severity: Major
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

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

                            var run = function (s) {
                              var fnSelector = typeof s === 'function';
                        
                              if (s === null || s === undefined || fnSelector) {
                                // All cells and function selectors
                        Severity: Major
                        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                          Method setPagSeguroDiscountsByPaymentMethod has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function setPagSeguroDiscountsByPaymentMethod()
                              {
                                  $storeId = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
                                  if ($this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_credit_card', $storeId)=== 1) {
                                      $creditCard = (double)$this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_credit_card_value', $storeId);
                          Severity: Major
                          Found in Model/PaymentMethod.php - About 2 hrs to fix

                            Function init has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                (c.prototype.init = function(b, c, d) {
                                    if (
                                        ((this.enabled = !0),
                                            (this.type = b),
                                            (this.$element = a(c)),
                            Severity: Minor
                            Found in view/frontend/web/js/bootstrap.min.js - About 2 hrs to fix

                              Function getMasked has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    getMasked: function (a, b) {
                                      var m = [],
                                        h = void 0 === b ? c.val() : b + '',
                                        f = 0,
                                        l = e.length,
                              Severity: Minor
                              Found in view/frontend/web/js/jquery.mask.min.js - About 2 hrs to fix

                                Function jqueryui has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      jqueryui: function (settings, cell, column, classes) {
                                        $('<div/>')
                                          .addClass(classes.sSortJUIWrapper)
                                          .append(cell.contents())
                                          .append(
                                Severity: Minor
                                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                                  Method getTransactionTypeName has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function getTransactionTypeName($transactionTypeCode)
                                      {
                                          if ($transactionTypeCode) {
                                              switch ($transactionTypeCode) {
                                                  case 1:
                                  Severity: Minor
                                  Found in Helper/Data.php - About 1 hr to fix

                                    Function Search has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          Search: function (url) {
                                            jQuery
                                              .ajax({
                                                url: url + '/pagseguro/conciliation/request',
                                                data: {
                                    Severity: Minor
                                    Found in view/adminhtml/web/js/public.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language