ruby-grape/grape-swagger-rails

View on GitHub
app/assets/javascripts/grape_swagger_rails/es5-shim.js

Summary

Maintainability
F
1 wk
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
 */
Severity: Major
Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 4 days to fix

    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]),
    Severity: Critical
    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 2 hrs to fix

      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);
      Severity: Major
      Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 2 hrs to fix

        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);
        Severity: Major
        Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 2 hrs to fix

          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 [];
                          }
          Severity: Major
          Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 2 hrs to fix

            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
            Severity: Critical
            Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 2 hrs to fix

              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
              Severity: Minor
              Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 1 hr to fix

                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)) {
                Severity: Minor
                Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 1 hr to fix

                  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);
                  
                  
                  Severity: Minor
                  Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 1 hr to fix

                    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);
                    Severity: Minor
                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 1 hr to fix

                      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);
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 1 hr to fix

                        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;
                        Severity: Minor
                        Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 1 hr to fix

                          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) {
                          Severity: Minor
                          Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 1 hr to fix

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

                                        var DateShim = function Date(Y, M, D, h, m, s, ms) {
                            Severity: Major
                            Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 50 mins to fix

                              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;
                                                                  }
                                                              }
                              Severity: Major
                              Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 45 mins to fix

                                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 ||
                                Severity: Major
                                Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 40 mins to fix

                                  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; };
                                  Severity: Major
                                  Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js - About 30 mins to fix

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

                                            getDate: function getDate() {
                                                if (!this || !(this instanceof Date)) {
                                                    throw new TypeError('this is not a Date object.');
                                                }
                                                var year = originalGetFullYear(this);
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 4 hrs to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1204..1219

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

                                    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

                                            getUTCDate: function getUTCDate() {
                                                if (!this || !(this instanceof Date)) {
                                                    throw new TypeError('this is not a Date object.');
                                                }
                                                var year = originalGetUTCFullYear(this);
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 4 hrs to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1167..1182

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

                                    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

                                            getMonth: function getMonth() {
                                                if (!this || !(this instanceof Date)) {
                                                    throw new TypeError('this is not a Date object.');
                                                }
                                                var year = originalGetFullYear(this);
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 2 hrs to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1193..1203

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

                                    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

                                            getUTCMonth: function getUTCMonth() {
                                                if (!this || !(this instanceof Date)) {
                                                    throw new TypeError('this is not a Date object.');
                                                }
                                                var year = originalGetUTCFullYear(this);
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 2 hrs to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1156..1166

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

                                    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

                                            getUTCFullYear: function getUTCFullYear() {
                                                if (!this || !(this instanceof Date)) {
                                                    throw new TypeError('this is not a Date object.');
                                                }
                                                var year = originalGetUTCFullYear(this);
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 2 hrs to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1146..1155

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

                                    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

                                            getFullYear: function getFullYear() {
                                                if (!this || !(this instanceof Date)) {
                                                    throw new TypeError('this is not a Date object.');
                                                }
                                                var year = originalGetFullYear(this);
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 2 hrs to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1183..1192

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

                                    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

                                                        if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
                                                            // work around a Safari 8/9 bug where it treats the seconds as signed
                                                            var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
                                                            var sToShift = Math.floor(msToShift / 1e3);
                                                            seconds += sToShift;
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1491..1497

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

                                    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

                                                    if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
                                                        // work around a Safari 8/9 bug where it treats the seconds as signed
                                                        var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
                                                        var sToShift = Math.floor(msToShift / 1e3);
                                                        s += sToShift;
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1422..1428

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

                                    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

                                        var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 72..72

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

                                    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

                                        var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; };
                                    Severity: Major
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 73..73

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

                                    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

                                        if (ArrayPrototype.reduce) {
                                            reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) {
                                                return list;
                                            }) === 'object';
                                        }
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 40 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 628..632

                                    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

                                        if (ArrayPrototype.reduceRight) {
                                            reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) {
                                                return list;
                                            }) === 'object';
                                        }
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 40 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 575..579

                                    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

                                                return dayName[day] + ' ' +
                                                    monthName[month] + ' ' +
                                                    (date < 10 ? '0' + date : date) + ' ' +
                                                    year;
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 35 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1277..1280

                                    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

                                                return dayName[day] + ' ' +
                                                    monthName[month] + ' ' +
                                                    (date < 10 ? '0' + date : date) + ' ' +
                                                    year + ' ' +
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 35 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1254..1257

                                    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

                                        if (timeZoneOffset < -720) {
                                            hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875';
                                            hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
                                        } else {
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1123..1126

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

                                    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

                                                if (typeof msg === 'undefined') {
                                                    msg = '';
                                                } else if (typeof msg !== 'string') {
                                                    msg = $String(msg);
                                                }
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 2008..2012

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

                                    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

                                        } else {
                                            hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875';
                                            hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
                                        }
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 1120..1123

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

                                    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

                                                if (typeof name === 'undefined') {
                                                    name = 'Error';
                                                } else if (typeof name !== 'string') {
                                                    name = $String(name);
                                                }
                                    Severity: Minor
                                    Found in app/assets/javascripts/grape_swagger_rails/es5-shim.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/grape_swagger_rails/es5-shim.js on lines 2014..2018

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

                                    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