codefirst/AsakusaSatellite

View on GitHub

Showing 209 of 252 total issues

Consider simplifying this complex logical expression.
Open

                        if ( forward && useCache ) {
                            // Seek `elem` from a previously-cached index
                            outerCache = parent[ expando ] || (parent[ expando ] = {});
                            cache = outerCache[ type ] || [];
                            nodeIndex = cache[0] === dirruns && cache[1];
Severity: Critical
Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

    Function init has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        init: function( selector, context, rootjQuery ) {
            var match, elem;
    
            // HANDLE: $(""), $(null), $(undefined), $(false)
            if ( !selector ) {
    Severity: Major
    Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

      Function domManip has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          domManip: function( args, callback, allowIntersection ) {
      
              // Flatten any nested arrays
              args = core_concat.apply( [], args );
      
      
      Severity: Major
      Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

        Function ajaxConvert has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ajaxConvert( s, response, jqXHR, isSuccess ) {
            var conv2, current, conv, tmp, prev,
                converters = {},
                // Work with a copy of dataTypes in case we need to modify it for conversion
                dataTypes = s.dataTypes.slice();
        Severity: Major
        Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

          Function webSocket has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.webSocket = function(config){
                  var target = this;
          
                  var pusher = config.pusher;
                  var currentChannel = null;
          Severity: Major
          Found in app/assets/javascripts/jquery-websocket.js - About 2 hrs to fix

            Function waitFor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            function waitFor(testFx, onReady, timeOutMillis) {
                var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001, //< Default Max Timout is 3s
                    start = new Date().getTime(),
                    condition = false,
                    interval = setInterval(function() {
            Severity: Minor
            Found in qunit/run_qunit.js - About 2 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

            File rails.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function($, undefined) {
            
            /**
             * Unobtrusive scripting adapter for jQuery
             * https://github.com/rails/jquery-ujs
            Severity: Minor
            Found in app/assets/javascripts/rails.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 app/assets/javascripts/jquery.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 app/assets/javascripts/jquery.js - About 2 hrs to fix

                  Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function internalRemoveData( elem, name, pvt ) {
                      if ( !jQuery.acceptData( elem ) ) {
                          return;
                      }
                  
                  
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                    Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function internalData( elem, name, data, pvt /* Internal Use Only */ ){
                        if ( !jQuery.acceptData( elem ) ) {
                            return;
                        }
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                      Function __initialize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        WebSocket.__initialize = function() {
                          if (WebSocket.__flash) return;
                          
                          if (WebSocket.__swfLocation) {
                            // For backword compatibility.
                      Severity: Minor
                      Found in public/socky/v0.5.0/assets/flashfallback.js - About 1 hr to fix

                        Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function tokenize( selector, parseOnly ) {
                            var matched, match, tokens, type,
                                soFar, groups, preFilters,
                                cached = tokenCache[ selector + " " ];
                        
                        
                        Severity: Minor
                        Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                          Function onTheSpot has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              $.fn.onTheSpot = function(config){
                                  var defaults = {
                                      submit  : 'OK',
                                      cancel  : 'Cancel',
                                      tooltip : '',
                          Severity: Minor
                          Found in app/assets/javascripts/jquery-onthespot.js - About 1 hr to fix

                            Function select has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function select( selector, context, results, seed ) {
                                var i, tokens, token, type, find,
                                    match = tokenize( selector );
                            
                                if ( !seed ) {
                            Severity: Minor
                            Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                              Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function matcherFromTokens( tokens ) {
                                  var checkContext, matcher, j,
                                      len = tokens.length,
                                      leadingRelative = Expr.relative[ tokens[0].type ],
                                      implicitRelative = leadingRelative || Expr.relative[" "],
                              Severity: Minor
                              Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                                Method add_member has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def add_member
                                        render_login_error and return unless logged?
                                
                                        Room.with_room(params[:id], current_user) do |room|
                                          render_room_not_found(params[:id]) and return if room.nil?
                                Severity: Minor
                                Found in app/controllers/api/v1/room_controller.rb - About 1 hr 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 pagination has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    $.fn.pagination = function(config) {
                                        var config = $.extend({
                                            indicator : "",
                                            content : "div"
                                        }, config);
                                Severity: Minor
                                Found in app/assets/javascripts/jquery-pagination.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                                  ( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                                  ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                                  !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
                                  
                                  
                                  Severity: Critical
                                  Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                                    Function addCombinator has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function addCombinator( matcher, combinator, base ) {
                                        var dir = combinator.dir,
                                            checkNonElements = base && dir === "parentNode",
                                            doneName = done++;
                                    
                                    
                                    Severity: Minor
                                    Found in app/assets/javascripts/jquery.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language