Showing 316 of 336 total issues

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 ( Expr.relative[ tokens[j].type ] ) {
                        break;
                    }
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 ( (event.result = ret) === false ) {
                                event.preventDefault();
                                event.stopPropagation();
                            }
    Severity: Major
    Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

      Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(volt_app, target, context, binding_name, event_name, call_proc)
      Severity: Minor
      Found in lib/volt/page/bindings/event_binding.rb - About 45 mins to fix

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

            def remove
              # Unbind events, leave the element there since attribute bindings
              # aren't responsible for it being there.
              case @attribute_name
                when 'value'
        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 ( 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 ( !(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 ( cache[1] === true ) {
                                              return true;
                                          }
              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

                                } 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 ( (data = cache[1]) === true || data === cachedruns ) {
                                                  return data === true;
                                              }
                  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 ( (seed = find(
                                            token.matches[0].replace( runescape, funescape ),
                                            rsibling.test( tokens[0].type ) && context.parentNode || context
                                        )) ) {
                    
                    
                    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 ( cur.indexOf( " " + clazz + " " ) < 0 ) {
                                                  cur += clazz + " ";
                                              }
                      Severity: Major
                      Found in app/volt/assets/js/jquery-2.0.3.js - About 45 mins to fix

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

                        Severity
                        Category
                        Status
                        Source
                        Language