abkfenris/gage-web

View on GitHub

Showing 134 of 134 total issues

Function select_line_or_chunk has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

coverage.select_line_or_chunk = function (lineno) {
    var c = coverage;
    var probe_line = c.line_elt(lineno);
    if (probe_line.length === 0) {
        return;
Severity: Minor
Found in tmp/coverage/coverage_html.js - About 1 hr to fix

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

        $('a.hide-propose-change').live("click", function(event) {
          event.preventDefault();
          hideProposeChange($(this).attr('id').substring(2));
        });
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 9 other locations - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 53..56
    doc/dead/html/_static/websupport.js on lines 61..64
    doc/dead/html/_static/websupport.js on lines 65..68
    doc/dead/html/_static/websupport.js on lines 73..76
    doc/dead/html/_static/websupport.js on lines 77..80
    doc/dead/html/_static/websupport.js on lines 81..84
    doc/dead/html/_static/websupport.js on lines 89..92
    doc/dead/html/_static/websupport.js on lines 93..96
    doc/dead/html/_static/websupport.js on lines 97..100

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

    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 10 locations. Consider refactoring.
    Open

        $('a.show-proposal').live("click", function(event) {
          event.preventDefault();
          showProposal($(this).attr('id').substring(2));
        });
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 9 other locations - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 53..56
    doc/dead/html/_static/websupport.js on lines 61..64
    doc/dead/html/_static/websupport.js on lines 65..68
    doc/dead/html/_static/websupport.js on lines 77..80
    doc/dead/html/_static/websupport.js on lines 81..84
    doc/dead/html/_static/websupport.js on lines 85..88
    doc/dead/html/_static/websupport.js on lines 89..92
    doc/dead/html/_static/websupport.js on lines 93..96
    doc/dead/html/_static/websupport.js on lines 97..100

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

    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 10 locations. Consider refactoring.
    Open

        $('a.comment-markup').live("click", function(event) {
          event.preventDefault();
          toggleCommentMarkupBox($(this).attr('id').substring(2));
        });
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 9 other locations - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 53..56
    doc/dead/html/_static/websupport.js on lines 61..64
    doc/dead/html/_static/websupport.js on lines 65..68
    doc/dead/html/_static/websupport.js on lines 73..76
    doc/dead/html/_static/websupport.js on lines 77..80
    doc/dead/html/_static/websupport.js on lines 81..84
    doc/dead/html/_static/websupport.js on lines 85..88
    doc/dead/html/_static/websupport.js on lines 89..92
    doc/dead/html/_static/websupport.js on lines 93..96

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

    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 10 locations. Consider refactoring.
    Open

        $('a.reply').live("click", function(event) {
          event.preventDefault();
          openReply($(this).attr('id').substring(2));
        });
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 9 other locations - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 53..56
    doc/dead/html/_static/websupport.js on lines 65..68
    doc/dead/html/_static/websupport.js on lines 73..76
    doc/dead/html/_static/websupport.js on lines 77..80
    doc/dead/html/_static/websupport.js on lines 81..84
    doc/dead/html/_static/websupport.js on lines 85..88
    doc/dead/html/_static/websupport.js on lines 89..92
    doc/dead/html/_static/websupport.js on lines 93..96
    doc/dead/html/_static/websupport.js on lines 97..100

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

    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 10 locations. Consider refactoring.
    Open

        $('a.comment-close').live("click", function(event) {
          event.preventDefault();
          hide($(this).attr('id').substring(2));
        });
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 9 other locations - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 61..64
    doc/dead/html/_static/websupport.js on lines 65..68
    doc/dead/html/_static/websupport.js on lines 73..76
    doc/dead/html/_static/websupport.js on lines 77..80
    doc/dead/html/_static/websupport.js on lines 81..84
    doc/dead/html/_static/websupport.js on lines 85..88
    doc/dead/html/_static/websupport.js on lines 89..92
    doc/dead/html/_static/websupport.js on lines 93..96
    doc/dead/html/_static/websupport.js on lines 97..100

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

    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 10 locations. Consider refactoring.
    Open

        $('a.hide-proposal').live("click", function(event) {
          event.preventDefault();
          hideProposal($(this).attr('id').substring(2));
        });
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 9 other locations - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 53..56
    doc/dead/html/_static/websupport.js on lines 61..64
    doc/dead/html/_static/websupport.js on lines 65..68
    doc/dead/html/_static/websupport.js on lines 73..76
    doc/dead/html/_static/websupport.js on lines 81..84
    doc/dead/html/_static/websupport.js on lines 85..88
    doc/dead/html/_static/websupport.js on lines 89..92
    doc/dead/html/_static/websupport.js on lines 93..96
    doc/dead/html/_static/websupport.js on lines 97..100

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

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

      Modal.prototype.backdrop = function (callback) {
        var animate = this.$element.hasClass('fade') ? 'fade' : ''
    
        if (this.isShown && this.options.backdrop) {
          var doAnimate = $.support.transition && animate
    Severity: Minor
    Found in app/static/js/bootstrap.js - About 1 hr to fix

      Function checkPosition has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Affix.prototype.checkPosition = function () {
          if (!this.$element.is(':visible')) return
      
          var scrollHeight = $(document).height()
          var scrollTop    = this.$window.scrollTop()
      Severity: Minor
      Found in app/static/js/bootstrap.js - About 1 hr to fix

        Function deleteComment has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function deleteComment(id) {
            $.ajax({
              type: 'POST',
              url: opts.deleteCommentURL,
              data: {id: id},
        Severity: Minor
        Found in doc/dead/html/_static/websupport.js - About 1 hr to fix

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

          coverage.select_line_or_chunk = function (lineno) {
              var c = coverage;
              var probe_line = c.line_elt(lineno);
              if (probe_line.length === 0) {
                  return;
          Severity: Minor
          Found in tmp/coverage/coverage_html.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 activate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Tab.prototype.activate = function (element, container, callback) {
              var $active    = container.find('> .active')
              var transition = callback
                && $.support.transition
                && $active.hasClass('fade')
          Severity: Minor
          Found in app/static/js/bootstrap.js - About 1 hr to fix

            Function SphinxRtdTheme has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            window.SphinxRtdTheme = (function (jquery) {
                var stickyNav = (function () {
                    var navBar,
                        win,
                        stickyNavCssClass = 'stickynav',
            Severity: Minor
            Found in doc/dead/html/_static/js/theme.js - About 1 hr to fix

              Function getComments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function getComments(id) {
                  $.ajax({
                   type: 'GET',
                   url: opts.getCommentsURL,
                   data: {node: id},
              Severity: Minor
              Found in doc/dead/html/_static/websupport.js - About 1 hr to fix

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

                    $(document).on('click', "[data-toggle='wy-nav-top']", function() {
                      $("[data-toggle='wy-nav-shift']").toggleClass("shift");
                      $("[data-toggle='rst-versions']").toggleClass("shift");
                    });
                Severity: Major
                Found in doc/dead/html/_static/js/theme.js and 1 other location - About 1 hr to fix
                doc/_build/html/_static/js/theme.js on lines 11..14

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

                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

                    $(document).on('click', "[data-toggle='wy-nav-top']", function() {
                        $("[data-toggle='wy-nav-shift']").toggleClass("shift");
                        $("[data-toggle='rst-versions']").toggleClass("shift");
                    });
                Severity: Major
                Found in doc/_build/html/_static/js/theme.js and 1 other location - About 1 hr to fix
                doc/dead/html/_static/js/theme.js on lines 3..6

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

                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

                  Tooltip.prototype.arrow = function () {
                    return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
                  }
                Severity: Minor
                Found in app/static/js/bootstrap.js and 1 other location - About 55 mins to fix
                app/static/js/bootstrap.js on lines 1495..1497

                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

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

                  Popover.prototype.arrow = function () {
                    return this.$arrow = this.$arrow || this.tip().find('.arrow')
                  }
                Severity: Minor
                Found in app/static/js/bootstrap.js and 1 other location - About 55 mins to fix
                app/static/js/bootstrap.js on lines 1359..1361

                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 add_new_sample has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                def add_new_sample(sensor_id, dt, svalue, deltaminutes=10):
                    """
                    Adds a new sample with an associacted remote sensor
                    if there hasn't been a sample recorded within the last deltaminutes
                    (default is 10).
                Severity: Minor
                Found in app/remote/base.py - 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

                @main.route('/regions/')
                @main.route('/region/')
                def regionspage():
                    """**/regions/**
                
                
                Severity: Minor
                Found in app/main/views.py and 1 other location - About 50 mins to fix
                app/main/views.py on lines 87..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 36.

                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

                Severity
                Category
                Status
                Source
                Language