abkfenris/gage-web

View on GitHub

Showing 134 of 134 total issues

Function add_sidebar_button has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function add_sidebar_button() {
    sidebarwrapper.css({
        'float': 'left',
        'margin-right': '0',
        'width': ssb_width_expanded - 28
Severity: Minor
Found in doc/dead/html/_static/sidebar.js - About 1 hr to fix

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

        $.support.transition && this.$tip.hasClass('fade') ?
          $tip
            .one($.support.transition.end, complete)
            .emulateTransitionEnd(150) :
          complete()
    Severity: Major
    Found in app/static/js/bootstrap.js and 1 other location - About 1 hr to fix
    app/static/js/bootstrap.js on lines 1211..1215

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

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

          $.support.transition && this.$tip.hasClass('fade') ?
            $tip
              .one($.support.transition.end, complete)
              .emulateTransitionEnd(150) :
            complete()
    Severity: Major
    Found in app/static/js/bootstrap.js and 1 other location - About 1 hr to fix
    app/static/js/bootstrap.js on lines 1307..1311

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

    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

        $('div[id] > :header:first').each(function() {
          $('<a class="headerlink">\u00B6</a>').
          attr('href', '#' + this.id).
          attr('title', _('Permalink to this headline')).
          appendTo(this);
    Severity: Major
    Found in doc/dead/html/_static/doctools.js and 1 other location - About 1 hr to fix
    doc/dead/html/_static/doctools.js on lines 145..150

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

    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

        $('dt[id]').each(function() {
          $('<a class="headerlink">\u00B6</a>').
          attr('href', '#' + this.id).
          attr('title', _('Permalink to this definition')).
          appendTo(this);
    Severity: Major
    Found in doc/dead/html/_static/doctools.js and 1 other location - About 1 hr to fix
    doc/dead/html/_static/doctools.js on lines 139..144

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

    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

      function showProposal(id) {
        $('#sp' + id).hide();
        $('#hp' + id).show();
        $('#pr' + id).slideDown('fast');
      }
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 1 other location - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 375..379

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

    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

      function hideProposal(id) {
        $('#hp' + id).hide();
        $('#sp' + id).show();
        $('#pr' + id).slideUp('fast');
      }
    Severity: Major
    Found in doc/dead/html/_static/websupport.js and 1 other location - About 1 hr to fix
    doc/dead/html/_static/websupport.js on lines 369..373

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

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

      performTermsSearch : function(searchterms, excluded, terms, score) {
        var filenames = this._index.filenames;
        var titles = this._index.titles;
    
        var i, j, file, files;
    Severity: Minor
    Found in doc/dead/html/_static/searchtools.js - About 1 hr to fix

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

          if slug is None:
              river = River.query.get_or_404(rid)
          else:
              river = River.query.filter_by(slug=slug).first_or_404()
      Severity: Major
      Found in app/main/views.py and 2 other locations - About 1 hr to fix
      app/main/views.py on lines 50..53
      app/main/views.py on lines 74..77

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

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

      coverage.index_ready = function ($) {
          // Look for a cookie containing previous sort settings:
          var sort_list = [];
          var cookie_name = "COVERAGE_INDEX_SORT";
          var i;
      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

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

          if slug is None:
              region = Region.query.get_or_404(rid)
          else:
              region = Region.query.filter_by(slug=slug).first_or_404()
      Severity: Major
      Found in app/main/views.py and 2 other locations - About 1 hr to fix
      app/main/views.py on lines 50..53
      app/main/views.py on lines 139..142

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

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

          if slug is None:
              gage = Gage.query.get_or_404(gid)
          else:
              gage = Gage.query.filter_by(slug=slug).first_or_404()
      Severity: Major
      Found in app/main/views.py and 2 other locations - About 1 hr to fix
      app/main/views.py on lines 74..77
      app/main/views.py on lines 139..142

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

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

              handleObj.handler = function( event ) {
                  // Don't fire in text-accepting inputs that we didn't directly bind to
                  if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
                       event.target.type === "text") ) {
                      return;
      Severity: Minor
      Found in tmp/coverage/jquery.hotkeys.js - About 1 hr to fix

        Function SphinxRtdTheme has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        window.SphinxRtdTheme = (function (jquery) {
            var stickyNav = (function () {
                var navBar,
                    win,
                    winScroll = false,
        Severity: Minor
        Found in doc/_build/html/_static/js/theme.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 show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Modal.prototype.show = function (_relatedTarget) {
            var that = this
            var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
        
            this.$element.trigger(e)
        Severity: Minor
        Found in app/static/js/bootstrap.js - About 1 hr to fix

          Function show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Collapse.prototype.show = function () {
              if (this.transitioning || this.$element.hasClass('in')) return
          
              var startEvent = $.Event('show.bs.collapse')
              this.$element.trigger(startEvent)
          Severity: Minor
          Found in app/static/js/bootstrap.js - About 1 hr to fix

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

                $('a.delete-comment').live("click", function(event) {
                  event.preventDefault();
                  deleteComment($(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 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.close-reply').live("click", function(event) {
                  event.preventDefault();
                  closeReply($(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 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.show-propose-change').live("click", function(event) {
                  event.preventDefault();
                  showProposeChange($(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 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.accept-comment').live("click", function(event) {
                  event.preventDefault();
                  acceptComment($(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 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

            Severity
            Category
            Status
            Source
            Language