Showing 336 of 336 total issues

Avoid deeply nested control flow statements.
Open

                        if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
                            cur += clazz + " ";
                        }
Severity: Major
Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

    Function init has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        init: function( elem, options, prop, end, easing, unit ) {
    Severity: Minor
    Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      } else if ( copy !== undefined ) {
                          target[ name ] = copy;
                      }
      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 ( Expr.relative[ tokens[j].type ] ) {
                                break;
                            }
        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

          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

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

                  def validations(*run_in_actions, &block)
                    unless block_given?
                      raise 'validations must take a block, use `validate` to setup a validation on a class directly.'
                    end
            
            
            Severity: Minor
            Found in lib/volt/models/validations/validations.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 call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def call(env)
                  @child_lock.with_read_lock do
                    if @exiting
                      [500, {}, 'Server Exiting']
                    else
            Severity: Minor
            Found in lib/volt/server/forking_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 deny has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                  def deny(*fields)
                    if @__deny_fields
                      if @__deny_fields != true
                        if fields.size == 0
                          # No field's were passed, this means we deny all
            Severity: Minor
            Found in lib/volt/models/permissions.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 validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                  def validate(field_name = nil, options = nil, &block)
                    if block
                      if field_name || options
                        fail 'validate should be passed a field name and options or a block, not both.'
                      end
            Severity: Minor
            Found in lib/volt/models/validations/validations.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 stop_listening has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                  def stop_listening
                    Timers.client_set_timeout(5000) do
                      Computation.run_without_tracking do
                        if @listener_event_counter.count == 0
                          if @added_to_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 allow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                  def allow(*fields)
                    if @__allow_fields
                      if @__allow_fields != true
                        if fields.size == 0
                          # No field's were passed, this means we deny all
            Severity: Minor
            Found in lib/volt/models/permissions.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 lookup has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def lookup(*args, &block)
                  section = @pool
            
                  # TODO: This is to work around opal issue #500
                  args.pop if args.last.nil? if RUBY_PLATFORM == 'opal'
            Severity: Minor
            Found in lib/volt/utils/generic_pool.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)
                  type   = Rack::Request.new(env).media_type
                  parser = parsers.detect { |content_type, _| type.match(content_type) } if type
                  return @app.call(env) unless parser
                  body = env[POST_BODY].read ; env[POST_BODY].rewind
            Severity: Minor
            Found in lib/volt/server/rack/http_content_types.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 time.is_a?(Numeric)
                              return VoltTime.at(time / 1000.0)
                            end
            Severity: Major
            Found in lib/volt/utils/ejson.rb - 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

              Severity
              Category
              Status
              Source
              Language