holderdeord/hdo-site

View on GitHub

Showing 302 of 302 total issues

Avoid too many return statements within this function.
Open

      return true;
Severity: Major
Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      case 23:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 32;
    Severity: Major
    Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return false
      Severity: Major
      Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          case 22:this.popState(); return 18;
        Severity: Major
        Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return fn(context);
          Severity: Major
          Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                          return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
                                  {text: "", token: null, line: this.yylineno});
            Severity: Major
            Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                case 21:this.popState(); return 24;
              Severity: Major
              Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  case 24:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 32;
                Severity: Major
                Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    case 30:yy_.yytext = strip(1,2); return 40;
                  Severity: Major
                  Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return false;
                    Severity: Major
                    Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return
                      Severity: Major
                      Found in lib/hdo/import/persister.rb - About 30 mins to fix

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

                            if (_this.positions.current < -maxPosition) {
                              _this.swipeReset()
                              if (params.onTouchEnd) params.onTouchEnd(_this)
                              _this.callPlugins('onTouchEnd');
                              return
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 972..977

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

                        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

                        Avoid too many return statements within this method.
                        Open

                                  return
                        Severity: Major
                        Found in lib/hdo/import/persister.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                    return
                          Severity: Major
                          Found in lib/hdo/import/persister.rb - About 30 mins to fix

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

                                  var pageX = _this.support.touch ? event.targetTouches[0].pageX : (event.pageX || event.clientX)
                            Severity: Minor
                            Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                            app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 815..815

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

                            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

                                if (_this.positions.current > 0) {
                                  _this.swipeReset()
                                  if (params.onTouchEnd) params.onTouchEnd(_this)
                                  _this.callPlugins('onTouchEnd');
                                  return
                            Severity: Minor
                            Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                            app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 979..984

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

                            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

                                var pageX = _this.support.touch ? event.targetTouches[0].pageX : (event.pageX || event.clientX)
                            Severity: Minor
                            Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                            app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 744..744

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

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

                              def update_issues
                                issues = Array(params[:proposition].delete(:issues))
                                issues.each do |issue_id|
                                  next if issue_id.empty?
                            
                            
                            Severity: Minor
                            Found in app/controllers/admin/propositions_controller.rb - About 25 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

                            Method awesome_truncate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def awesome_truncate(text, length = 30, truncate_string = "...")
                                return if text.nil?
                                l = length - truncate_string.chars.to_a.size
                                text.chars.to_a.size > length ? text[/\A.{#{l}}\w*\;?/m][/.*[\w\;]/m] + truncate_string : text
                              rescue => ex
                            Severity: Minor
                            Found in app/helpers/application_helper.rb - About 25 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

                            Function transitionEnd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              transitionEnd : function(callback) {
                                var a = this
                                var el = a.wrapper
                                var events = ['webkitTransitionEnd','transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
                                if (callback) {
                            Severity: Minor
                            Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 25 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

                            Severity
                            Category
                            Status
                            Source
                            Language