Showing 336 of 336 total issues

Function data has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    data: function( key, value ) {
        var attrs, name,
            elem = this[ 0 ],
            i = 0,
            data = null;
Severity: Major
Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

    Method dispatch_in_thread has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def dispatch_in_thread(channel, message)
          callback_id, class_name, method_name, meta_data, *args = message
          method_name = method_name.to_sym
    
          # Get the class
    Severity: Major
    Found in lib/volt/tasks/dispatcher.rb - About 2 hrs to fix

      Function remove has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          remove: function( elem, types, handler, selector, mappedTypes ) {
      
              var j, origCount, tmp,
                  events, t, handleObj,
                  special, handlers, type, namespaces, origType,
      Severity: Minor
      Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                        if ( ( mappedTypes || origType === handleObj.origType ) &&
                            ( !handler || handler.guid === handleObj.guid ) &&
                            ( !tmp || tmp.test( handleObj.namespace ) ) &&
                            ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                            handlers.splice( j, 1 );
        Severity: Critical
        Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

          Method add_binding has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def add_binding(content)
                content = content.strip
                index   = content.index(/[ \(]/)
                if index
                  first_symbol = content[0...index]
          Severity: Minor
          Found in lib/volt/server/html_parser/view_scope.rb - About 2 hrs to fix

            Function buildFragment has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                buildFragment: function( elems, context, scripts, selection ) {
                    var elem, tmp, tag, wrap, contains, j,
                        i = 0,
                        l = elems.length,
                        fragment = context.createDocumentFragment(),
            Severity: Minor
            Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

              Method call_action has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def call_action(stage_prefix = nil, stage_suffix = nil)
                    return unless @action
              
                    has_stage = stage_prefix || stage_suffix
              
              
              Severity: Minor
              Found in lib/volt/page/bindings/view_binding/controller_handler.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

              Method setup has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def setup
                    if `#{element}.is('select')`
                      @is_select = true
                    elsif `#{element}.is('[type=hidden]')`
                      @is_hidden = true
              Severity: Minor
              Found in lib/volt/page/bindings/attribute_binding.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

              Method setup_action_helpers_in_class has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                    def setup_action_helpers_in_class(*callback_names)
                      callback_names.each do |callback_name|
                        # Setup a class attribute to track the
                        callbacks_var_name = :"#{callback_name}_callbacks"
                        class_attribute(callbacks_var_name)
              Severity: Minor
              Found in lib/volt/utils/lifecycle_callbacks.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 send has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          send: function( headers, complete ) {
                              var i, id,
                                  xhr = options.xhr();
                              xhr.open( options.type, options.url, options.async, options.username, options.password );
                              // Apply custom fields if provided
              Severity: Minor
              Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function tokenize( selector, parseOnly ) {
                    var matched, match, tokens, type,
                        soFar, groups, preFilters,
                        cached = tokenCache[ selector + " " ];
                
                
                Severity: Minor
                Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                  Function select has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function select( selector, context, results, seed ) {
                      var i, tokens, token, type, find,
                          match = tokenize( selector );
                  
                      if ( !seed ) {
                  Severity: Minor
                  Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

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

                                    event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
                    Severity: Major
                    Found in app/volt/assets/js/jquery-2.0.3.js and 1 other location - About 1 hr to fix
                    app/volt/assets/js/jquery-2.0.3.js on lines 4773..4773

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

                    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

                                    event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
                    Severity: Major
                    Found in app/volt/assets/js/jquery-2.0.3.js and 1 other location - About 1 hr to fix
                    app/volt/assets/js/jquery-2.0.3.js on lines 4772..4772

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

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

                    function matcherFromTokens( tokens ) {
                        var checkContext, matcher, j,
                            len = tokens.length,
                            leadingRelative = Expr.relative[ tokens[0].type ],
                            implicitRelative = leadingRelative || Expr.relative[" "],
                    Severity: Minor
                    Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                      Method server has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def server
                            move_to_root
                            if ENV['PROFILE_BOOT']
                              begin
                                require 'ruby-prof'
                      Severity: Minor
                      Found in lib/volt/cli.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

                      Method start_tag has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def start_tag(tag, tag_name, rest, unary)
                            section_tag = tag_name[0] == ':' && tag_name[1] =~ /[A-Z]/
                      
                            if section_tag
                              tag_name = tag_name.underscore
                      Severity: Minor
                      Found in lib/volt/server/html_parser/sandlebars_parser.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

                      Method create_new_model has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def create_new_model(model, from_method)
                            if model.is_a?(Model)
                              if model.buffer?
                                fail "The #{from_method} does not take a buffer.  Call .save! on buffer's to persist them."
                              end
                      Severity: Minor
                      Found in lib/volt/models/array_model.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

                      Method repl has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def repl
                            loop do
                              case val = read
                              when :control_c
                                output.puts ''
                      Severity: Minor
                      Found in lib/volt/cli/console.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 addCombinator has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function addCombinator( matcher, combinator, base ) {
                          var dir = combinator.dir,
                              checkNonElements = base && dir === "parentNode",
                              doneName = done++;
                      
                      
                      Severity: Minor
                      Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language