deltreey/Dable

View on GitHub

Showing 45 of 68 total issues

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

export default function(tableDiv) {
  if (!tableDiv) {
    return false;
  }

Severity: Minor
Found in src/applyJqueryUIStyles.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 default has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function(tableDiv) {
  if (this.dableClass) {
    tableDiv.setAttribute('class', this.dableClass);
  }

Severity: Minor
Found in src/applyBaseStyles.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 default has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function(tableDiv) {
  if (!tableDiv) {
    return false;
  }

Severity: Minor
Found in src/applyBootstrapStyles.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 default has 32 lines of code (exceeds 25 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 1 hr to fix

    Function default has a Cognitive Complexity of 11 (exceeds 5 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: Minor
    Found in src/baseSort.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 default has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function(tableInput) {
      var tableId = this.CheckForTable(tableInput);
      if (!tableId) {
        return false;
      }
    Severity: Minor
    Found in src/buildAll.js - About 1 hr to fix

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

      export default function(tableDiv, style) {
        if (!tableDiv) {
          tableDiv = document.getElementById(this.id);
          if (!tableDiv) {
            return false;
      Severity: Minor
      Found in src/updateStyle.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 default has a Cognitive Complexity of 10 (exceeds 5 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

      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 10 (exceeds 5 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

      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 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function(footer) {
        if (!footer) {
          return false;
        }
        var start = this.pageNumber * this.pageSize + 1;
      Severity: Minor
      Found in src/updateFooter.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if (splitDate.length != 3 ||
                (splitDate[0].length < 1 || splitDate[0].length > 2) ||
                (splitDate[1].length < 1 || splitDate[1].length > 2) ||
                splitDate[2].length != 2 && splitDate[2].length != 4) {
              isDate = false;
        Severity: Major
        Found in src/baseSort.js - About 1 hr to fix

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

          export default function(footer) {
            if (!footer) {
              return false;
            }
            var start = this.pageNumber * this.pageSize + 1;
          Severity: Minor
          Found in src/updateFooter.js - About 55 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 default has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function() {
            this.pageNumber = this.NumberOfPages() - 1;
            //page number is 0 based
            if (this.async &&
                (this.asyncStart > this.pageNumber * this.pageSize ||
          Severity: Minor
          Found in src/lastPage.js - About 55 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

          Avoid deeply nested control flow statements.
          Open

                  if (callback) {
                    return callback('Error, no rowCount in data from source');
                  }
          Severity: Major
          Found in src/asyncRequest.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if (arrayContains(includedRows, this.rows[j])) {
                        continue;
                      }
            Severity: Major
            Found in src/searchFunc.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        for (var k = 0; k < this.rows[j].length; ++k) {
                          if (this.filters[i](this.currentFilter, this.rows[j][k])) {
                            includedRows.push(this.rows[j]);
                            includedRowObjects.push(this.rowObjects[j]);
                            break;
              Severity: Major
              Found in src/searchFunc.js - About 45 mins to fix

                Function mixin has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                export function mixin(obj, mixins) {
                  for (var key in mixins) {
                    if (Object.prototype.hasOwnProperty.call(mixins, key)) {
                      obj[key] = typeof mixins[key] === 'object' && mixins[key] !== null ?
                        mixin(mixins[key].constructor(), mixins[key]) : mixins[key];
                Severity: Minor
                Found in src/utils.js - About 45 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 default has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                export default function(start, filter, sortColumn, ascending, callback) { //callback if async
                Severity: Minor
                Found in src/asyncRequest.js - About 35 mins to fix

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

                  export default function(tableDiv) {
                    var result = false;
                  
                    var checkId = '';
                    if (!tableDiv) {
                  Severity: Minor
                  Found in src/exists.js - About 35 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 default has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function(page) {
                    this.pageNumber = page;
                    if (this.async &&
                        (this.asyncStart > this.pageNumber * this.pageSize ||
                          this.pageNumber * this.pageSize >=
                  Severity: Minor
                  Found in src/goToPage.js - About 35 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