pagseguro/magento2

View on GitHub

Showing 261 of 385 total issues

Function _fnColumnTypes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function _fnColumnTypes(settings) {
    var columns = settings.aoColumns;
    var data = settings.aoData;
    var types = DataTable.ext.type.detect;
    var i, ien, j, jen, k, ken;
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

    Method uninstall has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context)
        {
            $statuses = [
                'pagseguro_iniciado',
                'pagseguro_aguardando_pagamento',
    Severity: Minor
    Found in Setup/Uninstall.php - About 1 hr to fix

      Method searchTransactions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function searchTransactions()
          {
              try {
                  $connection = $this->getConnection();
                  $select = $connection->select()
      Severity: Minor
      Found in Model/Transactions/Method.php - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if (
              ie67 ||
              (!userInputs &&
                !scrollX &&
                !scrollY &&
        Severity: Critical
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

          Function activate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              (c.prototype.activate = function(b, d, e) {
                  function f() {
                      g
                          .removeClass('active')
                          .find('> .dropdown-menu > .active')
          Severity: Minor
          Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

            Function dateVerify has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function dateVerify(fieldName) {
              day = fieldName.value.substring(0, 2);
              month = fieldName.value.substring(3, 5);
              year = fieldName.value.substring(6, 10);
            
            
            Severity: Minor
            Found in view/adminhtml/web/js/public.js - About 1 hr 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 Payment has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                      url,
                      id,
                      hash,
                      document,
                      token,
            Severity: Major
            Found in view/frontend/web/js/public.js - About 1 hr to fix

              Function request has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function request()
                  {
                      $this->getTransactions();
                      if (! is_null($this->_PagSeguroPaymentList->getTransactions())) {
                          $partiallyRefundedOrdersArray = $this->getPartiallyRefundedOrders();
              Severity: Minor
              Found in Model/Transactions/Methods/Refund.php - About 1 hr 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 placeOrder has 31 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 formataCampo has 31 lines of code (exceeds 25 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 1 hr to fix

                  Method setShippingInformation has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function setShippingInformation()
                      {
                          $shipping = $this->_order->getShippingAddress();
                          if ($shipping) {
                              if (count($shipping->getStreet()) === 4) {
                  Severity: Minor
                  Found in Model/Direct/CreditCardMethod.php - About 1 hr to fix

                    Method setShippingInformation has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function setShippingInformation()
                        {
                            $shipping = $this->_order->getShippingAddress();
                            if ($shipping) {
                                if (count($shipping->getStreet()) === 4) {
                    Severity: Minor
                    Found in Model/Direct/BoletoMethod.php - About 1 hr to fix

                      Method setShippingInformation has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function setShippingInformation()
                          {
                              $shipping = $this->_order->getShippingAddress();
                              if ($shipping) {
                                  if (count($shipping->getStreet()) === 4) {
                      Severity: Minor
                      Found in Model/Direct/DebitMethod.php - About 1 hr to fix

                        Function __setColumnVis has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          var __setColumnVis = function (settings, column, vis) {
                            var cols = settings.aoColumns,
                              col = cols[column],
                              data = settings.aoData,
                              row,
                        Severity: Minor
                        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                          Function applyPlacement has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              (c.prototype.applyPlacement = function(b, c) {
                                  var d = this.tip(),
                                      e = d[0].offsetWidth,
                                      f = d[0].offsetHeight,
                                      g = parseInt(d.css('margin-top'), 10),
                          Severity: Minor
                          Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

                            Function dateVerify has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function dateVerify(fieldName) {
                              day = fieldName.value.substring(0, 2);
                              month = fieldName.value.substring(3, 5);
                              year = fieldName.value.substring(6, 10);
                            
                            
                            Severity: Minor
                            Found in view/adminhtml/web/js/public.js - About 1 hr to fix

                              Function _fnSortAria has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function _fnSortAria(settings) {
                                  var label;
                                  var nextSort;
                                  var columns = settings.aoColumns;
                                  var aSort = _fnSortFlatten(settings);
                              Severity: Minor
                              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

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

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

                                  Function _fnUpdateInfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function _fnUpdateInfo(settings) {
                                      /* Show information about the table */
                                      var nodes = settings.aanFeatures.i;
                                      if (nodes.length === 0) {
                                        return;
                                  Severity: Minor
                                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                                    Function events has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          events: function () {
                                            a.on('keydown.mask', function (c) {
                                              a.data('mask-keycode', c.keyCode || c.which);
                                            })
                                              .on(
                                    Severity: Minor
                                    Found in view/frontend/web/js/jquery.mask.min.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language