daitokai/daitokaiet

View on GitHub

Showing 139 of 155 total issues

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 public/javascripts/jquery.js - About 1 hr to fix

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

        finish: function( type ) {
            if ( type !== false ) {
                type = type || "fx";
            }
            return this.each(function() {
    Severity: Minor
    Found in public/javascripts/jquery.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 public/javascripts/jquery.js - About 1 hr to fix

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

        function propFilter( props, specialEasing ) {
            var index, name, easing, value, hooks;
        
            // camelCase, specialEasing and expand cssHook pass
            for ( index in props ) {
        Severity: Minor
        Found in public/javascripts/jquery.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 public/javascripts/jquery.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 public/javascripts/jquery.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 public/javascripts/jquery.js - 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 public/javascripts/jquery.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                  if ( jQuery.expr && jQuery.expr.filters ) {
                      jQuery.expr.filters.hidden = function( elem ) {
                          // Support: Opera <= 12.12
                          // Opera reports offsetWidths and offsetHeights less than zero on some elements
                          return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
                  Severity: Major
                  Found in public/javascripts/jquery.js - About 1 hr to fix

                    Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
                    Severity: Major
                    Found in public/javascripts/jquery.js - About 50 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for ( match in context ) {
                                                  // Properties of context are called as methods if possible
                                                  if ( jQuery.isFunction( this[ match ] ) ) {
                                                      this[ match ]( context[ match ] );
                      
                      
                      Severity: Major
                      Found in public/javascripts/jquery.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if ( (seed = find(
                                                token.matches[0].replace( runescape, funescape ),
                                                rsibling.test( tokens[0].type ) && context.parentNode || context
                                            )) ) {
                        
                        
                        Severity: Major
                        Found in public/javascripts/jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if (element.data('params')) data = data + "&" + element.data('params');
                          Severity: Major
                          Found in public/javascripts/jquery_ujs.js - About 45 mins to fix

                            Method search has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def search
                                  @users = User.where.not(id: current_user.id).search(params[:q]).result.sample(30)
                                  respond_to do |format|
                                    format.html do
                                      if @users.blank?
                            Severity: Minor
                            Found in app/controllers/api/v1/social_controller.rb - About 45 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 show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def show
                                  @user = User.where(name: params[:name]).first
                                  respond_to do |format|
                                    format.html do
                                      if @user.blank?
                            Severity: Minor
                            Found in app/controllers/api/v1/social_controller.rb - About 45 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

                            Avoid deeply nested control flow statements.
                            Open

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

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ( rscriptType.test( node.type || "" ) &&
                                                          !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
                              
                                                          if ( node.src ) {
                                                              // Hope ajax is available...
                              Severity: Major
                              Found in public/javascripts/jquery.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        for ( type in data.events ) {
                                                            if ( special[ type ] ) {
                                                                jQuery.event.remove( elem, type );
                                
                                                            // This is a shortcut to avoid jQuery.event.remove's overhead
                                Severity: Major
                                Found in public/javascripts/jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                  } else if ( copy !== undefined ) {
                                                      target[ name ] = copy;
                                                  }
                                  Severity: Major
                                  Found in public/javascripts/jquery.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            while ( j-- ) {
                                                                if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
                                                                    elem.removeChild( tbody );
                                                                }
                                                            }
                                    Severity: Major
                                    Found in public/javascripts/jquery.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language