codefirst/AsakusaSatellite

View on GitHub

Showing 252 of 252 total issues

Function trigger has 86 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 = core_hasOwn.call( event, "type" ) ? event.type : event,
Severity: Major
Found in app/assets/javascripts/jquery.js - About 3 hrs to fix

    Function ListView has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var ListView = (function () {
    
        function ListView($el, completer) {
          this.$el = $el;
          this.index = 0;
    Severity: Major
    Found in app/assets/javascripts/jquery-textcomplete.js - About 3 hrs to fix

      Function callbacks has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var callbacks = function () {
      
              // for string, boolean, number and null
              function useStrictEquality(b, a) {
                  if (b instanceof a.constructor || a instanceof b.constructor) {
      Severity: Major
      Found in qunit/lib/qunit/qunit.js - About 3 hrs to fix

        Function Animation has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Animation( elem, properties, options ) {
            var result,
                stopped,
                index = 0,
                length = animationPrefilters.length,
        Severity: Major
        Found in app/assets/javascripts/jquery.js - About 3 hrs to fix

          Function send has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          send: function( headers, complete ) {
          
                              // Get a new xhr
                              var handle, i,
                                  xhr = s.xhr();
          Severity: Major
          Found in app/assets/javascripts/jquery.js - About 3 hrs to fix

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

                finish: function() {
                    if ( this.expected && this.expected != this.assertions.length ) {
                        QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
                    }
                    
            Severity: Major
            Found in qunit/lib/qunit/qunit.js - About 3 hrs to fix

              Function Sizzle has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function Sizzle( selector, context, results, seed ) {
                  var match, elem, m, nodeType,
                      // QSA vars
                      i, groups, old, nid, newContext, newSelector;
              
              
              Severity: Major
              Found in app/assets/javascripts/jquery.js - About 3 hrs to fix

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

                        for (var i = 0; i < n.length; i++) {
                            if (ns[n[i]] == null) 
                                ns[n[i]] = {
                                    rows: new Array(),
                                    o: null
                Severity: Major
                Found in qunit/lib/qunit/qunit.js and 1 other location - About 3 hrs to fix
                qunit/lib/qunit/qunit.js on lines 1333..1340

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

                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

                        for (var i = 0; i < o.length; i++) {
                            if (os[o[i]] == null) 
                                os[o[i]] = {
                                    rows: new Array(),
                                    n: null
                Severity: Major
                Found in qunit/lib/qunit/qunit.js and 1 other location - About 3 hrs to fix
                qunit/lib/qunit/qunit.js on lines 1324..1331

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

                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 buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    buildFragment: function( elems, context, scripts, selection ) {
                        var j, elem, contains,
                            tmp, tag, tbody, wrap,
                            l = elems.length,
                
                
                Severity: Major
                Found in app/assets/javascripts/jquery.js - About 2 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 app/assets/javascripts/jquery.js - About 2 hrs to fix

                    Method list has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def list
                            room_id    = params[:room_id]
                            since_id   = params[:since_id]
                            newer_than = params[:newer_than]
                            until_id   = params[:until_id]
                    Severity: Minor
                    Found in app/controllers/api/v1/message_controller.rb - 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

                    Function matcherFromGroupMatchers has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                        // A counter to specify which element is currently being matched
                        var matcherCachedRuns = 0,
                            bySet = setMatchers.length > 0,
                            byElement = elementMatchers.length > 0,
                    Severity: Major
                    Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                      Function scrollTo has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.scrollTo = function( target, duration, settings ){
                              if( typeof duration == 'object' ){
                                  settings = duration;
                                  duration = 0;
                              }
                      Severity: Major
                      Found in app/assets/javascripts/jquery-scrollTo.js - About 2 hrs to fix

                        Function done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function done( status, nativeStatusText, responses, headers ) {
                                    var isSuccess, success, error, response, modified,
                                        statusText = nativeStatusText;
                        
                                    // Called once
                        Severity: Major
                        Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                          Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                              if ( postFilter && !postFilter[ expando ] ) {
                                  postFilter = setMatcher( postFilter );
                              }
                              if ( postFinder && !postFinder[ expando ] ) {
                          Severity: Major
                          Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                            Function str has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function str(key, holder) {
                            
                            // Produce a string from holder[key].
                            
                                    var i,          // The loop counter.
                            Severity: Major
                            Found in public/socky/v0.5.0/assets/json2.js - About 2 hrs to fix

                              Function superMatcher has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      superMatcher = function( seed, context, xml, results, expandContext ) {
                                          var elem, j, matcher,
                                              setMatched = [],
                                              matchedCount = 0,
                                              i = "0",
                              Severity: Major
                              Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                                Method messages_between has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def messages_between(from, to, count, order = nil)
                                    conditions = {:room_id => self.id}
                                    if from
                                      conditions[:_id.gte] = from[:id] if     from[:include_boundary]
                                      conditions[:_id.gt]  = from[:id] unless from[:include_boundary]
                                Severity: Minor
                                Found in app/models/room.rb - 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

                                Function Deferred has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    Deferred: function( func ) {
                                        var tuples = [
                                                // action, add listener, listener list, final state
                                                [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
                                                [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
                                Severity: Major
                                Found in app/assets/javascripts/jquery.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language