deltreey/Dable

View on GitHub

Showing 45 of 68 total issues

Function default has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

export default function(searchBox) {
  if (searchBox.id != this.id + '_search') {
    return false;
  }

Severity: Minor
Found in src/searchFunc.js - 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

Function default has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

export default function(start, filter, sortColumn, ascending, callback) { //callback if async
  var dable = this;
  if (typeof callback === 'undefined') {
    callback = false;
  }
Severity: Minor
Found in src/asyncRequest.js - 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

Function default has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export default function(input) { //Check for existing table
  if (input) {
    if (input.nodeType && input.nodeName.toLowerCase() == 'div') {
      if (input.hasAttribute('id')) {
        this.id = input.getAttribute('id');
Severity: Minor
Found in src/checkForTable.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 default has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function() {
  var ul = document.createElement('ul');
  var li = document.createElement('li');
  var anchor = document.createElement('a');
  var right = ul.cloneNode(false);
Severity: Major
Found in src/buildPager.js - About 3 hrs to fix

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

    export default function(tableDiv) {
      if (this.dableClass) {
        tableDiv.setAttribute('class', this.dableClass);
      }
    
    
    Severity: Major
    Found in src/applyBaseStyles.js - About 2 hrs to fix

      Function default has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function() {
        var ul = document.createElement('ul');
        var li = document.createElement('li');
        var anchor = document.createElement('a');
        var right = ul.cloneNode(false);
      Severity: Minor
      Found in src/buildPager.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 default has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function(columnIndex, ascending, currentRowObjects) {
        var isInt = true;
        var isDate = true;
        var newRowObjects = currentRowObjects.slice(0);
        for (var i = 0; i < currentRowObjects.length; ++i) {
      Severity: Major
      Found in src/baseSort.js - About 2 hrs to fix

        Function default has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function(columnCell) {
          var tag = columnCell.tagName;
          //prevent sorting from some form elements
          if (tag != 'INPUT' && tag != 'BUTTON' && tag != 'SELECT' &&
              tag != 'TEXTAREA') {
        Severity: Minor
        Found in src/sortFunc.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 default has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function(tableDiv) {
          if (!tableDiv) {
            return false;
          }
        
        
        Severity: Major
        Found in src/applyBootstrapStyles.js - About 2 hrs to fix

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

          export default function(tableDiv) {
            if (!tableDiv) {
              return false;
            }
          
          
          Severity: Major
          Found in src/applyJqueryUIStyles.js - About 2 hrs to fix

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

            export default function(start, filter, sortColumn, ascending, callback) { //callback if async
              var dable = this;
              if (typeof callback === 'undefined') {
                callback = false;
              }
            Severity: Major
            Found in src/asyncRequest.js - About 2 hrs to fix

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

              export default function(body) {
                if (!body) {
                  body = document.getElementById(this.id + '_body');
                  if (!body) {
                    return false;
              Severity: Minor
              Found in src/updateDisplayedRows.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 default has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function(tableDiv) {
                if (!tableDiv) {
                  return false;
                }
                var div = document.createElement('div');
              Severity: Minor
              Found in src/buildHeader.js - About 2 hrs to fix

                Function default has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function(searchBox) {
                  if (searchBox.id != this.id + '_search') {
                    return false;
                  }
                
                
                Severity: Minor
                Found in src/searchFunc.js - About 2 hrs to fix

                  Function default has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function(columnCell) {
                    var tag = columnCell.tagName;
                    //prevent sorting from some form elements
                    if (tag != 'INPUT' && tag != 'BUTTON' && tag != 'SELECT' &&
                        tag != 'TEXTAREA') {
                  Severity: Minor
                  Found in src/sortFunc.js - About 2 hrs to fix

                    Function default has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function(body) {
                      if (!body) {
                        body = document.getElementById(this.id + '_body');
                        if (!body) {
                          return false;
                    Severity: Minor
                    Found in src/updateDisplayedRows.js - About 1 hr to fix

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

                        dableRequest.onreadystatechange = function() {
                          if (dableRequest.readyState == 4 && dableRequest.status == 200) {
                            var data = JSON.parse(dableRequest.responseText);
                            var actualData = data;
                            if (data.rows === undefined) {
                      Severity: Minor
                      Found in src/asyncRequest.js - About 1 hr to fix

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

                        export default function(tableDiv) {
                          tableDiv.removeAttribute('class');
                          var children = tableDiv.children;
                          for (var i = 0; i < children.length; ++i) {
                            children[i].removeAttribute('class');
                        Severity: Minor
                        Found in src/removeStyles.js - About 1 hr to fix

                          Function default has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function(tableNode) {
                            if (!tableNode) {
                              console.error('Dable Error: No HTML table to generate dable from');
                              return false;
                            }
                          Severity: Minor
                          Found in src/generateTableFromHtml.js - About 1 hr to fix

                            Function default has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function(tableDiv) {
                              if (!tableDiv) {
                                return false;
                              }
                            
                            
                            Severity: Minor
                            Found in src/buildTable.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language