pagseguro/magento2

View on GitHub

Showing 261 of 385 total issues

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/PaymentDefaultlLightbox.php - About 1 hr to fix

      Function formataCampo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function formataCampo(campo, Mascara, evento) {
        var boleanoMascara;
      
        var Digitato = evento.keyCode;
        var exp = /\-|\.|\/|\(|\)| /g;
      Severity: Minor
      Found in view/frontend/web/js/model/direct-payment-validator.js - About 55 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 sortData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          private static function sortData($text)
          {
              if (preg_match('/[-,\\n]/', $text)) {
                  $broken = preg_split('/[-,\\n]/', $text);
                  for ($i = 0; $i < strlen($broken[0]); $i++) {
      Severity: Minor
      Found in Helper/Data.php - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
              \Magento\Framework\Model\ResourceModel\Db\Context $context,
              \Magento\Backend\Model\Session $session,
              \Magento\Sales\Model\Order $order,
              \UOL\PagSeguro\Helper\Library $library,
      Severity: Major
      Found in Model/Transactions/Methods/Cancellation.php - About 50 mins to fix

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

                \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                \Magento\Framework\Model\ResourceModel\Db\Context $context,
                \Magento\Backend\Model\Session $session,
                \Magento\Sales\Model\Order $order,
                \UOL\PagSeguro\Helper\Library $library,
        Severity: Major
        Found in Model/Transactions/Methods/Refund.php - About 50 mins to fix

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

                  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                  \Magento\Framework\Model\ResourceModel\Db\Context $context,
                  \Magento\Backend\Model\Session $session,
                  \Magento\Sales\Model\Order $order,
                  \UOL\PagSeguro\Helper\Library $library,
          Severity: Major
          Found in Model/Transactions/Methods/Conciliation.php - About 50 mins to fix

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

                    \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
                    \Psr\Log\LoggerInterface $logger,
                    \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
                    \Magento\Framework\Event\ManagerInterface $eventManager,
                    \Magento\Store\Model\StoreManagerInterface $storeManager,
            Severity: Major
            Found in Model/ResourceModel/Orders/Collection.php - About 50 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if (cache[k] === undefined) {
                            cache[k] = _fnGetCellData(settings, k, i, 'type');
                          }
              Severity: Major
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          } else if (typeof aTargets[j] === 'number' && aTargets[j] < 0) {
                            /* Negative integer, right to left column counting */
                            fn(columns.length + aTargets[j], def);
                          } else if (typeof aTargets[j] === 'string') {
                            /* Class name matching on TH element */
                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 (j = 0, jen = items.length; j < jen; j++) {
                              item = items[j];
                  
                              if (type === 'cell') {
                                ret = fn.call(apiInst, context[i], item.row, item.column, i, j);
                  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 (var j = 0, jLen = val.length; j < jLen; j++) {
                                    o = {};
                                    setData(o, val[j], innerSrc);
                                    data[a[i]].push(o);
                                  }
                    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 && j !== types.length - 1) {
                                    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 (
                                    (tmp === -1 && search === 'removed') ||
                                    (tmp >= 0 && search === 'applied')
                                  ) {
                                    a.push(i);
                        Severity: Major
                        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

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

                              settings,
                              searchStr,
                              colIdx,
                              regex,
                              smart,
                          Severity: Minor
                          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

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

                                  _: function (settings, host, idx, buttons, page, pages) {
                            Severity: Minor
                            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if (
                                              s(
                                                o,
                                                _fnGetCellData(settings, row, j),
                                                host.anCells ? host.anCells[j] : null
                              Severity: Major
                              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

                                      sInput,
                                      iColumn,
                                      bRegex,
                                      bSmart,
                                      bShowGlobal,
                                Severity: Minor
                                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                              if (data === null || data[a[i]] === undefined) {
                                                return undefined;
                                              }
                                  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 (arrayNotation) {
                                                  // Array notation
                                                  a[i] = a[i].replace(__reArray, '');
                                    
                                                  // Condition allows simply [] to be passed in
                                    Severity: Major
                                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language