Showing 316 of 336 total issues

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

Method dispatch_in_thread has a Cognitive Complexity of 12 (exceeds 5 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: Minor
Found in lib/volt/tasks/dispatcher.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 access has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
        var i = 0,
            length = elems.length,
            bulk = key == null;

Severity: Minor
Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

    Function dispatch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        dispatch: function( event ) {
    
            // Make a writable jQuery.Event from the native event object
            event = jQuery.event.fix( event );
    
    
    Severity: Minor
    Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

      Method item_added has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def item_added(position)
            item_context = nil
      
            binding_name     = @@binding_number
            @@binding_number += 1
      Severity: Minor
      Found in lib/volt/page/bindings/each_binding.rb - About 1 hr to fix

        Method add_linking_in_asset_path has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def add_linking_in_asset_path
              app_path = @volt_app.app_path
              @env.context_class.class_eval do
                # We "freedom-patch" sprockets-helpers asset_path method to
                # automatically link assets.
        Severity: Minor
        Found in lib/volt/server/rack/sprockets_helpers_setup.rb - About 1 hr to fix

          Method validate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def self.validate(model, field_name, args)
                errors = {}
                value  = model.get(field_name)
          
                type_restriction = args.is_a?(Hash) ? (args[:type] || args[:types]) : args
          Severity: Minor
          Found in lib/volt/models/validators/type_validator.rb - About 1 hr to fix

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

                def update(path, section_or_arguments = nil, options = {})
                  Computation.run_without_tracking do
                    @options = options
            
                    # A blank path needs to load a missing template, otherwise it tries to load
            Severity: Minor
            Found in lib/volt/page/bindings/view_binding.rb - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                                      } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
                                          diff = cache[1];
              
                                      // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
                                      } else {
              Severity: Critical
              Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if ( start && start[ 3 ] !== unit ) {
                                // Trust units reported by jQuery.css
                                unit = unit || start[ 3 ];
                
                                // Make sure we update the tween properties later on
                Severity: Critical
                Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                  Function setOffset has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      setOffset: function( elem, options, i ) {
                          var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                              position = jQuery.css( elem, "position" ),
                              curElem = jQuery( elem ),
                              props = {};
                  Severity: Minor
                  Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                    Method parse has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def parse
                          loop do
                            if last && SPECIAL[last]
                              # In a script or style tag, just look for the first end
                              close_tag = "</#{last}>"
                    Severity: Minor
                    Found in lib/volt/server/html_parser/sandlebars_parser.rb - About 1 hr to fix

                      Function load has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      jQuery.fn.load = function( url, params, callback ) {
                          if ( typeof url !== "string" && _load ) {
                              return _load.apply( this, arguments );
                          }
                      
                      
                      Severity: Minor
                      Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                        Function style has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            style: function( elem, name, value, extra ) {
                                // Don't set styles on text and comment nodes
                                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                                    return;
                                }
                        Severity: Minor
                        Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

                          Method update_binding_anchors! has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def update_binding_anchors!(nodes)
                                new_bindings = {}
                          
                                @binding_anchors.each_pair do |name, anchors|
                                  new_name         = @@binding_number
                          Severity: Minor
                          Found in lib/volt/page/targets/dom_template.rb - About 1 hr to fix

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

                              Method field has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    def field(name, klasses = nil, options = {})
                                      if klasses
                                        klasses = [klasses].flatten
                              
                                        unless klasses.any? {|kl| FIELD_CASTS.key?(kl) }
                              Severity: Minor
                              Found in lib/volt/models/field_helpers.rb - About 1 hr to fix

                                Method start_child has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def start_child
                                      # Aquire the write lock, so we prevent anyone from using the child until
                                      # its setup or recreated.
                                      unless @drb_object
                                        # Get the id of the parent process, so we can wait for exit in the child
                                Severity: Minor
                                Found in lib/volt/server/forking_server.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 assign_from_old has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def assign_from_old(params, new_params)
                                      queued_deletes = []
                                
                                      params.attributes.each_pair do |name, old_val|
                                        # If there is a new value, see if it has [name]
                                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 run_initial_setup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def run_initial_setup(initial_setup)
                                      # Save the changes
                                      if initial_setup
                                        # Run initial validation
                                        if Volt.in_mode?(:no_validate)
                                Severity: Minor
                                Found in lib/volt/models/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

                                Severity
                                Category
                                Status
                                Source
                                Language