krafthaus/bauhaus

View on GitHub
bower_components/jquery/src/event.js

Summary

Maintainability
F
1 mo
Test Coverage

File event.js has 729 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define([
    "./core",
    "./var/strundefined",
    "./var/rnotwhite",
    "./var/hasOwn",
Severity: Major
Found in bower_components/jquery/src/event.js - About 1 day 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 bower_components/jquery/src/event.js - About 5 hrs to fix

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

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

        Function add has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            add: function( elem, types, handler, data, selector ) {
                var tmp, events, t, handleObjIn,
                    special, eventHandle, handleObj,
                    handlers, type, namespaces, origType,
                    elemData = jQuery._data( elem );
        Severity: Major
        Found in bower_components/jquery/src/event.js - About 2 hrs to fix

          Function remove has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              remove: function( elem, types, handler, selector, mappedTypes ) {
                  var j, handleObj, tmp,
                      origCount, t, events,
                      special, handlers, type,
                      namespaces, origType,
          Severity: Major
          Found in bower_components/jquery/src/event.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                            if ( ( mappedTypes || origType === handleObj.origType ) &&
                                ( !handler || handler.guid === handleObj.guid ) &&
                                ( !tmp || tmp.test( handleObj.namespace ) ) &&
                                ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                                handlers.splice( j, 1 );
            Severity: Critical
            Found in bower_components/jquery/src/event.js - About 2 hrs to fix

              Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
                      var type, origFn;
              
                      // Types can be a map of types/handlers
                      if ( typeof types === "object" ) {
              Severity: Minor
              Found in bower_components/jquery/src/event.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 bower_components/jquery/src/event.js - About 1 hr to fix

                  Function handlers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      handlers: function( event, handlers ) {
                          var sel, handleObj, matches, i,
                              handlerQueue = [],
                              delegateCount = handlers.delegateCount,
                              cur = event.target;
                  Severity: Minor
                  Found in bower_components/jquery/src/event.js - About 1 hr to fix

                    Function fix has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        fix: function( event ) {
                            if ( event[ jQuery.expando ] ) {
                                return event;
                            }
                    
                    
                    Severity: Minor
                    Found in bower_components/jquery/src/event.js - About 1 hr to fix

                      Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              setup: function() {
                      
                                  if ( rformElems.test( this.nodeName ) ) {
                                      // IE doesn't fire change on a check/radio until blur; trigger it on click
                                      // after a propertychange. Eat the blur-change in special.change.handle.
                      Severity: Minor
                      Found in bower_components/jquery/src/event.js - About 1 hr to fix

                        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 bower_components/jquery/src/event.js - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ( matches[ sel ] === undefined ) {
                                                      matches[ sel ] = handleObj.needsContext ?
                                                          jQuery( sel, this ).index( cur ) >= 0 :
                                                          jQuery.find( sel, this, null, [ cur ] ).length;
                                                  }
                          Severity: Major
                          Found in bower_components/jquery/src/event.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if ( matches[ sel ] ) {
                                                        matches.push( handleObj );
                                                    }
                            Severity: Major
                            Found in bower_components/jquery/src/event.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ( (event.result = ret) === false ) {
                                                          event.preventDefault();
                                                          event.stopPropagation();
                                                      }
                              Severity: Major
                              Found in bower_components/jquery/src/event.js - About 45 mins to fix

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

                                    on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
                                Severity: Minor
                                Found in bower_components/jquery/src/event.js - About 35 mins to fix

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

                                      remove: function( elem, types, handler, selector, mappedTypes ) {
                                  Severity: Minor
                                  Found in bower_components/jquery/src/event.js - About 35 mins to fix

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

                                        add: function( elem, types, handler, data, selector ) {
                                    Severity: Minor
                                    Found in bower_components/jquery/src/event.js - About 35 mins to fix

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

                                      jQuery.event = {
                                      
                                          global: {},
                                      
                                          add: function( elem, types, handler, data, selector ) {
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 1 mo to fix
                                      bower_components/jquery/dist/jquery.js on lines 4273..4885

                                      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 5025.

                                      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

                                      jQuery.fn.extend({
                                      
                                          on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
                                              var type, origFn;
                                      
                                      
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 4 days to fix
                                      bower_components/jquery/dist/jquery.js on lines 5168..5269

                                      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 767.

                                      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 ( !support.changeBubbles ) {
                                      
                                          jQuery.event.special.change = {
                                      
                                              setup: function() {
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 3 days to fix
                                      bower_components/jquery/dist/jquery.js on lines 5076..5132

                                      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 531.

                                      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

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

                                      if ( !support.submitBubbles ) {
                                      
                                          jQuery.event.special.submit = {
                                              setup: function() {
                                                  // Only need this for delegated form submit events
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 1 day to fix
                                      bower_components/jquery/dist/jquery.js on lines 5029..5073

                                      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 343.

                                      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 ( !support.focusinBubbles ) {
                                          jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
                                      
                                              // Attach a single capturing handler on the document while someone wants focusin/focusout
                                              var handler = function( event ) {
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 1 day to fix
                                      bower_components/jquery/dist/jquery.js on lines 5135..5166

                                      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 290.

                                      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

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

                                      jQuery.Event.prototype = {
                                          isDefaultPrevented: returnFalse,
                                          isPropagationStopped: returnFalse,
                                          isImmediatePropagationStopped: returnFalse,
                                      
                                      
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 1 day to fix
                                      bower_components/jquery/dist/jquery.js on lines 4947..4997

                                      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 272.

                                      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

                                      jQuery.Event = function( src, props ) {
                                          // Allow instantiation without the 'new' keyword
                                          if ( !(this instanceof jQuery.Event) ) {
                                              return new jQuery.Event( src, props );
                                          }
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 1 day to fix
                                      bower_components/jquery/dist/jquery.js on lines 4908..4943

                                      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 243.

                                      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

                                      jQuery.each({
                                          mouseenter: "mouseover",
                                          mouseleave: "mouseout",
                                          pointerenter: "pointerover",
                                          pointerleave: "pointerout"
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 1 day to fix
                                      bower_components/jquery/dist/jquery.js on lines 5000..5026

                                      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 200.

                                      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

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

                                      jQuery.removeEvent = document.removeEventListener ?
                                          function( elem, type, handle ) {
                                              if ( elem.removeEventListener ) {
                                                  elem.removeEventListener( type, handle, false );
                                              }
                                      Severity: Major
                                      Found in bower_components/jquery/src/event.js and 1 other location - About 4 hrs to fix
                                      bower_components/jquery/dist/jquery.js on lines 4887..4906

                                      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 126.

                                      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

                                      There are no issues that match your filters.

                                      Category
                                      Status