Showing 316 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 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 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_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

                    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

                        Method setup has 40 lines of code (exceeds 25 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

                          Function stop has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              stop: function( type, clearQueue, gotoEnd ) {
                                  var stopQueue = function( hooks ) {
                                      var stop = hooks.stop;
                                      delete hooks.stop;
                                      stop( gotoEnd );
                          Severity: Minor
                          Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language