pagseguro/magento2

View on GitHub

Showing 261 of 385 total issues

Avoid deeply nested control flow statements.
Open

            for (k = 0; k < iRowspan; k++) {
              aLayout[i + k][iColShifted + l] = {
                cell: nCell,
                unique: bUnique,
              };
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (cellData === null) {
                  cellData = '';
                }
    Severity: Major
    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (detectedType === 'html') {
                    break;
                  }
      Severity: Major
      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  if (cOption === aoFeatures[k].cFeature) {
                    featureNode = aoFeatures[k].fnInit(oSettings);
                    break;
                  }
        Severity: Major
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (typeof cellData !== 'string' && cellData.toString) {
                        cellData = cellData.toString();
                      }
          Severity: Major
          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if (type === 'column-rows') {
                        rows = _selector_row_indexes(context[i], selector.opts);
                      }
            Severity: Major
            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

              Function _fnReduce has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                function _fnReduce(that, fn, init, start, end, inc) {
              Severity: Minor
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                Function _fnFilter has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  function _fnFilter(settings, input, force, regex, smart, caseInsensitive) {
                Severity: Minor
                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              while (columns.length <= aTargets[j]) {
                                _fnAddColumn(oSettings);
                              }
                  Severity: Major
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                for (k = 0; k < iRowspan; k++) {
                                  aApplied[i + k][j + iColspan] = 1;
                                }
                    Severity: Major
                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if (fomatters[column.sType]) {
                                    cellData = fomatters[column.sType](cellData);
                                  }
                      Severity: Major
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                        Function setShippingInformation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function setShippingInformation()
                            {
                                if ($this->_checkoutSession->getLastRealOrder()->getIsVirtual()) {
                                    $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('false');
                                } else {
                        Severity: Minor
                        Found in Model/PaymentMethod.php - About 45 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

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

                                \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
                                \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                                \Magento\Framework\Module\ModuleList $moduleList,
                                \Magento\Sales\Model\Order $order,
                                \UOL\PagSeguro\Helper\Library $library,
                        Severity: Minor
                        Found in Model/Direct/DebitMethod.php - About 45 mins to fix

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

                                  \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
                                  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                                  \Magento\Framework\Module\ModuleList $moduleList,
                                  \Magento\Sales\Model\Order $order,
                                  \UOL\PagSeguro\Helper\Library $library,
                          Severity: Minor
                          Found in Model/Direct/BoletoMethod.php - About 45 mins to fix

                            Function getTitleTypePaymentMethod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function getTitleTypePaymentMethod($type)
                                {
                                    if (!is_null($type)) {
                                        switch ($type) {
                                            case 1:
                            Severity: Minor
                            Found in Helper/Data.php - About 45 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 searchTransactions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function searchTransactions()
                                {
                                    try {
                                        $connection = $this->getConnection();
                                        $select = $connection->select()
                            Severity: Minor
                            Found in Model/Transactions/Method.php - About 45 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

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

                                    \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
                                    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                                    \Magento\Framework\Module\ModuleList $moduleList,
                                    \Magento\Sales\Model\Order $order,
                                    \UOL\PagSeguro\Helper\Library $library,
                            Severity: Minor
                            Found in Model/Direct/CreditCardMethod.php - About 45 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      if (
                                        nCell.nodeName.toUpperCase() === 'TD' ||
                                        nCell.nodeName.toUpperCase() === 'TH'
                                      ) {
                                        /* Get the col and rowspan attributes from the DOM and sanitise them */
                              Severity: Major
                              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                  if (
                                    isNaN(year) ||
                                    (month === 2 &&
                                      (day < 01 || day > 29 || (day > 28 && parseInt((year / 4),10) !== year / 4)))
                                  ) {
                                Severity: Major
                                Found in view/adminhtml/web/js/public.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                    if (Digitato !== 8) {
                                      // backspace
                                      for (i = 0; i <= TamanhoMascara; i++) {
                                        boleanoMascara =
                                          Mascara.charAt(i) === '-' ||
                                  Severity: Major
                                  Found in view/frontend/web/js/model/direct-payment-validator.js - About 40 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language