holderdeord/hdo-site

View on GitHub

Showing 302 of 302 total issues

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

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

                        if (this.options.stringParams) {
                          if(val.depth) {
                            this.addDepth(val.depth);
                          }
                          this.opcode('getContext', val.depth || 0);
                Severity: Major
                Found in app/assets/javascripts/lib/handlebars-v1.3.0.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 1670..1685

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

                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

                        if(this.options.stringParams) {
                          if(param.depth) {
                            this.addDepth(param.depth);
                          }
                
                
                Severity: Major
                Found in app/assets/javascripts/lib/handlebars-v1.3.0.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 1478..1492

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

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

                  Function makeSpritedButtonRow has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function makeSpritedButtonRow() {
                  
                              var buttonBar = panels.buttonBar;
                  
                              var normalYShift = "0px";
                  Severity: Major
                  Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js - About 3 hrs to fix

                    Function onTouchMove has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method generate has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            def self.generate
                              categories = [
                                'Arbeidsliv',
                                'Arbeidsmiljø',
                                'Arbeidsvilkår',
                      Severity: Major
                      Found in lib/hdo/stats/agenda.rb - About 2 hrs to fix

                        Function str has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function str(key, holder) {
                        
                        // Produce a string from holder[key].
                        
                                var i,          // The loop counter.
                        Severity: Major
                        Found in app/assets/javascripts/conditional/json2.js - About 2 hrs to fix

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

                            , getTitle: function () {
                                var title
                                  , $e = this.$element
                                  , o = this.options
                          
                          
                          app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js on lines 56..65

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

                          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

                            , getContent: function () {
                                var content
                                  , $e = this.$element
                                  , o = this.options
                          
                          
                          app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js on lines 203..212

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

                          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

                          Method generate_agreement_stats has 69 lines of code (exceeds 25 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: Major
                          Found in lib/hdo/import/cli.rb - About 2 hrs to fix

                            Function doList has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                commandProto.doList = function (chunk, postProcessing, isNumberedList) {
                            
                                    // These are identical except at the very beginning and end.
                                    // Should probably use the regex extension function to make this clearer.
                                    var previousItemsRegex = /(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/;
                            Severity: Major
                            Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js - About 2 hrs to fix

                              Class Proposition has 23 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Proposition < ActiveRecord::Base
                                include Hdo::Search::Index
                              
                                settings(SearchSettings.default) {
                                  mappings {
                              Severity: Minor
                              Found in app/models/proposition.rb - About 2 hrs to fix

                                Function _extendSwiperSlide has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  _this._extendSwiperSlide = function  (el) {
                                      el.append = function () {
                                        _this.wrapper.appendChild(el);
                                        _this.reInit();
                                        return el;
                                Severity: Major
                                Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language