Showing 316 of 336 total issues

Method check_params_match has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def check_params_match(test_params, param_matcher)
      param_matcher.each_pair do |key, value|
        if value.is_a?(Hash)
          if test_params[key]
            result = check_params_match(test_params[key], value)
Severity: Minor
Found in lib/volt/router/routes.rb - About 2 hrs 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 _watch has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var _watch = function (elements, props, options, callback){

    // Setup
    var self = this;
    var check;
Severity: Major
Found in app/volt/assets/js/volt_watch.js - About 2 hrs to fix

    File array_model.rb has 273 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'volt/reactive/reactive_array'
    require 'volt/models/model_wrapper'
    require 'volt/models/helpers/base'
    require 'volt/models/state_manager'
    require 'volt/models/helpers/array_model'
    Severity: Minor
    Found in lib/volt/models/array_model.rb - About 2 hrs to fix

      Function superMatcher has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              superMatcher = function( seed, context, xml, results, expandContext ) {
                  var elem, j, matcher,
                      setMatched = [],
                      matchedCount = 0,
                      i = "0",
      Severity: Major
      Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

        Class ArrayStore has 23 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class ArrayStore < Store
              include StoreState
        
        
              @@query_pool = QueryListenerPool.new
        Severity: Minor
        Found in lib/volt/models/persistors/array_store.rb - About 2 hrs to fix

          Method listen has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

                def listen
                  loop do
                    begin
                      while (message = @message_encoder.receive_message(@socket))
                        break if @disconnected
          Severity: Minor
          Found in lib/volt/server/message_bus/peer_to_peer/peer_connection.rb - About 2 hrs 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 has a Cognitive Complexity of 18 (exceeds 5 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 2 hrs 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 class_at_path has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

                    def class_at_path(path)
                      if path
                        # remove the _ and then singularize/pluralize
                        if path.last == :[]
                          index = -2
          Severity: Minor
          Found in lib/volt/models/helpers/base.rb - About 2 hrs 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 Deferred has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Deferred: function( func ) {
                  var tuples = [
                          // action, add listener, listener list, final state
                          [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
                          [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
          Severity: Major
          Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

            Function CHILD has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    "CHILD": function( type, what, argument, first, last ) {
                        var simple = type.slice( 0, 3 ) !== "nth",
                            forward = type.slice( -4 ) !== "last",
                            ofType = what === "of-type";
            
            
            Severity: Major
            Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                      if ( forward && useCache ) {
                                          // Seek `elem` from a previously-cached index
                                          outerCache = parent[ expando ] || (parent[ expando ] = {});
                                          cache = outerCache[ type ] || [];
                                          nodeIndex = cache[0] === dirruns && cache[1];
              Severity: Critical
              Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

                Class VoltTime has 22 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class VoltTime
                  # Since VoltTime is required by the user, we don't add it to the FIELD_CASTS
                  # list until after it is included, since we don't have access to the class
                  # here.
                  if defined?(Volt::FieldHelpers)
                Severity: Minor
                Found in lib/volt/helpers/time/volt_time.rb - About 2 hrs to fix

                  Function support has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jQuery.support = (function( support ) {
                      var input = document.createElement("input"),
                          fragment = document.createDocumentFragment(),
                          div = document.createElement("div"),
                          select = document.createElement("select"),
                  Severity: Major
                  Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

                    Method changed has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def changed(attribute_name = nil)
                            path = @model.path
                    
                            promise = Promise.new
                    
                    
                    Severity: Minor
                    Found in lib/volt/models/persistors/model_store.rb - About 2 hrs 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 ajaxConvert has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function ajaxConvert( s, response, jqXHR, isSuccess ) {
                        var conv2, current, conv, tmp, prev,
                            converters = {},
                            // Work with a copy of dataTypes in case we need to modify it for conversion
                            dataTypes = s.dataTypes.slice();
                    Severity: Major
                    Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

                      Function init has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          init: function( selector, context, rootjQuery ) {
                              var match, elem;
                      
                              // HANDLE: $(""), $(null), $(undefined), $(false)
                              if ( !selector ) {
                      Severity: Major
                      Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

                        Function domManip has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            domManip: function( args, callback, allowIntersection ) {
                        
                                // Flatten any nested arrays
                                args = core_concat.apply( [], args );
                        
                        
                        Severity: Major
                        Found in app/volt/assets/js/jquery-2.0.3.js - About 2 hrs to fix

                          Method run_permissions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def run_permissions(action_name = nil)
                                  compute_allow_and_deny(action_name).then do
                          
                                    errors = {}
                          
                          
                          Severity: Minor
                          Found in lib/volt/models/permissions.rb - About 2 hrs 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 proxy_with_load has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 add_binding has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def add_binding(content)
                                content = content.strip
                                index   = content.index(/[ \(]/)
                                if index
                                  first_symbol = content[0...index]
                          Severity: Minor
                          Found in lib/volt/server/html_parser/view_scope.rb - About 2 hrs 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