melphi/algobox

View on GitHub
java/algobox/algobox-microservice/src/main/resources/static/swagger/lib/es5-shim.js

Summary

Maintainability
F
6 days
Test Coverage

File es5-shim.js has 1509 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * https://github.com/es-shims/es5-shim
 * @license es5-shim Copyright 2009-2015 by contributors, MIT License
 * see https://github.com/es-shims/es5-shim/blob/master/LICENSE
 */

    Consider simplifying this complex logical expression.
    Open

                    if (match) {
                        // parse months, days, hours, minutes, seconds, and milliseconds
                        // provide default values if necessary
                        // parse the UTC offset component
                        var year = $Number(match[1]),

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

          var toFixedShim = function toFixed(fractionDigits) {
              var f, x, s, m, e, z, j, k;
      
              // Test for NaN and round fractionDigits down
              f = $Number(fractionDigits);

        Function splice has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                splice: function splice(start, deleteCount) {
                    var O = ES.ToObject(this);
                    var A = [];
                    var len = ES.ToUint32(O.length);
                    var relativeStart = ES.ToInteger(start);

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

                      StringPrototype.split = function (separator, limit) {
                          var string = String(this);
                          if (typeof separator === 'undefined' && limit === 0) {
                              return [];
                          }

            Consider simplifying this complex logical expression.
            Open

                                if (
                                    hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) &&
                                    minute < 60 && second < 60 && millisecond < 1000 &&
                                    month > -1 && month < 12 && hourOffset < 24 &&
                                    minuteOffset < 60 && // detect invalid offsets

              Function parse has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          var parseShim = function parse(string) {
                              var match = isoDateExpression.exec(string);
                              if (match) {
                                  // parse months, days, hours, minutes, seconds, and milliseconds
                                  // provide default values if necessary

                Function bind has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        bind: function bind(that) { // .length is 1
                            // 1. Let Target be the this value.
                            var target = this;
                            // 2. If IsCallable(Target) is false, throw a TypeError exception.
                            if (!isCallable(target)) {

                  Function reduceRight has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          reduceRight: function reduceRight(callbackfn/*, initial*/) {
                              var object = ES.ToObject(this);
                              var self = splitString && isString(this) ? strSplit(this, '') : object;
                              var length = ES.ToUint32(self.length);
                  
                  

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

                            keys: function keys(object) {
                                var isFn = isCallable(object);
                                var isArgs = isArguments(object);
                                var isObject = object !== null && typeof object === 'object';
                                var isStr = isObject && isString(object);

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

                              reduce: function reduce(callbackfn/*, initialValue*/) {
                                  var object = ES.ToObject(this);
                                  var self = splitString && isString(this) ? strSplit(this, '') : object;
                                  var length = ES.ToUint32(self.length);
                      
                      

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

                                    var DateShim = function Date(Y, M, D, h, m, s, ms) {
                                        var length = arguments.length;
                                        var date;
                                        if (this instanceof NativeDate) {
                                            var seconds = s;

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

                              var defineProperties = (function (has) {
                                  // Define configurable, writable, and non-enumerable props
                                  // if they don't exist.
                                  var defineProperty;
                                  if (supportsDescriptors) {

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

                                        var DateShim = function Date(Y, M, D, h, m, s, ms) {

                              Avoid deeply nested control flow statements.
                              Open

                                                              for (var i = 1; i < arguments.length - 2; i++) {
                                                                  if (typeof arguments[i] === 'undefined') {
                                                                      match[i] = void 0;
                                                                  }
                                                              }

                                Consider simplifying this complex logical expression.
                                Open

                                    if (
                                        'ab'.split(/(?:ab)*/).length !== 2 ||
                                        '.'.split(/(.?)(.?)/).length !== 4 ||
                                        'tesst'.split(/(s)*/)[1] === 't' ||
                                        'test'.split(/(?:)/, -1).length !== 4 ||

                                  Avoid too many return statements within this function.
                                  Open

                                      var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };

                                    XXX found
                                    Open

                                                // XXX can't delete prototype in pure-js.

                                    XXX found
                                    Open

                                                // XXX Build a dynamic function with desired amount of arguments is the only

                                    XXX found
                                    Open

                                                // XXX slicedArgs will stand in for "A" if used

                                    XXX found
                                    Open

                                            // XXX global assignment won't work in embeddings that use

                                    There are no issues that match your filters.

                                    Category
                                    Status