pagseguro/magento2

View on GitHub

Showing 261 of 385 total issues

Consider simplifying this complex logical expression.
Open

                if (i.length) {
                    var j = i.index(c.target);
                    38 === c.which && j > 0 && j--,
                        40 === c.which && j < i.length - 1 && j++, ~j || (j = 0),
                        i.eq(j).trigger('focus');
Severity: Major
Found in view/frontend/web/js/bootstrap.min.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if (
            (b[0] < 2 && b[1] < 9) ||
            (1 === b[0] && 9 === b[1] && b[2] < 1) ||
            b[0] > 3
        )
    Severity: Major
    Found in view/frontend/web/js/bootstrap.min.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if (
                          (j[f] === a && k[m].match(/[0-9]/)) ||
                          (j[f] === b && k[m].match(/[a-zA-Z]/)) ||
                          (j[f] === c && k[m].match(/[0-9a-zA-Z]/))
                      )
      Severity: Major
      Found in view/frontend/web/js/vanillamasker.min.js - About 40 mins to fix

        Function __columnData has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          var __columnData = function (settings, column, r1, r2, rows) {
        Severity: Minor
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix

          Function number has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              number: function (thousands, decimal, precision, prefix, postfix) {
          Severity: Minor
          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix

            Function fnUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                this.fnUpdate = function (mData, mRow, iColumn, bRedraw, bAction) {
            Severity: Minor
            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix

              Function _selector_run has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                var _selector_run = function (type, selector, selectFn, settings, opts) {
              Severity: Minor
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix

                Function Payment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        Payment: function (url, id, hash, document, bank) {
                Severity: Minor
                Found in view/frontend/web/js/public.js - About 35 mins to fix

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

                          \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                          \Magento\Framework\Module\ModuleList $moduleList,
                          \Magento\Sales\Model\Order $order,
                          \UOL\PagSeguro\Helper\Library $library,
                          $data = array()
                  Severity: Minor
                  Found in Model/Direct/InstallmentsMethod.php - About 35 mins to fix

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

                            \Magento\Framework\ObjectManagerInterface $objectManager,
                            \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                            \Magento\Framework\Model\ResourceModel\Db\Context $context,
                            \UOL\PagSeguro\Model\OrdersFactory $ordersFactory,
                            \UOL\PagSeguro\Model\System\Config\Environment $environmentConfig
                    Severity: Minor
                    Found in Observer/CreatePagSeguroOrder.php - About 35 mins to fix

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

                              \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                              \Magento\Sales\Api\OrderRepositoryInterface $order,
                              \Magento\Sales\Api\Data\OrderStatusHistoryInterface $history,
                              \Magento\Framework\Module\ModuleList $moduleList,
                              \Magento\Framework\Model\ResourceModel\Db\Context $context
                      Severity: Minor
                      Found in Model/NotificationMethod.php - About 35 mins to fix

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

                                \Magento\Framework\View\Element\Template\Context $context,
                                \Magento\Checkout\Model\Session $checkoutSession,
                                \Magento\Sales\Model\Order\Config $orderConfig,
                                \Magento\Framework\App\Http\Context $httpContext,
                                array $data = []
                        Severity: Minor
                        Found in Block/Payment/Checkout.php - About 35 mins to fix

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

                          function validateDocument(self) {
                            var value = unmask(self.value);
                            if (value.length === 11) {
                              status = validateCpf(self);
                            } else if (value.length === 14) {
                          Severity: Minor
                          Found in view/frontend/web/js/model/direct-payment-validator.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 assignData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function assignData(\Magento\Framework\DataObject $data)
                              {
                                  parent::assignData($data);
                          
                                  $info = $this->getInfoInstance();
                          Severity: Minor
                          Found in Model/PaymentCreditCard.php - 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 request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function request()
                              {
                                  $this->getTransactions();
                                  if (! is_null($this->_PagSeguroPaymentList->getTransactions())) {
                                      foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
                          Severity: Minor
                          Found in Model/Transactions/Methods/Cancellation.php - 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 request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function request()
                              {
                                  $this->getTransactions();
                                  if (! is_null($this->_PagSeguroPaymentList->getTransactions())) {
                          
                          
                          Severity: Minor
                          Found in Model/Transactions/Methods/Conciliation.php - 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

                          Avoid too many return statements within this function.
                          Open

                                return $(nodes)
                                  .filter(sel)
                                  .map(function () {
                                    return this._DT_RowIndex;
                                  })
                          Severity: Major
                          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return host.length ? [host.data('dt-column')] : [];
                            Severity: Major
                            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                        return [sel._DT_CellIndex.row];
                              Severity: Major
                              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return jqResult;
                                Severity: Major
                                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language