pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

Function _fnGetObjectDataFn has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function _fnGetObjectDataFn(mSource) {
    if ($.isPlainObject(mSource)) {
      /* Build an object of get functions, and wrap them in a single call */
      var o = {};
      $.each(mSource, function (key, val) {
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

    Function _fnColumnOptions has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function _fnColumnOptions(oSettings, iCol, oOptions) {
        var oCol = oSettings.aoColumns[iCol];
        var oClasses = oSettings.oClasses;
        var th = $(oCol.nTh);
    
    
    Severity: Major
    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

      Function _fnGetRowElements has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function _fnGetRowElements(settings, row, colIdx, d) {
          var tds = [],
            td = row.firstChild,
            name,
            col,
      Severity: Major
      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

        Function attach has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var attach = function (container, buttons) {
                  var i, ien, node, button;
                  var clickHandler = function (e) {
                    _fnPageChange(settings, e.data.action, true);
                  };
        Severity: Major
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

          Function Refund has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                Refund: function (url, data, row, value = null) {
                  var t = jQuery('#pagseguro-datatable').DataTable();
                  jQuery
                    .ajax({
                      url: url + '/pagseguro/refund/refund',
          Severity: Major
          Found in view/adminhtml/web/js/public.js - About 2 hrs to fix

            Function show has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                (c.prototype.show = function() {
                    var b = a.Event('show.bs.' + this.type);
                    if (this.hasContent() && this.enabled) {
                        this.$element.trigger(b);
                        var d = a.contains(
            Severity: Major
            Found in view/frontend/web/js/bootstrap.min.js - About 2 hrs to fix

              Function __cell_selector has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                var __cell_selector = function (settings, selector, opts) {
                  var data = settings.aoData;
                  var rows = _selector_row_indexes(settings, opts);
                  var cells = _removeEmpty(_pluck_order(data, rows, 'anCells'));
                  var allCells = $([].concat.apply([], cells));
              Severity: Major
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                Method createPagSeguroOrdersTable has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function createPagSeguroOrdersTable($setup) 
                    {
                        // Get pagseguro orders table
                        $tableName = $setup->getTable(self::PAGSEGURO_ORDERS);
                        // Check if the table already exists
                Severity: Major
                Found in Setup/UpgradeSchema.php - About 2 hrs to fix

                  Function _fnSetObjectDataFn has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function _fnSetObjectDataFn(mSource) {
                      if ($.isPlainObject(mSource)) {
                        /* Unlike get, only the underscore (global) option is used for for
                         * setting data since we don't know the type here. This is why an object
                         * option is not documented for `mData` (which is read/write), but it is
                  Severity: Major
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                    Function iterator has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        iterator: function (flatten, type, fn, alwaysNew) {
                          var a = [],
                            ret,
                            i,
                            ien,
                    Severity: Major
                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                      Function validateCpf has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function validateCpf(self) {
                        var cpf = unmask(self.value);
                        var numeros, digitos, soma, i, resultado, digitos_iguais;
                        digitos_iguais = 1;
                        if (cpf.length < 11) {
                      Severity: Minor
                      Found in view/frontend/web/js/model/direct-payment-validator.js - About 2 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 __column_selector has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var __column_selector = function (settings, selector, opts) {
                          var columns = settings.aoColumns,
                            names = _pluck(columns, 'sName'),
                            nodes = _pluck(columns, 'nTh');
                      
                      
                      Severity: Major
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                        Function Search has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              Search: function (url) {
                                jQuery
                                  .ajax({
                                    url: url + '/pagseguro/transactions/request',
                                    data: {
                        Severity: Major
                        Found in view/adminhtml/web/js/public.js - About 2 hrs to fix

                          Function validateCnpj has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function validateCnpj(self) {
                            var cnpj = unmask(self.value);
                            var numbersVal;
                            var digits;
                            var sum;
                          Severity: Major
                          Found in view/frontend/web/js/model/direct-payment-validator.js - About 2 hrs to fix

                            Function getTransactionTypeName has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function getTransactionTypeName($transactionTypeCode)
                                {
                                    if ($transactionTypeCode) {
                                        switch ($transactionTypeCode) {
                                            case 1:
                            Severity: Minor
                            Found in Helper/Data.php - About 2 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 _fnDrawHead has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function _fnDrawHead(oSettings, aoSource, bIncludeHidden) {
                                var i, iLen, j, jLen, k, kLen, n, nLocalTr;
                                var aoLocal = [];
                                var aApplied = [];
                                var iColumns = oSettings.aoColumns.length;
                            Severity: Major
                            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                              Function Search has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    Search: function (url) {
                                      jQuery
                                        .ajax({
                                          url: url + '/pagseguro/refund/request',
                                          data: {
                              Severity: Major
                              Found in view/adminhtml/web/js/public.js - About 2 hrs to fix

                                Function _fnLoadState has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function _fnLoadState(settings, oInit) {
                                    var i, ien;
                                    var columns = settings.aoColumns;
                                
                                    if (!settings.oFeatures.bStateSave) {
                                Severity: Major
                                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                                  Function _fnFeatureHtmlFilter has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function _fnFeatureHtmlFilter(settings) {
                                      var classes = settings.oClasses;
                                      var tableId = settings.sTableId;
                                      var language = settings.oLanguage;
                                      var previousSearch = settings.oPreviousSearch;
                                  Severity: Major
                                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix

                                    Function _fnCreateTr has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function _fnCreateTr(oSettings, iRow, nTrIn, anTds) {
                                        var row = oSettings.aoData[iRow],
                                          rowData = row._aData,
                                          cells = [],
                                          nTr,
                                    Severity: Major
                                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language