wikimedia/mediawiki-core

View on GitHub
resources/lib/sinonjs/sinon.js

Summary

Maintainability
F
1 mo
Test Coverage

File sinon.js has 4909 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Sinon.JS 1.17.7, 2017/02/15
 *
 * @author Christian Johansen (christian@cjohansen.no)
 * @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS
Severity: Major
Found in resources/lib/sinonjs/sinon.js - About 2 wks to fix

    Function 1 has 497 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.lolex = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    (function (global){
    (function (global) {
        
        var userAgent = global.navigator && global.navigator.userAgent;
    Severity: Major
    Found in resources/lib/sinonjs/sinon.js - About 2 days to fix

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

          function makeApi(sinon) {
              var push = Array.prototype.push;
              var slice = Array.prototype.slice;
              var callId = 0;
      
      
      Severity: Major
      Found in resources/lib/sinonjs/sinon.js - About 1 day to fix

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

            function makeApi(sinon) {
                var push = [].push;
                var match = sinon.match;
        
                function mock(object) {
        Severity: Major
        Found in resources/lib/sinonjs/sinon.js - About 1 day to fix

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

              function makeApi(sinon) {
                  sinon.wrapMethod = function wrapMethod(object, property, method) {
                      if (!object) {
                          throw new TypeError("Should wrap property of object");
                      }
          Severity: Major
          Found in resources/lib/sinonjs/sinon.js - About 1 day to fix

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

                function makeApi(sinon) {
                    sinon.xhr = sinonXhr;
            
                    sinon.extend(FakeXMLHttpRequest.prototype, sinon.EventTarget, {
                        async: true,
            Severity: Major
            Found in resources/lib/sinonjs/sinon.js - About 1 day to fix

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

                  function makeApi(sinon) {
                      function getCallbackError(behavior, func, args) {
                          if (behavior.callArgAt < 0) {
                              var msg;
              
              
              Severity: Major
              Found in resources/lib/sinonjs/sinon.js - About 1 day to fix

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

                    function makeApi(sinon) {
                        function assertType(value, type, name) {
                            var actual = sinon.typeOf(value);
                            if (actual !== type) {
                                throw new TypeError("Expected type of " + name + " to be " +
                Severity: Major
                Found in resources/lib/sinonjs/sinon.js - About 7 hrs to fix

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

                      function makeApi(sinon) {
                          var assert;
                  
                          function verifyIsStub() {
                              var method;
                  Severity: Major
                  Found in resources/lib/sinonjs/sinon.js - About 6 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 resources/lib/sinonjs/sinon.js - About 6 hrs to fix

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

                          function createClock(now, loopLimit) {
                              loopLimit = loopLimit || 1000;
                      
                              var clock = {
                                  now: getEpoch(now),
                      Severity: Major
                      Found in resources/lib/sinonjs/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 resources/lib/sinonjs/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 resources/lib/sinonjs/sinon.js - About 5 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 resources/lib/sinonjs/sinon.js - About 4 hrs to fix

                              Function deepEqualCyclic has 104 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 resources/lib/sinonjs/sinon.js - About 4 hrs to fix

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

                                    function makeApi(sinon) {
                                        var push = [].push;
                                
                                        function exposeValue(sandbox, config, key, value) {
                                            if (!value) {
                                Severity: Major
                                Found in resources/lib/sinonjs/sinon.js - About 3 hrs to fix

                                  Function wrapMethod has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          sinon.wrapMethod = function wrapMethod(object, property, method) {
                                              if (!object) {
                                                  throw new TypeError("Should wrap property of object");
                                              }
                                  
                                  
                                  Severity: Major
                                  Found in resources/lib/sinonjs/sinon.js - About 3 hrs to fix

                                    Function deepEqual has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            return (function deepEqual(obj1, obj2, path1, path2) {
                                                var type1 = typeof obj1;
                                                var type2 = typeof obj2;
                                    
                                                // == null also matches undefined
                                    Severity: Major
                                    Found in resources/lib/sinonjs/sinon.js - About 3 hrs to fix

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

                                          function makeApi(sinon) {
                                              var collection = {
                                                  verify: function resolve() {
                                                      each(this, "verify");
                                                  },
                                      Severity: Major
                                      Found in resources/lib/sinonjs/sinon.js - About 3 hrs to fix

                                        Function match has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                function match(expectation, message) {
                                                    var m = sinon.create(matcher);
                                                    var type = sinon.typeOf(expectation);
                                                    switch (type) {
                                                    case "object":
                                        Severity: Major
                                        Found in resources/lib/sinonjs/sinon.js - About 2 hrs to fix

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

                                              function makeApi(sinon) {
                                          
                                                  // Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
                                                  var hasDontEnumBug = (function () {
                                                      var obj = {
                                          Severity: Major
                                          Found in resources/lib/sinonjs/sinon.js - About 2 hrs to fix

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

                                                function makeApi(sinon) {
                                                    sinon.Event = function Event(type, bubbles, cancelable, target) {
                                                        this.initEvent(type, bubbles, cancelable, target);
                                                    };
                                            
                                            
                                            Severity: Major
                                            Found in resources/lib/sinonjs/sinon.js - About 2 hrs to fix

                                              Function defake has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) {
                                                      var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap
                                              
                                                      each([
                                                          "open",
                                              Severity: Major
                                              Found in resources/lib/sinonjs/sinon.js - About 2 hrs to fix

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

                                                    function match(object, matcher) {
                                                        if (matcher && typeof matcher.test === "function") {
                                                            return matcher.test(object);
                                                        }
                                                
                                                
                                                Severity: Major
                                                Found in resources/lib/sinonjs/sinon.js - About 2 hrs to fix

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

                                                      function makeApi(sinon) {
                                                          var slice = Array.prototype.slice;
                                                  
                                                          function test(callback) {
                                                              var type = typeof callback;
                                                  Severity: Major
                                                  Found in resources/lib/sinonjs/sinon.js - About 2 hrs to fix

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

                                                            sinon.deepEqual = function deepEqual(a, b) {
                                                                if (sinon.match && sinon.match.isMatcher(a)) {
                                                                    return a.test(b);
                                                                }
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                          function makeApi(sinon) {
                                                              function Server() {}
                                                              Server.prototype = sinon.fakeServer;
                                                      
                                                              sinon.fakeServerWithClock = new Server();
                                                      Severity: Minor
                                                      Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                            function makeApi(sinon) {
                                                                function valueFormatter(value) {
                                                                    return "" + value;
                                                                }
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                          Function test has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                  function test(callback) {
                                                                      var type = typeof callback;
                                                          
                                                                      if (type !== "function") {
                                                                          throw new TypeError("sinon.test needs to wrap a test function, got " + type);
                                                          Severity: Minor
                                                          Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                            Function hasDontEnumBug has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    var hasDontEnumBug = (function () {
                                                                        var obj = {
                                                                            constructor: function () {
                                                                                return "0";
                                                                            },
                                                            Severity: Minor
                                                            Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                              Function stub has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                      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: Minor
                                                              Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                Function tick has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        clock.tick = function tick(ms) {
                                                                            ms = typeof ms === "number" ? ms : parseTime(ms);
                                                                            var tickFrom = clock.now, tickTo = clock.now + ms, previous = clock.now;
                                                                            var timer = firstTimerInRange(clock, tickFrom, tickTo);
                                                                            var oldNow;
                                                                Severity: Minor
                                                                Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                  Function invokeMethod has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                              invokeMethod: function invokeMethod(method, thisValue, args) {
                                                                                  var expectations = this.expectations && this.expectations[method] ? this.expectations[method] : [];
                                                                                  var expectationsWithMatchingArgs = [];
                                                                                  var currentArgs = args || [];
                                                                                  var i, available;
                                                                  Severity: Minor
                                                                  Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                    Function verifyCallAllowed has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                                verifyCallAllowed: function verifyCallAllowed(thisValue, args) {
                                                                                    if (receivedMaxCalls(this)) {
                                                                                        this.failed = true;
                                                                                        sinon.expectation.fail(this.method + " already called " + times(this.maxCalls));
                                                                                    }
                                                                    Severity: Minor
                                                                    Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                      Function sinon has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                      var sinon = (function () {
                                                                      "use strict";
                                                                       // eslint-disable-line no-unused-vars
                                                                          
                                                                          var sinonModule;
                                                                      Severity: Minor
                                                                      Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                        Function object has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                            ascii.object = function (object, processed, indent) {
                                                                                processed = processed || [];
                                                                                processed.push(object);
                                                                                indent = indent || 0;
                                                                                var pieces = [], properties = samsam.keys(object).sort();
                                                                        Severity: Minor
                                                                        Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                          Function readyStateChange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                                      readyStateChange: function readyStateChange(state) {
                                                                                          this.readyState = state;
                                                                                          var eventName = "";
                                                                                          switch (this.readyState) {
                                                                                          case FakeXDomainRequest.UNSENT:
                                                                          Severity: Minor
                                                                          Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                            Function invoke has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                                        invoke: function invoke(func, thisValue, args) {
                                                                                            var matching = matchingFake(this.fakes, args);
                                                                                            var exception, returnValue;
                                                                            
                                                                                            incrementCallCount.call(this);
                                                                            Severity: Minor
                                                                            Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                              Function readyStateChange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                          readyStateChange: function readyStateChange(state) {
                                                                                              this.readyState = state;
                                                                              
                                                                                              var readyStateChangeEvent = new sinon.Event("readystatechange", false, false, this);
                                                                                              var event, progress;
                                                                              Severity: Minor
                                                                              Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                    function makeApi(sinon) {
                                                                                        function testCase(tests, prefix) {
                                                                                            if (!tests || typeof tests !== "object") {
                                                                                                throw new TypeError("sinon.testCase needs an object with test functions");
                                                                                            }
                                                                                Severity: Minor
                                                                                Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                                  Function withArgs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                              withArgs: function () {
                                                                                                  var args = slice.call(arguments);
                                                                                  
                                                                                                  if (this.fakes) {
                                                                                                      var match = matchingFake(this.fakes, args, true);
                                                                                  Severity: Minor
                                                                                  Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                                reset: function () {
                                                                                                    if (this.invoking) {
                                                                                                        var err = new Error("Cannot reset Sinon function while invoking it. " +
                                                                                                                            "Move the call to .reset outside of the callback.");
                                                                                                        err.name = "InvalidResetException";
                                                                                    Severity: Minor
                                                                                    Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                          function mirrorDateProperties(target, source) {
                                                                                              var prop;
                                                                                              for (prop in source) {
                                                                                                  if (source.hasOwnProperty(prop)) {
                                                                                                      target[prop] = source[prop];
                                                                                      Severity: Minor
                                                                                      Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                            exports.install = function install(target, now, toFake, loopLimit) {
                                                                                                var i,
                                                                                                    l;
                                                                                        
                                                                                                if (typeof target === "number") {
                                                                                        Severity: Minor
                                                                                        Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                                      setResponseBody: function setResponseBody(body) {
                                                                                                          verifyRequestSent(this);
                                                                                                          verifyHeadersReceived(this);
                                                                                                          verifyResponseBodyType(body);
                                                                                                          var contentType = this.getResponseHeader("Content-Type");
                                                                                          Severity: Minor
                                                                                          Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                                        function sinonSandboxedTest() {
                                                                                                            var config = sinon.getConfig(sinon.config);
                                                                                                            config.injectInto = config.injectIntoThis && this || config.injectInto;
                                                                                                            var sandbox = sinon.sandbox.create(config);
                                                                                                            var args = slice.call(arguments);
                                                                                            Severity: Minor
                                                                                            Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                                  function makeApi(s, lol) {
                                                                                                      /*global lolex */
                                                                                                      var llx = typeof lolex !== "undefined" ? lolex : lol;
                                                                                              
                                                                                                      s.useFakeTimers = function () {
                                                                                              Severity: Minor
                                                                                              Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                                    function FakeXMLHttpRequest() {
                                                                                                        this.readyState = FakeXMLHttpRequest.UNSENT;
                                                                                                        this.requestHeaders = {};
                                                                                                        this.requestBody = null;
                                                                                                        this.status = 0;
                                                                                                Severity: Minor
                                                                                                Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                                      function makeApi(sinon) {
                                                                                                          function walkInternal(obj, iterator, context, originalObj, seen) {
                                                                                                              var proto, prop;
                                                                                                  
                                                                                                              if (typeof Object.getOwnPropertyNames !== "function") {
                                                                                                  Severity: Minor
                                                                                                  Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                                                    Function allowsCall has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                                allowsCall: function allowsCall(thisValue, args) {
                                                                                                                    if (this.met() && receivedMaxCalls(this)) {
                                                                                                                        return false;
                                                                                                                    }
                                                                                                    
                                                                                                    
                                                                                                    Severity: Minor
                                                                                                    Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                                                      Function ascii has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                          function ascii(f, object, processed, indent) {
                                                                                                              if (typeof object === "string") {
                                                                                                                  var qs = f.quoteStrings;
                                                                                                                  var quote = typeof qs !== "boolean" || qs;
                                                                                                                  return processed || quote ? '"' + object + '"' : object;
                                                                                                      Severity: Minor
                                                                                                      Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                                                        Function testCase has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                                function testCase(tests, prefix) {
                                                                                                                    if (!tests || typeof tests !== "object") {
                                                                                                                        throw new TypeError("sinon.testCase needs an object with test functions");
                                                                                                                    }
                                                                                                        
                                                                                                        
                                                                                                        Severity: Minor
                                                                                                        Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                                                          Consider simplifying this complex logical expression.
                                                                                                          Open

                                                                                                                      if (typeof value === 'object' && value !== null &&
                                                                                                                              !(value instanceof Boolean) &&
                                                                                                                              !(value instanceof Date)    &&
                                                                                                                              !(value instanceof Number)  &&
                                                                                                                              !(value instanceof RegExp)  &&
                                                                                                          Severity: Major
                                                                                                          Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

                                                                                                            Consider simplifying this complex logical expression.
                                                                                                            Open

                                                                                                                        if (obj1 === obj2 ||
                                                                                                                                isNaN(obj1) || isNaN(obj2) ||
                                                                                                                                obj1 == null || obj2 == null ||
                                                                                                                                type1 !== "object" || type2 !== "object") {
                                                                                                            
                                                                                                            
                                                                                                            Severity: Major
                                                                                                            Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

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

                                                                                                                      function ClockDate(year, month, date, hour, minute, second, ms) {
                                                                                                              Severity: Major
                                                                                                              Found in resources/lib/sinonjs/sinon.js - About 50 mins to fix

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

                                                                                                                        function createSpyCall(spy, thisValue, args, returnValue, exception, id, stack) {
                                                                                                                Severity: Major
                                                                                                                Found in resources/lib/sinonjs/sinon.js - About 50 mins to fix

                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                  Open

                                                                                                                                      } else if (!sinon.deepEqual(exp, act)) {
                                                                                                                                          return false;
                                                                                                                                      }
                                                                                                                  Severity: Major
                                                                                                                  Found in resources/lib/sinonjs/sinon.js - About 45 mins to fix

                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                    Open

                                                                                                                                            if (!matchObject(exp, act)) {
                                                                                                                                                return false;
                                                                                                                                            }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/sinonjs/sinon.js - About 45 mins to fix

                                                                                                                      Function walkInternal has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                      Open

                                                                                                                              function walkInternal(obj, iterator, context, originalObj, seen) {
                                                                                                                      Severity: Minor
                                                                                                                      Found in resources/lib/sinonjs/sinon.js - About 35 mins to fix

                                                                                                                        Function open has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                        Open

                                                                                                                                    open: function open(method, url, async, username, password) {
                                                                                                                        Severity: Minor
                                                                                                                        Found in resources/lib/sinonjs/sinon.js - About 35 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                  return false;
                                                                                                                          Severity: Major
                                                                                                                          Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                        return object === null;
                                                                                                                            Severity: Major
                                                                                                                            Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                          return arrayContains(object, matcher, match);
                                                                                                                              Severity: Major
                                                                                                                              Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                                if (obj1.length !== obj2.length) { return false; }
                                                                                                                                Severity: Major
                                                                                                                                Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                  Open

                                                                                                                                                      return false;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                    Open

                                                                                                                                                return -1;
                                                                                                                                    Severity: Major
                                                                                                                                    Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                                  return true;
                                                                                                                                      Severity: Major
                                                                                                                                      Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                                            return false;
                                                                                                                                        Severity: Major
                                                                                                                                        Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                                          return FakeXMLHttpRequest.parseXML(body);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                            return isSubset(obj1, obj2, deepEqual);
                                                                                                                                            Severity: Major
                                                                                                                                            Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                          return isSubset(matcher, object, match);
                                                                                                                                              Severity: Major
                                                                                                                                              Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                                        return false;
                                                                                                                                                Severity: Major
                                                                                                                                                Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                          if (!object) { return String((1/object) === -Infinity ? "-0" : object); }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                            return ascii.object.call(f, object, processed, indent);
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                                          return false;
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                                            return false;
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                                  return false;
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                        return aLength === bLength;
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                                  return false;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                        if (samsam.isElement(object)) { return ascii.element(object); }
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                                  return false;
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                                return null;
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                                  return matcher === object;
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                        Open

                                                                                                                                                                                    return typeof(object) === "undefined";
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                          Open

                                                                                                                                                                                      return object.toString();
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                            return false;
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                              Open

                                                                                                                                                                                                      return false;
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                Open

                                                                                                                                                                                                return true;
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                  Open

                                                                                                                                                                                                  return false;
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                                    Open

                                                                                                                                                                                                    return (a.source === b.source) && (a.global === b.global) &&
                                                                                                                                                                                                        (a.ignoreCase === b.ignoreCase) && (a.multiline === b.multiline);
                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                    Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                                      Open

                                                                                                                                                                                                  return true;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                                        Open

                                                                                                                                                                                                                return false;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                                          Open

                                                                                                                                                                                                          return true;
                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                          Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                                            Open

                                                                                                                                                                                                            return specialObjects[i].value;
                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                            Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                                              Open

                                                                                                                                                                                                          return new Blob([convertToArrayBuffer(body)], blobOptions);
                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                              Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                                Open

                                                                                                                                                                                                        return false;
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                                  Open

                                                                                                                                                                                                                      return true;
                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                                return 1;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                                                      Open

                                                                                                                                                                                                                  return -1;
                                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                                      Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                                                        Open

                                                                                                                                                                                                                            return false;
                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                        Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                                                          Open

                                                                                                                                                                                                                      return true;
                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                          Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                                                            Open

                                                                                                                                                                                                                        return 1;
                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                            Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                                                              Open

                                                                                                                                                                                                                              return a.valueOf() === b.valueOf();
                                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                                              Found in resources/lib/sinonjs/sinon.js - About 30 mins to fix

                                                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                                                Open

                                                                                                                                                                                                                                        return false;
                                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                                Found in resources/lib/sinonjs/sinon.js - About 30 mins 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 resources/lib/sinonjs/sinon.js and 1 other location - About 6 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 2193..2206

                                                                                                                                                                                                                  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 resources/lib/sinonjs/sinon.js and 1 other location - About 6 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 2178..2191

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                              callsArgWith: function callsArgWith(pos) {
                                                                                                                                                                                                                                  if (typeof pos !== "number") {
                                                                                                                                                                                                                                      throw new TypeError("argument index is not number");
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3374..3386
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3398..3410

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                              yieldsOn: function (context) {
                                                                                                                                                                                                                                  if (typeof context !== "object") {
                                                                                                                                                                                                                                      throw new TypeError("argument context is not an object");
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3323..3335
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3398..3410

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                              yieldsToOn: function (prop, context) {
                                                                                                                                                                                                                                  if (typeof context !== "object") {
                                                                                                                                                                                                                                      throw new TypeError("argument context is not an object");
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3323..3335
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3374..3386

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                              atMost: function atMost(num) {
                                                                                                                                                                                                                                  if (typeof num !== "number") {
                                                                                                                                                                                                                                      throw new TypeError("'" + num + "' is not number");
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4017..4030

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                              atLeast: function atLeast(num) {
                                                                                                                                                                                                                                  if (typeof num !== "number") {
                                                                                                                                                                                                                                      throw new TypeError("'" + num + "' is not number");
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4032..4045

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                              yields: function () {
                                                                                                                                                                                                                                  this.callArgAt = useLeftMostCallback;
                                                                                                                                                                                                                                  this.callbackArguments = slice.call(arguments, 0);
                                                                                                                                                                                                                                  this.callbackContext = undefined;
                                                                                                                                                                                                                                  this.callArgProp = undefined;
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3364..3372

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                              yieldsRight: function () {
                                                                                                                                                                                                                                  this.callArgAt = useRightMostCallback;
                                                                                                                                                                                                                                  this.callbackArguments = slice.call(arguments, 0);
                                                                                                                                                                                                                                  this.callbackContext = undefined;
                                                                                                                                                                                                                                  this.callArgProp = undefined;
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3354..3362

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                      this.clock.setInterval = function (fn, timeout) {
                                                                                                                                                                                                                                          server.longestTimeout = Math.max(timeout, server.longestTimeout || 0);
                                                                                                                                                                                                                  
                                                                                                                                                                                                                                          return clockSetInterval.apply(this, arguments);
                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5961..5965

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                  return (a.source === b.source) && (a.global === b.global) &&
                                                                                                                                                                                                                                      (a.ignoreCase === b.ignoreCase) && (a.multiline === b.multiline);
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/ooui/oojs-ui-core.js on lines 5260..5261

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                      this.clock.setTimeout = function (fn, timeout) {
                                                                                                                                                                                                                                          server.longestTimeout = Math.max(timeout, server.longestTimeout || 0);
                                                                                                                                                                                                                  
                                                                                                                                                                                                                                          return clockSetTimeout.apply(this, arguments);
                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5967..5971

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                  for (var i = 0, l = listeners.length; i < l; ++i) {
                                                                                                                                                                                                                                      if (listeners[i] === listener) {
                                                                                                                                                                                                                                          return listeners.splice(i, 1);
                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5028..5032

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                  if (this.expectsExactArgCount &&
                                                                                                                                                                                                                                      args.length !== this.expectedArguments.length) {
                                                                                                                                                                                                                                      sinon.expectation.fail(this.method + " received too many arguments (" + sinon.format(args) +
                                                                                                                                                                                                                                          "), expected " + sinon.format(this.expectedArguments));
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4096..4099
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4114..4117

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                          function each(collection, callback) {
                                                                                                                                                                                                                              if (!collection) {
                                                                                                                                                                                                                                  return;
                                                                                                                                                                                                                              }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5106..5114

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                          for (var i = 0, l = listeners.length; i < l; ++i) {
                                                                                                                                                                                                                              if (listeners[i] === listener) {
                                                                                                                                                                                                                                  return listeners.splice(i, 1);
                                                                                                                                                                                                                              }
                                                                                                                                                                                                                          }
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4572..4576

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      function each(collection, callback) {
                                                                                                                                                                                                                          if (!collection) {
                                                                                                                                                                                                                              return;
                                                                                                                                                                                                                          }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3801..3809

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                      if (!sinon.deepEqual(this.expectedArguments[i], args[i])) {
                                                                                                                                                                                                                                          sinon.expectation.fail(this.method + " received wrong arguments " + sinon.format(args) +
                                                                                                                                                                                                                                              ", expected " + sinon.format(this.expectedArguments));
                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4096..4099
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4101..4105

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                  if (args.length < this.expectedArguments.length) {
                                                                                                                                                                                                                                      sinon.expectation.fail(this.method + " received too few arguments (" + sinon.format(args) +
                                                                                                                                                                                                                                          "), expected " + sinon.format(this.expectedArguments));
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4101..4105
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4114..4117

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      function loadDependencies(require, exports, module) {
                                                                                                                                                                                                                          var sinon = require("./util/core");
                                                                                                                                                                                                                          require("./extend");
                                                                                                                                                                                                                          require("./util/fake_server_with_clock");
                                                                                                                                                                                                                          require("./util/fake_timers");
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3089..3096

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      function loadDependencies(require, exports, module) {
                                                                                                                                                                                                                          var core = require("./util/core");
                                                                                                                                                                                                                          require("./call");
                                                                                                                                                                                                                          require("./extend");
                                                                                                                                                                                                                          require("./times_in_words");
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 6170..6177

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      function verifyResponseBodyType(body) {
                                                                                                                                                                                                                          if (typeof body !== "string") {
                                                                                                                                                                                                                              var error = new Error("Attempted to respond to fake XMLHttpRequest with " +
                                                                                                                                                                                                                                                   body + ", which is not a string.");
                                                                                                                                                                                                                              error.name = "InvalidBodyException";
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4767..4774

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                          function verifyResponseBodyType(body) {
                                                                                                                                                                                                                              if (typeof body !== "string") {
                                                                                                                                                                                                                                  var error = new Error("Attempted to respond to fake XDomainRequest with " +
                                                                                                                                                                                                                                                      body + ", which is not a string.");
                                                                                                                                                                                                                                  error.name = "InvalidBodyException";
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5224..5231

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                          function verifyState(x) {
                                                                                                                                                                                                                              if (x.readyState !== FakeXDomainRequest.OPENED) {
                                                                                                                                                                                                                                  throw new Error("INVALID_STATE_ERR");
                                                                                                                                                                                                                              }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 55 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5082..5090

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      function verifyState(xhr) {
                                                                                                                                                                                                                          if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
                                                                                                                                                                                                                              throw new Error("INVALID_STATE_ERR");
                                                                                                                                                                                                                          }
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 55 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4748..4756

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                      function loadDependencies(require, exports, module) {
                                                                                                                                                                                                                          var sinon = require("./core");
                                                                                                                                                                                                                          require("../extend");
                                                                                                                                                                                                                          require("./event");
                                                                                                                                                                                                                          require("../log_error");
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 50 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4917..4924
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5903..5910

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                      function loadDependencies(require, exports, module) {
                                                                                                                                                                                                                          var sinon = require("./core");
                                                                                                                                                                                                                          require("../extend");
                                                                                                                                                                                                                          require("./event");
                                                                                                                                                                                                                          require("../log_error");
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 50 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5647..5654
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5903..5910

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

                                                                                                                                                                                                                  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 3 locations. Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                      function loadDependencies(require, exports, module) {
                                                                                                                                                                                                                          var sinon = require("./core");
                                                                                                                                                                                                                          require("./fake_xdomain_request");
                                                                                                                                                                                                                          require("./fake_xml_http_request");
                                                                                                                                                                                                                          require("../format");
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 50 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4917..4924
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5647..5654

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      function loadDependencies(require, exports, module) {
                                                                                                                                                                                                                          var sinon = require("./util/core");
                                                                                                                                                                                                                          require("./mock");
                                                                                                                                                                                                                          require("./spy");
                                                                                                                                                                                                                          require("./stub");
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 3740..3746

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      function loadDependencies(require, exports, module) {
                                                                                                                                                                                                                          var core = require("./util/core");
                                                                                                                                                                                                                          require("./behavior");
                                                                                                                                                                                                                          require("./spy");
                                                                                                                                                                                                                          require("./extend");
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4404..4410

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      if (isAMD) {
                                                                                                                                                                                                                          define(loadDependencies);
                                                                                                                                                                                                                      } else if (isNode) {
                                                                                                                                                                                                                          loadDependencies(require, module.exports, module);
                                                                                                                                                                                                                      } else {
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 4926..4932

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                      if (isAMD) {
                                                                                                                                                                                                                          define(loadDependencies);
                                                                                                                                                                                                                      } else if (isNode) {
                                                                                                                                                                                                                          loadDependencies(require, module.exports, module);
                                                                                                                                                                                                                      } else {
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 5912..5918

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                              yieldTo: function (prop) {
                                                                                                                                                                                                                                  this.yieldToOn.apply(this, [prop, null].concat(slice.call(arguments, 1)));
                                                                                                                                                                                                                              },
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 2519..2521

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

                                                                                                                                                                                                                  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

                                                                                                                                                                                                                              callArgWith: function (pos) {
                                                                                                                                                                                                                                  this.callArgOnWith.apply(this, [pos, null].concat(slice.call(arguments, 1)));
                                                                                                                                                                                                                              },
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in resources/lib/sinonjs/sinon.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                                  resources/lib/sinonjs/sinon.js on lines 2543..2545

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

                                                                                                                                                                                                                  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