holderdeord/hdo-site

View on GitHub

Showing 302 of 302 total issues

Function PreviewManager has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function PreviewManager(converter, panels, previewRefreshCallback) {

        var managerObj = this;
        var timeout;
        var elapsedTime;
Severity: Major
Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js - About 5 hrs to fix

    File cull.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var cull = (function (global) {
      "use strict";
    
      var _ = global._ || require("underscore");
      var slice = Array.prototype.slice;
    Severity: Minor
    Found in app/assets/javascripts/lib/cull.js - About 5 hrs to fix

      File bootstrap-tagsmanager.js has 389 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* ===================================================
       * bootstrap-tagmanager.js v2.2
       * http://welldonethings.com/tags/manager
       * ===================================================
       * Copyright 2012 Max Favilli
      Severity: Minor
      Found in app/assets/javascripts/lib/bootstrap-tagsmanager.js - About 5 hrs to fix

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

          $.fn.affix = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('affix')
                , options = typeof option == 'object' && option
        Severity: Major
        Found in app/assets/javascripts/twitter/bootstrap/bootstrap-affix.js and 1 other location - About 4 hrs to fix
        app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js on lines 84..92

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

        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

          $.fn.popover = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('popover')
                , options = typeof option == 'object' && option
        app/assets/javascripts/twitter/bootstrap/bootstrap-affix.js on lines 69..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 125.

        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

        File issueEditor.js has 354 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*global jQuery, HDO, Handlebars */
        
        (function ($, HDO, Handlebars) {
            HDO.issueEditor = {
                create: function (opts) {
        Severity: Minor
        Found in app/assets/javascripts/issueEditor.js - About 4 hrs to fix

          Function __module6__ has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var __module6__ = (function(__dependency1__, __dependency2__, __dependency3__) {
            "use strict";
            var __exports__ = {};
            var Utils = __dependency1__;
            var Exception = __dependency2__;
          Severity: Major
          Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 4 hrs to fix

            Method generate_agreement_stats has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                  def generate_agreement_stats
                    all_categories = !!ENV['ALL_CATEGORIES']
                    exclude_budget = !!ENV['EXCLUDE_BUDGET']
            
                    sessions     = ParliamentSession.where('start_date > ?', Time.parse('2009-08-31')).order(:start_date).to_a
            Severity: Minor
            Found in lib/hdo/import/cli.rb - About 4 hrs 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 4 locations. Consider refactoring.
            Open

              $.fn.typeahead = function (option) {
                return this.each(function () {
                  var $this = $(this)
                    , data = $this.data('typeahead')
                    , options = typeof option == 'object' && option
            app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js on lines 126..134
            app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js on lines 124..132
            app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js on lines 252..260

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

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

              $.fn.scrollspy = function (option) {
                return this.each(function () {
                  var $this = $(this)
                    , data = $this.data('scrollspy')
                    , options = typeof option == 'object' && option
            app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js on lines 126..134
            app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js on lines 252..260
            app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js on lines 296..304

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

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

              $.fn.collapse = function (option) {
                return this.each(function () {
                  var $this = $(this)
                    , data = $this.data('collapse')
                    , options = typeof option == 'object' && option
            app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js on lines 124..132
            app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js on lines 252..260
            app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js on lines 296..304

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

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

              $.fn.tooltip = function ( option ) {
                return this.each(function () {
                  var $this = $(this)
                    , data = $this.data('tooltip')
                    , options = typeof option == 'object' && option
            app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js on lines 126..134
            app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js on lines 124..132
            app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js on lines 296..304

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

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

                ui.prompt = function (text, defaultInputText, callback) {
            
                    // These variables need to be declared at this level since they are used
                    // in multiple functions.
                    var dialog;         // The dialog box.
            Severity: Major
            Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js - About 4 hrs to fix

              Function parse has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                parse: function parse(input) {
                    var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
                    this.lexer.setInput(input);
                    this.lexer.yy = this.yy;
                    this.yy.lexer = this.lexer;
              Severity: Major
              Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 4 hrs to fix

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

                  $.fn.alert = function (option) {
                    return this.each(function () {
                      var $this = $(this)
                        , data = $this.data('alert')
                      if (!data) $this.data('alert', (data = new Alert(this)))
                Severity: Major
                Found in app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js on lines 126..133

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

                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

                  $.fn.dropdown = function (option) {
                    return this.each(function () {
                      var $this = $(this)
                        , data = $this.data('dropdown')
                      if (!data) $this.data('dropdown', (data = new Dropdown(this)))
                app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js on lines 71..78

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

                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

                File persister.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Hdo
                  module Import
                    class Persister
                      attr_writer :log
                
                
                Severity: Minor
                Found in lib/hdo/import/persister.rb - About 3 hrs to fix

                  Function TextareaState has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function TextareaState(panels, isInitialState) {
                  
                          // Aliases
                          var stateObj = this;
                          var inputArea = panels.input;
                  Severity: Major
                  Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js - About 3 hrs to fix

                    File facet_search.rb has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module Hdo
                      module Search
                        module FacetSearch
                          extend ActiveSupport::Concern
                    
                    
                    Severity: Minor
                    Found in lib/hdo/search/facet_search.rb - About 3 hrs to fix

                      Function doBlockquote has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          commandProto.doBlockquote = function (chunk, postProcessing) {
                      
                              chunk.selection = chunk.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,
                                  function (totalMatch, newlinesBefore, text, newlinesAfter) {
                                      chunk.before += newlinesBefore;
                      Severity: Major
                      Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language