Showing 316 of 336 total issues

Avoid deeply nested control flow statements.
Open

                    if ( copyIsArray ) {
                        copyIsArray = false;
                        clone = src && jQuery.isArray(src) ? src : [];

                    } else {
Severity: Major
Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

    Method handle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def handle(event_name, event, *args)
          element = `$(event.target || event.originalEvent.target)`
    
          loop do
            # Lookup the handler, make sure to not assume the group
    Severity: Minor
    Found in lib/volt/page/document_events.rb - About 45 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

    Avoid deeply nested control flow statements.
    Open

                        if ( conv && s[ "throws" ] ) {
                            response = conv( response );
                        } else {
                            try {
                                response = conv( response );
    Severity: Major
    Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if ( elem && elem.parentNode ) {
                              // Handle the case where IE, Opera, and Webkit return items
                              // by name instead of ID
                              if ( elem.id === m ) {
                                  results.push( elem );
      Severity: Major
      Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( hasScripts ) {
                                    // Support: QtWebKit
                                    // jQuery.merge because core_push.apply(_, arraylike) throws
                                    jQuery.merge( scripts, getAll( node, "script" ) );
                                }
        Severity: Major
        Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              for ( conv2 in converters ) {
          
                                  // If conv2 outputs current
                                  tmp = conv2.split( " " );
                                  if ( tmp[ 1 ] === current ) {
          Severity: Major
          Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

            Method update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def update(new_value)
                  if @attribute_name == 'checked'
                    update_checked(new_value)
                    return
                  end
            Severity: Minor
            Found in lib/volt/page/bindings/attribute_binding.rb - About 45 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

            Avoid deeply nested control flow statements.
            Open

                                                if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
                                                    return false;
                                                }
            Severity: Major
            Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for ( match in context ) {
                                          // Properties of context are called as methods if possible
                                          if ( jQuery.isFunction( this[ match ] ) ) {
                                              this[ match ]( context[ match ] );
              
              
              Severity: Major
              Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ( !(unmatched[i] || setMatched[i]) ) {
                                                setMatched[i] = pop.call( results );
                                            }
                Severity: Major
                Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if ( name.indexOf( "data-" ) === 0 ) {
                                              name = jQuery.camelCase( name.slice(5) );
                                              dataAttr( elem, name, data[ name ] );
                                          }
                  Severity: Major
                  Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
                                                        // Cache the index of each encountered element
                                                        if ( useCache ) {
                                                            (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
                                                        }
                    Severity: Major
                    Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if ( matches[ sel ] === undefined ) {
                                                  matches[ sel ] = handleObj.needsContext ?
                                                      jQuery( sel, this ).index( cur ) >= 0 :
                                                      jQuery.find( sel, this, null, [ cur ] ).length;
                                              }
                      Severity: Major
                      Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

                        Method query_listener has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def query_listener
                                return @query_listener if @query_listener
                        
                                collection = @model.path.last
                                query = @query
                        Severity: Minor
                        Found in lib/volt/models/persistors/array_store.rb - About 45 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 call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def call(env)
                            path = env['PATH_INFO']
                            began_at = Time.now
                            status, header, body = @app.call(env)
                            header = Utils::HeaderHash.new(header)
                        Severity: Minor
                        Found in lib/volt/server/rack/quiet_common_logger.rb - About 45 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 end_tag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def end_tag(tag, tag_name)
                              # If no tag name is provided, close all the way up
                              new_size = 0
                        
                              if tag
                        Severity: Minor
                        Found in lib/volt/server/html_parser/sandlebars_parser.rb - About 45 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 start_tag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def start_tag(tag_name, attributes, unary)
                              case tag_name[0]
                                when ':'
                                  # Component
                                  last.add_component(tag_name, attributes, unary)
                        Severity: Minor
                        Found in lib/volt/server/html_parser/view_handler.rb - About 45 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 app has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def app
                              # Setup the rack server and adaptor
                              RackServerAdaptor.load
                        
                              app = Rack::Builder.new
                        Severity: Minor
                        Found in lib/volt/server.rb - About 45 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 method_missing has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def method_missing(method_name, *args, &block)
                              if method_name[0] == '_'
                                # Remove underscore
                                method_name = method_name[1..-1]
                                if method_name[-1] == '='
                        Severity: Minor
                        Found in lib/volt/models/model.rb - About 45 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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                              def initialize(socket, ips, port, message_bus, server=false, peer_server_id=nil)
                        Severity: Minor
                        Found in lib/volt/server/message_bus/peer_to_peer/peer_connection.rb - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language