pagseguro/magento2

View on GitHub

Showing 261 of 385 total issues

File jquery.dataTables.min.js has 6305 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! DataTables 1.10.12
 * ©2008-2015 SpryMedia Ltd - datatables.net/license
 */

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

    File bootstrap.min.js has 1669 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Bootstrap v3.3.7 (http://getbootstrap.com)
     * Copyright 2011-2016 Twitter, Inc.
     * Licensed under the MIT license
     */
    Severity: Major
    Found in view/frontend/web/js/bootstrap.min.js - About 4 days to fix

      Function DataTable has 536 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var DataTable = function (options) {
          /**
           * Perform a jQuery selector action on the table's TR elements (from the tbody) and
           * return the resulting jQuery object.
           *  @param {string|node|jQuery} sSelector jQuery selector or node collection to act on
      Severity: Major
      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 days to fix

        File public.js has 919 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         *
         * Modals
         *
         */
        Severity: Major
        Found in view/adminhtml/web/js/public.js - About 2 days to fix

          Function Details has 313 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                Details: function (url, transaction_code, order) {
                  jQuery
                    .ajax({
                      url: url + '/pagseguro/transactions/transaction',
                      type: 'POST',
          Severity: Major
          Found in view/adminhtml/web/js/public.js - About 1 day to fix

            Function y has 229 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var y = function (a, e, d) {
                var c = {
                  invalid: [],
                  getCaret: function () {
                    try {
            Severity: Major
            Found in view/frontend/web/js/jquery.mask.min.js - About 1 day to fix

              Function _fnScrollDraw has 179 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function _fnScrollDraw(settings) {
                  // Given that this is such a monster function, a lot of variables are use
                  // to try and keep the minimised size as small as possible
                  var scroll = settings.oScroll,
                    scrollX = scroll.sX,
              Severity: Major
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 7 hrs to fix

                Function _fnCalculateColumnWidths has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function _fnCalculateColumnWidths(oSettings) {
                    var table = oSettings.nTable,
                      columns = oSettings.aoColumns,
                      scroll = oSettings.oScroll,
                      scrollY = scroll.sY,
                Severity: Major
                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 5 hrs to fix

                  Method execute has 138 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function execute()
                      {
                          $lastRealOrder = $this->_checkoutSession->getLastRealOrder();
                  
                          if ($lastRealOrder->getPayment()===null) {
                  Severity: Major
                  Found in Controller/Payment/Request.php - About 5 hrs to fix

                    Function execute has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function execute()
                        {
                            $lastRealOrder = $this->_checkoutSession->getLastRealOrder();
                    
                            if ($lastRealOrder->getPayment()===null) {
                    Severity: Minor
                    Found in Controller/Payment/Request.php - About 5 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

                    File Data.php has 371 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * 2007-2016 [PagSeguro Internet Ltda.]
                     *
                     * NOTICE OF LICENSE
                    Severity: Minor
                    Found in Helper/Data.php - About 4 hrs to fix

                      CreditCardMethod has 35 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class CreditCardMethod
                      {
                          /**
                           * @var \Magento\Checkout\Model\Session
                           */
                      Severity: Minor
                      Found in Model/Direct/CreditCardMethod.php - About 4 hrs to fix

                        File Method.php has 354 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * 2007-2016 [PagSeguro Internet Ltda.]
                         *
                         * NOTICE OF LICENSE
                        Severity: Minor
                        Found in Model/Transactions/Method.php - About 4 hrs to fix

                          Method has 33 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          abstract class Method
                          {
                          
                              /**
                               * Sanitize configuration
                          Severity: Minor
                          Found in Model/Transactions/Method.php - About 4 hrs to fix

                            Function getTitleCodePaymentMethod has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function getTitleCodePaymentMethod($code)
                                {
                                    if (!is_null($code)) {
                                        switch ($code) {
                                            case 101:
                            Severity: Minor
                            Found in Helper/Data.php - About 4 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 _fnDraw has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function _fnDraw(oSettings) {
                                /* Provide a pre-callback function which can be used to cancel the draw is false is returned */
                                var aPreDraw = _fnCallbackFire(oSettings, 'aoPreDrawCallback', 'preDraw', [
                                  oSettings,
                                ]);
                            Severity: Major
                            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 4 hrs to fix

                              Function _fnFeatureHtmlTable has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function _fnFeatureHtmlTable(settings) {
                                  var table = $(settings.nTable);
                              
                                  // Add the ARIA grid role to the table
                                  table.attr('role', 'grid');
                              Severity: Major
                              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 3 hrs to fix

                                File jquery.mask.min.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                // jQuery Mask Plugin v1.14.0
                                // github.com/igorescobar/jQuery-Mask-Plugin
                                (function (b) {
                                  'function' === typeof define && define.amd
                                    ? define(['jquery'], b)
                                Severity: Minor
                                Found in view/frontend/web/js/jquery.mask.min.js - About 3 hrs to fix

                                  Function _fnBuildAjax has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function _fnBuildAjax(oSettings, data, fn) {
                                      // Compatibility with 1.9-, allow fnServerData and event to manipulate
                                      _fnCallbackFire(oSettings, 'aoServerParams', 'serverParams', [data]);
                                  
                                      // Convert to object based for 1.10+ if using the old array scheme which can
                                  Severity: Major
                                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 3 hrs to fix

                                    DebitMethod has 30 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class DebitMethod
                                    {
                                        /**
                                         * @var \Magento\Checkout\Model\Session
                                         */
                                    Severity: Minor
                                    Found in Model/Direct/DebitMethod.php - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language