Showing 122 of 122 total issues

Function setupOptions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    setupOptions: function(paramSize, params) {
      var options = [], contexts = [], types = [], param, inverse, program;

      options.push("hash:" + this.popStack());

Severity: Minor
Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

    Function createFunctionContext has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        createFunctionContext: function(asObject) {
          var locals = this.stackVars.concat(this.registers.list);
    
          if(locals.length > 0) {
            this.source[1] = this.source[1] + ", " + locals.join(", ");
    Severity: Minor
    Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

      Function replaceStack has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          replaceStack: function(callback) {
            var prefix = '',
                inline = this.isInline(),
                stack,
                createdStack,
      Severity: Minor
      Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

        Function getRemote has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function getRemote(o) {
                    var remote, defaults;
                    defaults = {
                        url: null,
                        cache: true,
        Severity: Minor
        Found in vendor/assets/javascripts/typeahead.bundle.js - About 1 hr to fix

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

            , deactivate: function($token) {
                if (!$token) return
          
                $token.removeClass('active')
                this.$copyHelper.val( this.getTokensList( null, null, true ) ).select()
          Severity: Major
          Found in vendor/assets/tokenfield/bootstrap-tokenfield.js and 1 other location - About 1 hr to fix
          vendor/assets/tokenfield/bootstrap-tokenfield.js on lines 756..761

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

          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

            , toggle: function($token) {
                if (!$token) return
          
                $token.toggleClass('active')
                this.$copyHelper.val( this.getTokensList( null, null, true ) ).select()
          Severity: Major
          Found in vendor/assets/tokenfield/bootstrap-tokenfield.js and 1 other location - About 1 hr to fix
          vendor/assets/tokenfield/bootstrap-tokenfield.js on lines 749..754

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

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

            def search
              query = parse_query
              article_search = Article.search do
                fulltext query[:text]
                with(:tags).all_of(query[:tags]) if query[:tags].present?
          Severity: Minor
          Found in app/controllers/articles_controller.rb - 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 hightlight has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  return function hightlight(o) {
                      var regex;
                      o = _.mixin({}, defaults, o);
                      if (!o.node || !o.pattern) {
                          return;
          Severity: Minor
          Found in vendor/assets/javascripts/typeahead.bundle.js - About 1 hr to fix

            Function __module0__ has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
              "use strict";
              var __exports__;
              /*globals Handlebars: true */
              var Handlebars = __dependency1__;
            Severity: Minor
            Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

              Function ProgramNode has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ProgramNode: function(statements, inverseStrip, inverse, locInfo) {
                    var inverseLocationInfo, firstInverseNode;
                    if (arguments.length === 3) {
                      locInfo = inverse;
                      inverse = null;
              Severity: Minor
              Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

                Function tokenizers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var tokenizers = function() {
                        "use strict";
                        return {
                            nonword: nonword,
                            whitespace: whitespace,
                Severity: Minor
                Found in vendor/assets/javascripts/typeahead.bundle.js - About 1 hr to fix

                  Function block has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      block: function(block) {
                        var mustache = block.mustache,
                            program = block.program,
                            inverse = block.inverse;
                  
                  
                  Severity: Minor
                  Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

                    Function _get has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                _get: function(url, o, cb) {
                                    var that = this, jqXhr;
                                    if (this.cancelled || url !== this.lastUrl) {
                                        return;
                                    }
                    Severity: Minor
                    Found in vendor/assets/javascripts/typeahead.bundle.js - About 1 hr to fix

                      Function Input has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function Input(o) {
                                  var that = this, onBlur, onFocus, onKeydown, onInput;
                                  o = o || {};
                                  if (!o.input) {
                                      $.error("input is missing");
                      Severity: Minor
                      Found in vendor/assets/javascripts/typeahead.bundle.js - About 1 hr to fix

                        Function equals has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            equals: function(other) {
                              var len = this.opcodes.length;
                              if (other.opcodes.length !== len) {
                                return false;
                              }
                        Severity: Minor
                        Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

                          Function IdNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              IdNode: function(parts, locInfo) {
                                LocationInfo.call(this, locInfo);
                                this.type = "ID";
                          
                                var original = "",
                          Severity: Minor
                          Found in vendor/assets/javascripts/handlebars.js - About 1 hr to fix

                            Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
                            Severity: Major
                            Found in vendor/assets/javascripts/handlebars.js - About 50 mins to fix

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

                                  if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
                                    throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
                                  }
                              Severity: Minor
                              Found in vendor/assets/javascripts/handlebars.js and 1 other location - About 50 mins to fix
                              vendor/assets/javascripts/handlebars.js on lines 1707..1709

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

                              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 (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
                                    throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
                                  }
                              Severity: Minor
                              Found in vendor/assets/javascripts/handlebars.js and 1 other location - About 50 mins to fix
                              vendor/assets/javascripts/handlebars.js on lines 1722..1724

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

                              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.registers[name]) {
                                      this.registers[name] = true;
                                      this.registers.list.push(name);
                                    }
                              Severity: Minor
                              Found in vendor/assets/javascripts/handlebars.js and 1 other location - About 50 mins to fix
                              vendor/assets/javascripts/handlebars.js on lines 1637..1640

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

                              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