deltreey/Dable

View on GitHub

Showing 68 of 68 total issues

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

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    if (this.async &&
                        (this.asyncStart > this.pageNumber * this.pageSize ||
                          this.pageNumber * this.pageSize >=
                          this.asyncStart + this.asyncLength)) {
                      var newStart = this.pageNumber * this.pageSize;
                  Severity: Major
                  Found in src/goToPage.js and 1 other location - About 1 hr to fix
                  src/lastPage.js on lines 6..32

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    if (this.async &&
                        (this.asyncStart > this.pageNumber * this.pageSize ||
                          this.pageNumber * this.pageSize >
                          this.asyncStart + this.asyncLength)) {
                      var newStart = 0;
                  Severity: Major
                  Found in src/lastPage.js and 1 other location - About 1 hr to fix
                  src/goToPage.js on lines 5..25

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  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
                        Severity
                        Category
                        Status
                        Source
                        Language