Showing 336 of 336 total issues

File jquery-2.0.3.js has 6037 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v2.0.3
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in app/volt/assets/js/jquery-2.0.3.js - About 2 wks to fix

    File time_opal_patch.rb has 590 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'corelib/comparable'
    
    class Time 
      include Comparable
    
    
    Severity: Major
    Found in lib/volt/utils/time_opal_patch.rb - About 1 day to fix

      Function ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ajax: function( url, options ) {
      
              // If url is an object, simulate pre-1.5 signature
              if ( typeof url === "object" ) {
                  options = url;
      Severity: Major
      Found in app/volt/assets/js/jquery-2.0.3.js - About 1 day to fix

        Function setDocument has 200 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        setDocument = Sizzle.setDocument = function( node ) {
            var doc = node ? node.ownerDocument || node : preferredDoc,
                parent = doc.defaultView;
        
            // If no document and documentElement is available, return
        Severity: Major
        Found in app/volt/assets/js/jquery-2.0.3.js - About 1 day to fix

          Method strftime has 184 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def strftime(format)
              %x{
                return format.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g, function(full, flags, width, _, conv) {
                  var result = "",
                      zero   = flags.indexOf('0') !== -1,
          Severity: Major
          Found in lib/volt/utils/time_opal_patch.rb - About 7 hrs to fix

            Class Time has 42 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Time 
              include Comparable
            
              %x{
                var days_of_week = #{%w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday]},
            Severity: Minor
            Found in lib/volt/utils/time_opal_patch.rb - About 5 hrs to fix

              Function Callbacks has 128 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jQuery.Callbacks = function( options ) {
              
                  // Convert options from String-formatted to Object-formatted if needed
                  // (we check in cache first)
                  options = typeof options === "string" ?
              Severity: Major
              Found in app/volt/assets/js/jquery-2.0.3.js - About 5 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                            if ( event.pageX == null && original.clientX != null ) {
                                eventDoc = event.target.ownerDocument || document;
                                doc = eventDoc.documentElement;
                                body = eventDoc.body;
                
                
                Severity: Critical
                Found in app/volt/assets/js/jquery-2.0.3.js - About 5 hrs to fix

                  Class ArrayModel has 34 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class ArrayModel < ReactiveArray
                      include ModelWrapper
                      include Models::Helpers::Base
                      include StateManager
                      include Models::Helpers::ArrayModel
                  Severity: Minor
                  Found in lib/volt/models/array_model.rb - About 4 hrs to fix

                    Method add_linking_in_asset_path has a Cognitive Complexity of 26 (exceeds 5 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 3 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 defaultPrefilter has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function defaultPrefilter( elem, props, opts ) {
                        /* jshint validthis: true */
                        var prop, value, toggle, tween, hooks, oldfire,
                            anim = this,
                            orig = {},
                    Severity: Major
                    Found in app/volt/assets/js/jquery-2.0.3.js - About 3 hrs to fix

                      Method save! has a Cognitive Complexity of 25 (exceeds 5 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 3 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 included has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def self.included(base)
                          base.class_eval do
                            include Thor::Actions
                      
                            desc 'model NAME COMPONENT', 'Creates a model named NAME in the component named COMPONENT'
                      Severity: Major
                      Found in lib/volt/cli/generators.rb - About 3 hrs to fix

                        Function Animation has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function Animation( elem, properties, options ) {
                            var result,
                                stopped,
                                index = 0,
                                length = animationPrefilters.length,
                        Severity: Major
                        Found in app/volt/assets/js/jquery-2.0.3.js - About 3 hrs to fix

                          Class Model has 28 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class Model
                              include LifecycleCallbacks
                              include ModelWrapper
                              include Models::Helpers::Base
                              include ModelHashBehaviour
                          Severity: Minor
                          Found in lib/volt/models/model.rb - About 3 hrs to fix

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

                            class VoltTime
                              
                              COMMON_YEAR_DAYS_IN_MONTH = [nil, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
                              
                              class << self
                            Severity: Minor
                            Found in lib/volt/helpers/time/calculations.rb - About 3 hrs to fix

                              Function trigger has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  trigger: function( event, data, elem, onlyHandlers ) {
                              
                                      var i, cur, tmp, bubbleType, ontype, handle, special,
                                          eventPath = [ elem || document ],
                                          type = core_hasOwn.call( event, "type" ) ? event.type : event,
                              Severity: Major
                              Found in app/volt/assets/js/jquery-2.0.3.js - About 3 hrs to fix

                                Method update has a Cognitive Complexity of 23 (exceeds 5 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 3 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 decode has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def self.decode(obj)
                                      if Array === obj
                                        obj.map {|v| decode(v) }
                                      elsif Hash === obj
                                        if obj.size == 1 && (escape = obj['$escape'])
                                Severity: Minor
                                Found in lib/volt/utils/ejson.rb - About 3 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 match_path has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def match_path(original_parts, remaining_parts, node)
                                      # Take off the top part and get the rest into a new array
                                      # part will be nil if we are out of parts (fancy how that works out, now
                                      # stand in wonder about how much someone thought this through, though
                                      # really I just got lucky)
                                Severity: Minor
                                Found in lib/volt/router/routes.rb - About 3 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