jquery/jquery

View on GitHub

Showing 365 of 365 total issues

Function exports has 190 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function( grunt ) {
    "use strict";

    function readOptionalJSON( filepath ) {
        var stripJSONComments = require( "strip-json-comments" ),
Severity: Major
Found in Gruntfile.js - About 7 hrs to fix

    Function equiv has 185 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    QUnit.equiv = (function() {
    
        // Stack to decide between skip/abort functions
        var callers = [];
    
    
    Severity: Major
    Found in external/qunit/qunit.js - About 7 hrs to fix

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

          Deferred: function( func ) {
              var tuples = [
      
                      // action, add listener, callbacks,
                      // ... .then handlers, argument index, [final state]
      Severity: Major
      Found in src/deferred.js - About 7 hrs to fix

        Function makeApi has 154 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function makeApi(sinon) {
                function throwYieldError(proxy, text, args) {
                    var msg = sinon.functionName(proxy) + text;
                    if (args.length) {
                        msg += " Received [" + slice.call(args).join(", ") + "]";
        Severity: Major
        Found in external/sinon/sinon.js - About 6 hrs to fix

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

                  matcher.or = function (m2) {
                      if (!arguments.length) {
                          throw new TypeError("Matcher expected");
                      } else if (!isMatcher(m2)) {
                          m2 = match(m2);
          Severity: Major
          Found in external/sinon/sinon.js and 1 other location - About 6 hrs to fix
          external/sinon/sinon.js on lines 2032..2045

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

          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

                  matcher.and = function (m2) {
                      if (!arguments.length) {
                          throw new TypeError("Matcher expected");
                      } else if (!isMatcher(m2)) {
                          m2 = match(m2);
          Severity: Major
          Found in external/sinon/sinon.js and 1 other location - About 6 hrs to fix
          external/sinon/sinon.js on lines 2017..2030

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

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

              function makeApi(sinon) {
                  var assert;
          
                  function verifyIsStub() {
                      var method;
          Severity: Major
          Found in external/sinon/sinon.js - About 5 hrs to fix

            Function makeApi has 144 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function makeApi(sinon) {
                    sinon.xdr = xdr;
            
                    function FakeXDomainRequest() {
                        this.readyState = FakeXDomainRequest.UNSENT;
            Severity: Major
            Found in external/sinon/sinon.js - About 5 hrs to fix

              Function makeApi has 128 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function makeApi(sinon) {
                      sinon.fakeServer = {
                          create: function (config) {
                              var server = sinon.create(this);
                              server.configure(config);
              Severity: Major
              Found in external/sinon/sinon.js - About 5 hrs to fix

                Function defaultPrefilter has 122 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function defaultPrefilter( elem, props, opts ) {
                    var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
                        isBox = "width" in props || "height" in props,
                        anim = this,
                        orig = {},
                Severity: Major
                Found in src/effects.js - About 4 hrs to fix

                  Function Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jQuery.Callbacks = function( options ) {
                  
                      // Convert options from String-formatted to Object-formatted if needed
                      // (we check in cache first)
                      options = typeof options === "string" ?
                  Severity: Major
                  Found in src/callbacks.js - About 4 hrs to fix

                    Function makeApi has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function makeApi(sinon) {
                            function stub(object, property, func) {
                                if (!!func && typeof func !== "function" && typeof func !== "object") {
                                    throw new TypeError("Custom stub should be a function or a property descriptor");
                                }
                    Severity: Major
                    Found in external/sinon/sinon.js - About 4 hrs to fix

                      Function diffCleanupMerge has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          DiffMatchPatch.prototype.diffCleanupMerge = function( diffs ) {
                              var pointer, countDelete, countInsert, textInsert, textDelete,
                                  commonlength, changes, diffPointer, position;
                              diffs.push( [ DIFF_EQUAL, "" ] ); // Add a dummy entry at the end.
                              pointer = 0;
                      Severity: Major
                      Found in external/qunit/qunit.js - About 4 hrs to fix

                        File manipulation.js has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        define( [
                            "./core",
                            "./var/concat",
                            "./var/push",
                            "./core/access",
                        Severity: Minor
                        Found in src/manipulation.js - About 4 hrs to fix

                          Function then has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          then: function( onFulfilled, onRejected, onProgress ) {
                                              var maxDepth = 0;
                                              function resolve( depth, deferred, handler, special ) {
                                                  return function() {
                                                      var that = this,
                          Severity: Major
                          Found in src/deferred.js - About 4 hrs to fix

                            Function exports has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            module.exports = function( Release, files, complete ) {
                            
                                var
                                    fs = require( "fs" ),
                                    shell = require( "shelljs" ),
                            Severity: Major
                            Found in build/release/dist.js - About 4 hrs to fix

                              Function createClock has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function createClock(now) {
                                      var clock = {
                                          now: getEpoch(now),
                                          timeouts: {},
                                          Date: createDate()
                              Severity: Major
                              Found in external/sinon/sinon.js - About 3 hrs to fix

                                Function deepEqualCyclic has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function deepEqualCyclic(obj1, obj2) {
                                
                                        // used for cyclic comparison
                                        // contain already visited objects
                                        var objects1 = [],
                                Severity: Major
                                Found in external/sinon/sinon.js - About 3 hrs to fix

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

                                  function Animation( elem, properties, options ) {
                                      var result,
                                          stopped,
                                          index = 0,
                                          length = Animation.prefilters.length,
                                  Severity: Major
                                  Found in src/effects.js - About 3 hrs to fix

                                    Function callPlugin has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                callPlugin: function () {
                                                    var map = this.map,
                                                        id = map.id,
                                                        //Map already normalized the prefix.
                                                        pluginMap = makeModuleMap(map.prefix);
                                    Severity: Major
                                    Found in external/requirejs/require.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source