Showing 336 of 336 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if ( jQuery.isFunction( html ) ) {
            return this.each(function( i ) {
                jQuery( this ).wrapInner( html.call(this, i) );
            });
        }
Severity: Major
Found in app/volt/assets/js/jquery-2.0.3.js and 1 other location - About 1 hr to fix
app/volt/assets/js/jquery-2.0.3.js on lines 5993..5997

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if ( jQuery.isFunction( html ) ) {
            return this.each(function( i ) {
                jQuery( this ).wrapAll( html.call(this, i) );
            });
        }
Severity: Major
Found in app/volt/assets/js/jquery-2.0.3.js and 1 other location - About 1 hr to fix
app/volt/assets/js/jquery-2.0.3.js on lines 6023..6027

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function off has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    off: function( types, selector, fn ) {
        var handleObj, type;
        if ( types && types.preventDefault && types.handleObj ) {
            // ( event )  dispatched jQuery.Event
            handleObj = types.handleObj;
Severity: Minor
Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

    Function clone has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        clone: function( elem, dataAndEvents, deepDataAndEvents ) {
            var i, l, srcElements, destElements,
                clone = elem.cloneNode( true ),
                inPage = jQuery.contains( elem.ownerDocument, elem );
    
    
    Severity: Minor
    Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

      Function * has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              "*": [function( prop, value ) {
                  var tween = this.createTween( prop, value ),
                      target = tween.cur(),
                      parts = rfxnum.exec( value ),
                      unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
      Severity: Minor
      Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

        Function offset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.fn.offset = function( options ) {
            if ( arguments.length ) {
                return options === undefined ?
                    this :
                    this.each(function( i ) {
        Severity: Minor
        Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

          Method start_tag has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def start_tag(tag, tag_name, rest, unary)
                section_tag = tag_name[0] == ':' && tag_name[1] =~ /[A-Z]/
          
                if section_tag
                  tag_name = tag_name.underscore
          Severity: Minor
          Found in lib/volt/server/html_parser/sandlebars_parser.rb - About 1 hr to fix

            Method compile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def compile
                  say "Starting Precompile...", :red
                  require 'fileutils'
                  ENV['SERVER'] = 'true'
                  ENV['MAPS'] = 'false'
            Severity: Minor
            Found in lib/volt/cli/asset_compile.rb - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                          if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                                  support.getById && context.nodeType === 9 && documentIsHTML &&
                                  Expr.relative[ tokens[1].type ] ) {
              
                              context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
              Severity: Major
              Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

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

                    def initialize(volt_app, target, context, binding_name, getter, variable_name, index_name, template_name)
                Severity: Major
                Found in lib/volt/page/bindings/each_binding.rb - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          "odd": createPositionalPseudo(function( matchIndexes, length ) {
                              var i = 1;
                              for ( ; i < length; i += 2 ) {
                                  matchIndexes.push( i );
                              }
                  Severity: Minor
                  Found in app/volt/assets/js/jquery-2.0.3.js and 1 other location - About 55 mins to fix
                  app/volt/assets/js/jquery-2.0.3.js on lines 2214..2220

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 54.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          "even": createPositionalPseudo(function( matchIndexes, length ) {
                              var i = 0;
                              for ( ; i < length; i += 2 ) {
                                  matchIndexes.push( i );
                              }
                  Severity: Minor
                  Found in app/volt/assets/js/jquery-2.0.3.js and 1 other location - About 55 mins to fix
                  app/volt/assets/js/jquery-2.0.3.js on lines 2222..2228

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 54.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Method login has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def login(login_info)
                      login = login_info['login']
                      password = login_info['password']
                  
                      query = { User.login_field => login }
                  Severity: Minor
                  Found in app/volt/tasks/user_tasks.rb - About 55 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 value= has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def value=(val)
                        case @attribute_name
                          when 'value'
                            if @is_option
                              # When a new option is added, we trigger the invalidate event on the
                  Severity: Minor
                  Found in lib/volt/page/bindings/attribute_binding.rb - About 55 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 rezero_bindings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def rezero_bindings(html, bindings)
                        @@base_binding_id ||= 20_000
                        # rezero
                        parts  = html.split(/(\<\!\-\- \$\/?[0-9]+ \-\-\>)/).reject { |v| v == '' }
                  
                  
                  Severity: Minor
                  Found in lib/volt/page/targets/attribute_section.rb - About 55 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 own_by_user has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def own_by_user(key = :user_id)
                            relation, pattern = key.to_s, /_id$/
                            if relation.match(pattern)
                              belongs_to key.to_s.gsub(pattern, '')
                            else
                  Severity: Minor
                  Found in lib/volt/models/permissions.rb - About 55 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 filter_args has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def filter_args(args)
                      if args.is_a?(Array)
                        args.map { |v| filter_args(v) }
                      elsif args.is_a?(Hash)
                        args.map do |k, v|
                  Severity: Minor
                  Found in lib/volt/utils/logging/task_argument_filterer.rb - About 55 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 add_listener has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def add_listener
                        @listening = true
                  
                        # Call the backend and add the listner
                        QueryTasks.add_listener(@collection, @query).then do |ret|
                  Severity: Minor
                  Found in lib/volt/models/persistors/query/query_listener.rb - About 55 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 component has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def component(name)
                        unless @included_components[name]
                          # Track that we added
                          @included_components[name] = true
                  
                  
                  Severity: Minor
                  Found in lib/volt/server/rack/asset_files.rb - About 55 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 inspect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def inspect
                      result = "#<#{self.class}(#{object_id})"
                  
                      if @next
                        result += " >> #{@next.inspect}"
                  Severity: Minor
                  Found in lib/volt/utils/promise_extensions.rb - About 55 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