Hirse/brackets-outline-list

View on GitHub
thirdparty/promise.js

Summary

Maintainability
F
1 wk
Test Coverage

Function 2 has 297 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],2:[function(require,module,exports){
(function (setImmediate){(function (){
'use strict';

/**
Severity: Major
Found in thirdparty/promise.js - About 1 day to fix

    File promise.js has 511 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**!
     * Promise Polyfill version 8.3.0
     * (browserified with Browserify version 17.0.0)
     *
     * MIT License
    Severity: Major
    Found in thirdparty/promise.js - About 1 day to fix

      Function 1 has 149 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.promise = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
      // shim for using process in browser
      var process = module.exports = {};
      
      // cached from whatever global is present so that test runners that stub it
      Severity: Major
      Found in thirdparty/promise.js - About 5 hrs to fix

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

        },{"timers":3}],3:[function(require,module,exports){
        (function (setImmediate,clearImmediate){(function (){
        var nextTick = require('process/browser.js').nextTick;
        var apply = Function.prototype.apply;
        var slice = Array.prototype.slice;
        Severity: Major
        Found in thirdparty/promise.js - About 2 hrs to fix

          Function allSettled has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function allSettled(arr) {
            var P = this;
            return new P(function(resolve, reject) {
              if (!(arr && typeof arr.length !== 'undefined')) {
                return reject(
          Severity: Minor
          Found in thirdparty/promise.js - About 1 hr to fix

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

            Promise.all = function(arr) {
              return new Promise(function(resolve, reject) {
                if (!isArray(arr)) {
                  return reject(new TypeError('Promise.all accepts an array'));
                }
            Severity: Minor
            Found in thirdparty/promise.js - About 1 hr to fix

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

              function any(arr) {
                var P = this;
                return new P(function(resolve, reject) {
                  if (!(arr && typeof arr.length !== 'undefined')) {
                    return reject(new TypeError('Promise.any accepts an array'));
              Severity: Minor
              Found in thirdparty/promise.js - About 1 hr to fix

                Avoid too many return statements within this function.
                Open

                            return cachedClearTimeout.call(this, marker);
                Severity: Major
                Found in thirdparty/promise.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return cachedSetTimeout.call(this, fun, 0);
                  Severity: Major
                  Found in thirdparty/promise.js - About 30 mins to fix

                    Similar blocks of code found in 3 locations. 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.promise = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
                    // shim for using process in browser
                    var process = module.exports = {};
                    
                    // cached from whatever global is present so that test runners that stub it
                    Severity: Major
                    Found in thirdparty/promise.js and 2 other locations - About 1 wk to fix
                    thirdparty/php-parser.js on lines 8557..8743
                    thirdparty/postcss-safe-parser.js on lines 6428..6614

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

                    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