holderdeord/hdo-site

View on GitHub

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

        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

            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

                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

                        Class Representative has 30 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Representative < ActiveRecord::Base
                          devise :database_authenticatable,
                                 :recoverable, :rememberable, :trackable, :validatable,
                                 :confirmable
                        
                        
                        Severity: Minor
                        Found in app/models/representative.rb - About 3 hrs to fix

                          Function anonymous has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
                          
                            var $0 = $$.length - 1;
                            switch (yystate) {
                            case 1: return new yy.ProgramNode($$[$0-1], this._$);
                          Severity: Major
                          Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 3 hrs to fix

                            Class Persister has 29 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class Persister
                                  attr_writer :log
                            
                                  def initialize
                                    @log = Logger.new(STDOUT)
                            Severity: Minor
                            Found in lib/hdo/import/persister.rb - About 3 hrs to fix

                              Class CLI has 29 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                  class CLI
                                    AGREEMENT_CONFIG = {
                                      unit: :propositions,
                                      ignore_unanimous: true
                                    }
                              Severity: Minor
                              Found in lib/hdo/import/cli.rb - About 3 hrs to fix

                                Function onTouchEnd has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function onTouchEnd(event) {
                                
                                    // If slider is not touched exit
                                    if ( params.onlyExternal || !_this.isTouched ) return
                                    _this.isTouched = false
                                Severity: Major
                                Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 3 hrs to fix

                                  Function init has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    _this.init = function(reInit) {
                                      var _width = window.getComputedStyle(_this.container, null).getPropertyValue('width')
                                      var _height = window.getComputedStyle(_this.container, null).getPropertyValue('height')
                                      var newWidth = parseInt(_width,10);
                                      var newHeight  = parseInt(_height,10);
                                  Severity: Major
                                  Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 3 hrs to fix

                                    Function anonymous has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
                                    
                                    
                                      function strip(start, end) {
                                        return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
                                    Severity: Major
                                    Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 3 hrs to fix

                                      Function registerDefaultHelpers has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function registerDefaultHelpers(instance) {
                                          instance.registerHelper('helperMissing', function(arg) {
                                            if(arguments.length === 2) {
                                              return undefined;
                                            } else {
                                      Severity: Major
                                      Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language