diffux/diffux

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

Summary

Maintainability
F
1 mo
Test Coverage

File event.js has 617 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 85 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 = 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 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

              remove: function( elem, types, handler, selector, mappedTypes ) {
          
                  var j, origCount, tmp,
                      events, t, handleObj,
                      special, handlers, type, namespaces, origType,
          Severity: Minor
          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 origFn, type;
              
                      // 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 i, matches, sel, handleObj,
                              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 27 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 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 ( (event.result = ret) === false ) {
                                                    event.preventDefault();
                                                    event.stopPropagation();
                                                }
                        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 ( 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

                              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 4084..4660

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

                                    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 origFn, type;
                                    
                                    
                                    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 4809..4910

                                    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.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 4775..4807

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

                                    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 4668..4703

                                    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

                                    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 4707..4741

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

                                    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 4745..4771

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

                                    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