Showing 316 of 336 total issues

Function CHILD has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        "CHILD": function( type, what, argument, first, last ) {
Severity: Minor
Found in app/volt/assets/js/jquery-2.0.3.js - About 35 mins to fix

    Function augmentWidthOrHeight has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
    Severity: Minor
    Found in app/volt/assets/js/jquery-2.0.3.js - About 35 mins to fix

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

          def initialize(volt_app, target, context, binding_name, branches)
      Severity: Minor
      Found in lib/volt/page/bindings/if_binding.rb - About 35 mins to fix

        Function superMatcher has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                superMatcher = function( seed, context, xml, results, expandContext ) {
        Severity: Minor
        Found in app/volt/assets/js/jquery-2.0.3.js - About 35 mins to fix

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

              def initialize(handler, path, tag_name, attributes, unary)
          Severity: Minor
          Found in lib/volt/server/html_parser/component_view_scope.rb - About 35 mins to fix

            Method log_dispatch has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def log_dispatch(class_name, method_name, run_time, args, error)
            Severity: Minor
            Found in lib/volt/extra_core/logger.rb - About 35 mins to fix

              Method add_multiple_attribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def add_multiple_attribute(tag_name, id, attribute_name, parts, content)
              Severity: Minor
              Found in lib/volt/server/html_parser/attribute_scope.rb - About 35 mins to fix

                Method detect_added_and_moved has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def detect_added_and_moved(skip_channel)
                    previous_index = 0
                    @current_ids.each_with_index do |id, index|
                      if (cur_previous = @previous_ids[previous_index]) && cur_previous == id
                        # Same in both previous and new
                Severity: Minor
                Found in app/volt/tasks/live_query/query_tracker.rb - About 35 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 update_binding_anchors! has a Cognitive Complexity of 7 (exceeds 5 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 35 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_ready has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def call_ready
                      if @controller
                        # Set the current section on the controller if it wants so it can manipulate
                        # the dom if needed.
                        # Only assign sections for action's, so we don't get AttributeSections bound
                Severity: Minor
                Found in lib/volt/page/bindings/view_binding.rb - About 35 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 connect! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def connect!
                      # The websocket url can be overridden by config.public.websocket_url
                      socket_url = Volt.config.try(:public).try(:websocket_url) || begin
                        "#{`document.location.host`}/socket"
                      end
                Severity: Minor
                Found in lib/volt/page/channel.rb - About 35 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 delete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def delete(collection, id)
                    # Load the model, then call .destroy on it
                    query = nil
                
                    Volt.skip_permissions do
                Severity: Minor
                Found in app/volt/tasks/store_tasks.rb - About 35 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 assign_all_attributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def assign_all_attributes(attrs, track_changes = false)
                      # Assign each attribute using setters
                      attrs.each_pair do |key, value|
                        key = key.to_sym
                
                
                Severity: Minor
                Found in lib/volt/models/model.rb - About 35 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 colorize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def colorize(string, color)
                        if STDOUT.tty? && string
                          case color
                          when :cyan
                            "\e[1;34m" + string + "\e[0;37m"
                Severity: Minor
                Found in lib/volt/extra_core/logger.rb - About 35 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 run_changed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        def run_changed(attribute_name = nil)
                          # no_validate mode should only be used internally.  no_validate mode is a
                          # performance optimization that prevents validation from running after each
                          # change when assigning multile attributes.
                          unless Volt.in_mode?(:no_validate)
                Severity: Minor
                Found in lib/volt/models/helpers/change_helpers.rb - About 35 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 sync has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def sync
                    raise ".sync can only be used on the server" if Volt.client?
                
                    result = nil
                    error = nil
                Severity: Minor
                Found in lib/volt/utils/promise_extensions.rb - About 35 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 apply_inflections has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.apply_inflections(word, rules)
                      result = word.to_s.dup
                
                      if word.empty? || inflections.uncountables.include?(result.downcase[/\b\w+\Z/])
                        result
                Severity: Minor
                Found in lib/volt/extra_core/inflector/methods.rb - About 35 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 <=> has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def <=>(other)
                    if Time === other
                      to_f <=> other.to_f
                    else
                      r = other <=> self
                Severity: Minor
                Found in lib/volt/utils/time_opal_patch.rb - About 35 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 parse_query has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def parse_query
                      query_hash = {}
                      qury = query
                
                      if qury
                Severity: Minor
                Found in lib/volt/models/url.rb - About 35 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 release_read_lock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def release_read_lock
                    loop do
                      c = @counter.value
                      if @counter.compare_and_swap(c, c - 1)
                        # If one or more writers were waiting, and we were the last reader, wake a writer up
                Severity: Minor
                Found in lib/volt/utils/read_write_lock.rb - About 35 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