onijim/owl-table

View on GitHub

Showing 54 of 76 total issues

File swift-box.js has 1379 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * SwiftBox
 * A lightweight combobox plugin for jQuery
 * https://github.com/Knotix/SwiftBox/
 *
Severity: Major
Found in lib/swift-box.js - About 3 days to fix

    Function owlTableService has 384 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function owlTableService ($http, $rootScope, $filter, $modal, owlConstants, owlResource, owlUtils, owlFilter) {
            var unrenderedTable;
    
            var service = {
                tables: [],
    Severity: Major
    Found in src/services/owlTableService.js - About 1 day to fix

      Function render has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

          render: function () {
              var props = this.props;
              var td;
              var content;
              var optionText;
      Severity: Minor
      Found in react_components/cell.js - About 1 day 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 owlFilter has 145 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function owlFilter (owlConstants, owlUtils) {
          return {
      
              hasNoFilters: function (columns) {
                  return _.every(columns, function (column) {
      Severity: Major
      Found in src/services/owlFilter.js - About 5 hrs to fix

        Function render has 143 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            render: function () {
                var self = this;
        
                var props = self.props;
                var tackyTop = false;
        Severity: Major
        Found in react_components/table.js - About 5 hrs to fix

          File owlTableService.js has 402 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          (function (angular, _, $, React, OwlTableReact) {
              'use strict';
          
              function owlTableService ($http, $rootScope, $filter, $modal, owlConstants, owlResource, owlUtils, owlFilter) {
                  var unrenderedTable;
          Severity: Minor
          Found in src/services/owlTableService.js - About 5 hrs to fix

            Function owlTableDirective has 134 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function owlTableDirective ($timeout, $window, owlTable) {
                    return {
                        restrict: 'EA',
                        scope: {
                            data: '=',
            Severity: Major
            Found in src/directives/owlTable.js - About 5 hrs to fix

              Function render has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  render: function () {
                      var props = this.props;
                      var td;
                      var content;
                      var optionText;
              Severity: Major
              Found in react_components/cell.js - About 4 hrs to fix

                Function compile has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            compile: function (tElem, tAttrs) {
                
                                return function link (scope, elem, attrs) {
                                    var table;
                                    var rendered;
                Severity: Major
                Found in src/directives/owlTable.js - About 3 hrs to fix

                  Function link has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  return function link (scope, elem, attrs) {
                                      var table;
                                      var rendered;
                                      var container = elem.find('.owl-react-container')[0];
                  
                  
                  Severity: Major
                  Found in src/directives/owlTable.js - About 3 hrs to fix

                    File table.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    function stripFilters (string) {
                        _.forOwn(filterOptions, function (val, key) {
                            var keyRegExp = new RegExp('^' + key);
                            string = string.replace(keyRegExp, '');
                        });
                    Severity: Minor
                    Found in react_components/table.js - About 3 hrs to fix

                      Function render has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          render: function () {
                              var props = this.props;
                      
                              var input;
                              var options = props.column.options;
                      Severity: Major
                      Found in react_components/input.js - About 3 hrs to fix

                        Function setSelectedIndexes has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function setSelectedIndexes(elements, indexes, trigger_change) {
                                elements = normalizeElementArray(elements);
                        
                                if(indexes === undefined || indexes === null) {
                                    indexes = [];
                        Severity: Major
                        Found in lib/swift-box.js - About 3 hrs to fix

                          Function swiftsearch has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function swiftsearch(needle, haystacks, include_non_matches, result_limit) {
                                  haystacks = haystacks || [];
                                  needle    = String(needle || '');
                          
                                  if(!(haystacks instanceof Array)) {
                          Severity: Major
                          Found in lib/swift-search.js - About 3 hrs to fix

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

                            module.exports = function(config) {
                            
                                // Use ENV vars on Travis and sauce.json locally to get credentials
                                if (!process.env.SAUCE_USERNAME) {
                                    if (!fs.existsSync('sauce.json')) {
                            Severity: Major
                            Found in karma.conf-ci.js - About 2 hrs to fix

                              Function normalizeOptionArray has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function normalizeOptionArray(option_array, sort_function, remove_duplicates) {
                                      if(option_array === undefined || option_array === null) {
                                          option_array = [];
                                      }
                              
                              
                              Severity: Major
                              Found in lib/swift-box.js - About 2 hrs to fix

                                Function componentDidMount has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    componentDidMount: function () {
                                        var self = this;
                                
                                        var filterList = document.createElement('div');
                                        filterList.className = 'owl-filter-list';
                                Severity: Major
                                Found in react_components/table.js - About 2 hrs to fix

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

                                      render: function () {
                                          var props = this.props;
                                  
                                          var input;
                                          var options = props.column.options;
                                  Severity: Minor
                                  Found in react_components/input.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 swiftbox has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function swiftbox(elements, config) {
                                          elements = normalizeElementArray(elements);
                                  
                                          var new_elements = [];
                                  
                                  
                                  Severity: Major
                                  Found in lib/swift-box.js - About 2 hrs to fix

                                    Function owlPrintDirective has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function owlPrintDirective($window, owlTable, $timeout) {
                                            var printSection = document.getElementById('owlPrintSection');
                                    
                                            if (!printSection) {
                                                printSection = document.createElement('div');
                                    Severity: Major
                                    Found in src/directives/owlPrint.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language