deltreey/Dable

View on GitHub

Showing 68 of 68 total issues

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

    for (var i = 0; i < phrases.length; ++i) {
      if (value.indexOf(phrases[i]) > -1) {
        return true;
      }
    }
Severity: Major
Found in src/filters.js and 1 other location - About 1 hr to fix
src/filters.js on lines 40..44

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 55.

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

    for (var j = 0; j < splitText.length; ++j) {
      if (value.indexOf(splitText[j]) > -1) {
        return true;
      }
    }
Severity: Major
Found in src/filters.js and 1 other location - About 1 hr to fix
src/filters.js on lines 15..19

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 55.

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

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

    Identical blocks of code found in 4 locations. Consider refactoring.
    Open

        if (this.sortOrder.length > 3 &&
            this.sortOrder.substr(0, 4).toLowerCase() == 'desc') {
          ascending = false;
        }
    Severity: Major
    Found in src/lastPage.js and 3 other locations - About 55 mins to fix
    src/asyncReload.js on lines 16..19
    src/goToPage.js on lines 11..14
    src/searchFunc.js on lines 17..20

    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 54.

    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

    Identical blocks of code found in 4 locations. Consider refactoring.
    Open

      if (this.sortOrder.length > 3 &&
          this.sortOrder.substr(0, 4).toLowerCase() == 'desc') {
        ascending = false;
      }
    Severity: Major
    Found in src/asyncReload.js and 3 other locations - About 55 mins to fix
    src/goToPage.js on lines 11..14
    src/lastPage.js on lines 18..21
    src/searchFunc.js on lines 17..20

    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 54.

    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

    Identical blocks of code found in 4 locations. Consider refactoring.
    Open

        if (this.sortOrder.length > 3 &&
            this.sortOrder.substr(0, 4).toLowerCase() == 'desc') {
          ascending = false;
        }
    Severity: Major
    Found in src/goToPage.js and 3 other locations - About 55 mins to fix
    src/asyncReload.js on lines 16..19
    src/lastPage.js on lines 18..21
    src/searchFunc.js on lines 17..20

    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 54.

    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

    Identical blocks of code found in 4 locations. Consider refactoring.
    Open

        if (this.sortOrder.length > 3 &&
            this.sortOrder.substr(0, 4).toLowerCase() == 'desc') {
          ascending = false;
        }
    Severity: Major
    Found in src/searchFunc.js and 3 other locations - About 55 mins to fix
    src/asyncReload.js on lines 16..19
    src/goToPage.js on lines 11..14
    src/lastPage.js on lines 18..21

    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 54.

    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 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

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

      if (this.NumberOfPages() - 1 == this.pageNumber) {
        pageRight.setAttribute('disabled', 'disabled');
        pageRight.onclick = noop; //disable onclick
      }
    Severity: Minor
    Found in src/buildPager.js and 1 other location - About 50 mins to fix
    src/buildPager.js on lines 91..94

    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 51.

    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.NumberOfPages() - 1 == this.pageNumber) {
          pageLast.setAttribute('disabled', 'disabled');
          pageLast.onclick = noop;  //disable onclick
        }
    Severity: Minor
    Found in src/buildPager.js and 1 other location - About 50 mins to fix
    src/buildPager.js on lines 76..79

    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 51.

    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

      for (var i = 0; i < oddRows.length; ++i) {
        oddRows[i].setAttribute('style', 'background-color: ' + this.oddRowColor);
      }
    Severity: Minor
    Found in src/applyBaseStyles.js and 1 other location - About 50 mins to fix
    src/applyBaseStyles.js on lines 18..20

    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 51.

    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

      for (var j = 0; j < evenRows.length; ++j) {
        evenRows[j].setAttribute('style', 'background-color: ' + this.evenRowColor);
      }
    Severity: Minor
    Found in src/applyBaseStyles.js and 1 other location - About 50 mins to fix
    src/applyBaseStyles.js on lines 13..15

    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 51.

    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

    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