flipboxfactory/craft-reports

View on GitHub

Showing 100 of 130 total issues

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 */
                    iColspan = nCell.getAttribute('colspan') * 1;
Severity: Major
Found in src/web/assets/dataTables/dist/js/datatables.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if ( invalidated ||
                     force ||
                     regex ||
                     prevSearch.length > input.length ||
                     input.indexOf(prevSearch) !== 0 ||
    Severity: Major
    Found in src/web/assets/dataTables/dist/js/datatables.js - About 40 mins to fix

      Function __columnData has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          var __columnData = function ( settings, column, r1, r2, rows ) {
      Severity: Minor
      Found in src/web/assets/dataTables/dist/js/datatables.js - About 35 mins to fix

        Function _selector_run has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            var _selector_run = function ( type, selector, selectFn, settings, opts )
        Severity: Minor
        Found in src/web/assets/dataTables/dist/js/datatables.js - About 35 mins to fix

          Function fnUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )
          Severity: Minor
          Found in src/web/assets/dataTables/dist/js/datatables.js - About 35 mins to fix

            Function number has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    number: function ( thousands, decimal, precision, prefix, postfix ) {
            Severity: Minor
            Found in src/web/assets/dataTables/dist/js/datatables.js - About 35 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return [ rowObj.idx ];
              Severity: Major
              Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return jq.map( function(i) {
                                idx = $.inArray( this, tables );
                                return idx !== -1 ? settings[idx] : null;
                            } ).toArray();
                Severity: Major
                Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return host.length ?
                                          [ host.data('dt-row') ] :
                                          [];
                  Severity: Major
                  Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        return aoData[ rowIdx ] && aoData[ rowIdx ].nTr === sel ?
                                            [ rowIdx ] :
                                            [];
                    Severity: Major
                    Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return function (data, type) { // row and meta also passed, but not used
                                      return data[mSource];
                                  };
                      Severity: Major
                      Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return host.length ?
                                        [ host.data('dt-column') ] :
                                        [];
                        Severity: Major
                        Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                                  return [ _fnVisibleToColumnIndex( settings, idx ) ];
                          Severity: Major
                          Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return [ s._DT_CellIndex.column ];
                            Severity: Major
                            Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return function (data, val) { // meta is also passed in, but not used
                                              data[mSource] = val;
                                          };
                              Severity: Major
                              Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                    return aoData[ cellIdx.row ] && aoData[ cellIdx.row ].nTr === sel.parentNode ?
                                                        [ cellIdx.row ] :
                                                        [];
                                Severity: Major
                                Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return $(nodes)
                                                  .filter( sel )
                                                  .map( function () {
                                                      return this._DT_RowIndex;
                                                  } )
                                  Severity: Major
                                  Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                    return jqResult;
                                    Severity: Major
                                    Found in src/web/assets/dataTables/dist/js/datatables.js - About 30 mins to fix

                                      Function all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function all(): array
                                          {
                                              // Todo - add database storage here
                                              $configs = [];
                                      
                                      
                                      Severity: Minor
                                      Found in src/services/Reports.php - About 25 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 all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function all(): array
                                          {
                                              // Todo - add database storage
                                              $configs = [];
                                      
                                      
                                      Severity: Minor
                                      Found in src/services/Formats.php - About 25 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language