gsouf/zero-table

View on GitHub

Showing 44 of 51 total issues

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

    render: function(renderer, set){

        var self = this;

        // TODO : compile and cache
Severity: Minor
Found in src/ZeroTable/StringRenderParser.js - About 6 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 makeRowSelection has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

        makeRowSelection: function(tableInstance, $row, largeSelection){

            // check if we already reached the max selection
            var maxSelection = this.getOption("maxSelection", tableInstance);
            if(maxSelection === 0){
Severity: Minor
Found in src/plugins/selection.js - About 3 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 selectRow has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        selectRow : function(tableInstance, $row, selectionType){

            var maxSelection = this.getOption("maxSelection", tableInstance);
            var plugin = this;

Severity: Minor
Found in src/plugins/selection.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 drawHeaderColumns has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        drawHeaderColumns : function($row, tableInstance){

            var self = this;
            var currentOrderingIndexed = ZeroTable.clone(tableInstance.dataConnector.getOrder());
            var i = 0;
Severity: Major
Found in src/plugins/header.js - About 2 hrs to fix

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

    module.exports = function(grunt) {
    
    
        // Source files to include
        var sourceFiles = grunt.file.readJSON('build.json');
    Severity: Major
    Found in Gruntfile.js - About 2 hrs to fix

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

      ZeroTable.Tools.SearchDetails = function(table, options){
      
          this.options = {};
          options = options || {};
      
      
      Severity: Major
      Found in src/ZeroTable/Tools/SearchDetails.js - About 2 hrs to fix

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

            render: function(renderer, set){
        
                var self = this;
        
                // TODO : compile and cache
        Severity: Major
        Found in src/ZeroTable/StringRenderParser.js - About 2 hrs to fix

          Function foreach has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          ZeroTable.foreach = function(set,callback){
          
            if(set instanceof Array){
              for(var i = 0; i < set.length ; i++ ){
                var r = callback(set[i],i,set);
          Severity: Minor
          Found in src/ZeroTable/foreach.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 tableKeys has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              "tableKeys" : function(plugin){
          
                  return {
          
                      internalSelection: {},
          Severity: Minor
          Found in src/plugins/selection.js - About 1 hr to fix

            Function drawInnerRow has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drawInnerRow: function(tableInstance, dataRow, $row){
            
                    // Remove custom class because they depend on the data
                    var customClass = $row.attr('data-zt-rowcustom-class');
                    if(customClass){
            Severity: Minor
            Found in src/ZeroTable/Plugin/TableBodyMode/Table.js - About 1 hr to fix

              Function fire has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  fire : function(what, params){
              
                      var event = new ZeroTable.Bindable.Event(this);
              
                      if(this.bindable_bounds && this.bindable_bounds[what]) {
              Severity: Minor
              Found in src/ZeroTable/Bindable.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 data.orderChange has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      "data.orderChange": function(e){
                          var tableInstance = this.context;
                          var dataConnector = e.originalEvent.context;
              
                          var order = dataConnector.getOrder();
              Severity: Minor
              Found in src/plugins/header.js - About 1 hr to fix

                Function update has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    update : function(delay){
                
                        var transactionId = this.__generateGuid;
                        this._currentTransaction = transactionId;
                
                
                Severity: Minor
                Found in src/ZeroTable/DataConnector.js - About 1 hr to fix

                  Function Table has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ZeroTable.Table = function(options){
                  
                      var self = this;
                  
                      ZeroTable.extend(this,[
                  Severity: Minor
                  Found in src/ZeroTable/Table.js - About 1 hr to fix

                    Function Paginator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    ZeroTable.Tools.Paginator = function(table){
                        this.table = table;
                        this.$item = $('<div class="zt-paginator"></div>');
                    
                        var $firstPage = $('<div class="zt-pagi-ico zt-first-page">&lt;&lt;</div>');
                    Severity: Minor
                    Found in src/ZeroTable/Tools/Paginator.js - About 1 hr to fix

                      Function selectRow has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              selectRow : function(tableInstance, $row, selectionType){
                      
                                  var maxSelection = this.getOption("maxSelection", tableInstance);
                                  var plugin = this;
                      
                      
                      Severity: Minor
                      Found in src/plugins/selection.js - About 1 hr to fix

                        Function afterDrawCell has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                                "afterDrawCell": function(e){
                        
                                    if(e.cell.hasRole("data")){
                                        var value;
                                        if(!e.columnDef.options.render && e.columnDef.options.content){
                        Severity: Minor
                        Found in src/plugins/renderCell.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 TableInstance has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        ZeroTable.TableInstance = function(table, datapool, options){
                        
                            if(table instanceof ZeroTable.Table){
                        
                                this.table = table;
                        Severity: Minor
                        Found in src/ZeroTable/TableInstance.js - About 1 hr to fix

                          Function SortDetails has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          ZeroTable.Tools.SortDetails = function(table, options){
                          
                              this.options = {};
                              options = options || {};
                          
                          
                          Severity: Minor
                          Found in src/ZeroTable/Tools/SortDetails.js - About 1 hr to fix

                            Function parseFilters has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function parseFilters(data, filters){
                                        if(filters.length > 0){
                                            for(var i = 0; i<filters.length; i++){
                            
                                                var params = filters[i].match(/\(.*\)/g);
                            Severity: Minor
                            Found in src/ZeroTable/StringRenderParser.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language