Showing 336 of 336 total issues

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

jQuery.extend = jQuery.fn.extend = function() {
    var options, name, src, copy, copyIsArray, clone,
        target = arguments[0] || {},
        i = 1,
        length = arguments.length,
Severity: Minor
Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

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

        val: function( value ) {
            var hooks, ret, isFunction,
                elem = this[0];
    
            if ( !arguments.length ) {
    Severity: Minor
    Found in app/volt/assets/js/jquery-2.0.3.js - 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

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

            on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
                var origFn, type;
        
                // Types can be a map of types/handlers
                if ( typeof types === "object" ) {
        Severity: Minor
        Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

          Method update has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def update
                # Find the true branch
                true_template = nil
                @branches.each do |branch|
                  value, template_name = branch
          Severity: Minor
          Found in lib/volt/page/bindings/if_binding.rb - 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

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

                Method initialize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def initialize(handler, path, tag_name, attributes, unary)
                      super(handler, path)
                
                      @binding_in_path = path
                
                
                Severity: Minor
                Found in lib/volt/server/html_parser/component_view_scope.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 url_for has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def url_for(params)
                      host_with_port = host || location.host
                      host_with_port += ":#{port}" if port && port != 80
                      scheme = scheme || location.scheme
                
                
                Severity: Minor
                Found in lib/volt/models/url.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 reconnect! has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def reconnect!
                        # Stop trying to reconnect if we are disconnected
                        return false if @disconnected
                
                        # Don't reconnect on the server instances
                Severity: Minor
                Found in lib/volt/server/message_bus/peer_to_peer/peer_connection.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 encode has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.encode(obj)
                      if Array === obj
                        obj.map {|v| encode(v) }
                      elsif Hash === obj
                        obj.map do |key, value|
                Severity: Minor
                Found in lib/volt/utils/ejson.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 log_dispatch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def log_dispatch(class_name, method_name, run_time, args, error)
                        @current = {
                          args: args,
                          class_name: class_name,
                          method_name: method_name,
                Severity: Minor
                Found in lib/volt/extra_core/logger.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 initialize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def initialize(app_path=nil)
                      app_path ||= Dir.pwd
                
                      if Volt.server? && !app_path
                        raise "Volt::App.new requires an app path to boot"
                Severity: Minor
                Found in lib/volt/volt/app.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 each has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    each: function( obj, callback, args ) {
                        var value,
                            i = 0,
                            length = obj.length,
                            isArray = isArraylike( obj );
                Severity: Minor
                Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                  Method proxy_with_load has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def self.proxy_with_load(*method_names)
                        imethods = instance_methods(false)
                        method_names.each do |method_name|
                          # Sometimes we want to alias a method_missing method, so we use super
                          # instead to call it, if its not defined locally.
                  Severity: Minor
                  Found in lib/volt/models/array_model.rb - About 1 hr to fix

                    Function ajaxHandleResponses has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function ajaxHandleResponses( s, jqXHR, responses ) {
                    
                        var ct, type, finalDataType, firstDataType,
                            contents = s.contents,
                            dataTypes = s.dataTypes;
                    Severity: Minor
                    Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                      Function showHide has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function showHide( elements, show ) {
                          var display, elem, hidden,
                              values = [],
                              index = 0,
                              length = elements.length;
                      Severity: Minor
                      Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                        Function when has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            when: function( subordinate /* , ..., subordinateN */ ) {
                                var i = 0,
                                    resolveValues = core_slice.call( arguments ),
                                    length = resolveValues.length,
                        
                        
                        Severity: Minor
                        Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                          Method save! has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def save!(&block)
                                # TODO: this shouldn't need to be run, but if no attributes are assigned, then
                                # if needs to be run.  Maybe there's a better way to handle it.
                                validate!.then do
                                  # Get errors from validate
                          Severity: Minor
                          Found in lib/volt/models/buffer.rb - About 1 hr to fix

                            Method getter_to_setter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def getter_to_setter(getter)
                                  getter = getter.strip.gsub(/\(\s*\)/, '')
                            
                                  # Check to see if this can be converted to a setter
                                  if getter[0] =~ /^[A-Z]/ && getter[-1] != ')'
                            Severity: Minor
                            Found in lib/volt/server/html_parser/attribute_scope.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

                            Severity
                            Category
                            Status
                            Source
                            Language