abkfenris/gage-web

View on GitHub

Showing 47 of 134 total issues

Avoid deeply nested control flow statements.
Open

            if (!allfound) {
              continue;
            }
Severity: Major
Found in doc/dead/html/_static/searchtools.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                for (i = 0; i < otherterms.length; i++) {
                  if (haystack.indexOf(otherterms[i]) == -1) {
                    allfound = false;
                    break;
                  }
    Severity: Major
    Found in doc/dead/html/_static/searchtools.js - About 45 mins to fix

      Consider simplifying this complex logical expression.
      Open

            if (autoPlace) {
              var $parent = this.$element.parent()
      
              var orgPlacement = placement
              var docScroll    = document.documentElement.scrollTop || document.body.scrollTop
      Severity: Major
      Found in app/static/js/bootstrap.js - About 40 mins to fix

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

        jQuery.fn.highlightText = function(text, className) {
          function highlight(node) {
            if (node.nodeType == 3) {
              var val = node.nodeValue;
              var pos = val.toLowerCase().indexOf(text);
        Severity: Minor
        Found in doc/dead/html/_static/doctools.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 _setaxislimits has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def _setaxislimits(self, axis, ymin, ymax):
                """
                Set limits for y axis. If not set on sensor, then use a buffer of 10%
                """
                if ymin == ymax:
        Severity: Minor
        Found in app/main/plot.py - About 25 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 to_prev_chunk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        coverage.to_prev_chunk = function () {
            var c = coverage;
        
            // Find the end of the prev colored chunk.
            var probe = c.sel_begin-1;
        Severity: Minor
        Found in tmp/coverage/coverage_html.js - About 25 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 to_next_chunk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        coverage.to_next_chunk = function () {
            var c = coverage;
        
            // Find the start of the next colored chunk.
            var probe = c.sel_end;
        Severity: Minor
        Found in tmp/coverage/coverage_html.js - About 25 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