darkwallet/darkwallet

View on GitHub
src/vendors/async/lib/async.js

Summary

Maintainability
F
1 wk
Test Coverage

File async.js has 937 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*jshint onevar: false, indent:4 */
/*global setImmediate: false, setTimeout: false, console: false */
(function () {

    var async = {};
Severity: Major
Found in src/vendors/async/lib/async.js - About 2 days to fix

    Function queue has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        async.queue = function (worker, concurrency) {
            if (concurrency === undefined) {
                concurrency = 1;
            }
            function _insert(q, data, pos, callback) {
    Severity: Major
    Found in src/vendors/async/lib/async.js - About 3 hrs to fix

      Function auto has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          async.auto = function (tasks, callback) {
              callback = callback || function () {};
              var keys = _keys(tasks);
              var remainingTasks = keys.length
              if (!remainingTasks) {
      Severity: Major
      Found in src/vendors/async/lib/async.js - About 2 hrs to fix

        Function cargo has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async.cargo = function (worker, payload) {
                var working     = false,
                    tasks       = [];
        
                var cargo = {
        Severity: Major
        Found in src/vendors/async/lib/async.js - About 2 hrs to fix

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

              var _eachLimit = function (limit) {
          
                  return function (arr, iterator, callback) {
                      callback = callback || function () {};
                      if (!arr.length || limit <= 0) {
          Severity: Minor
          Found in src/vendors/async/lib/async.js - About 1 hr to fix

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

                async.memoize = function (fn, hasher) {
                    var memo = {};
                    var queues = {};
                    hasher = hasher || function (x) {
                        return x;
            Severity: Minor
            Found in src/vendors/async/lib/async.js - About 1 hr to fix

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

                  async.waterfall = function (tasks, callback) {
                      callback = callback || function () {};
                      if (!_isArray(tasks)) {
                        var err = new Error('First argument to waterfall must be an array of functions');
                        return callback(err);
              Severity: Minor
              Found in src/vendors/async/lib/async.js - About 1 hr to fix

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

                    async.series = function (tasks, callback) {
                        callback = callback || function () {};
                        if (_isArray(tasks)) {
                            async.mapSeries(tasks, function (fn, callback) {
                                if (fn) {
                Severity: Minor
                Found in src/vendors/async/lib/async.js - About 1 hr to fix

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

                      var _parallel = function(eachfn, tasks, callback) {
                          callback = callback || function () {};
                          if (_isArray(tasks)) {
                              eachfn.map(tasks, function (fn, callback) {
                                  if (fn) {
                  Severity: Minor
                  Found in src/vendors/async/lib/async.js - About 1 hr to fix

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

                            function _insert(q, data, pos, callback) {
                              if (!q.started){
                                q.started = true;
                              }
                              if (!_isArray(data)) {
                    Severity: Minor
                    Found in src/vendors/async/lib/async.js - About 1 hr to fix

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

                          var _parallel = function(eachfn, tasks, callback) {
                              callback = callback || function () {};
                              if (_isArray(tasks)) {
                                  eachfn.map(tasks, function (fn, callback) {
                                      if (fn) {
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 day to fix
                      src/vendors/async/lib/async.js on lines 590..620

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

                      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

                          async.series = function (tasks, callback) {
                              callback = callback || function () {};
                              if (_isArray(tasks)) {
                                  async.mapSeries(tasks, function (fn, callback) {
                                      if (fn) {
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 day to fix
                      src/vendors/async/lib/async.js on lines 550..580

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

                      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

                          async.times = function (count, iterator, callback) {
                              var counter = [];
                              for (var i = 0; i < count; i++) {
                                  counter.push(i);
                              }
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 hr to fix
                      src/vendors/async/lib/async.js on lines 963..969

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

                      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

                          async.timesSeries = function (count, iterator, callback) {
                              var counter = [];
                              for (var i = 0; i < count; i++) {
                                  counter.push(i);
                              }
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 hr to fix
                      src/vendors/async/lib/async.js on lines 955..961

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

                      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 doParallel = function (fn) {
                              return function () {
                                  var args = Array.prototype.slice.call(arguments);
                                  return fn.apply(null, [async.each].concat(args));
                              };
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 hr to fix
                      src/vendors/async/lib/async.js on lines 221..226

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

                      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 doSeries = function (fn) {
                              return function () {
                                  var args = Array.prototype.slice.call(arguments);
                                  return fn.apply(null, [async.eachSeries].concat(args));
                              };
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 hr to fix
                      src/vendors/async/lib/async.js on lines 209..214

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

                      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 (err) {
                                  callback(_map(results.sort(function (a, b) {
                                      return a.index - b.index;
                                  }), function (x) {
                                      return x.value;
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 hr to fix
                      src/vendors/async/lib/async.js on lines 317..323

                      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

                              }, function (err) {
                                  callback(_map(results.sort(function (a, b) {
                                      return a.index - b.index;
                                  }), function (x) {
                                      return x.value;
                      Severity: Major
                      Found in src/vendors/async/lib/async.js and 1 other location - About 1 hr to fix
                      src/vendors/async/lib/async.js on lines 291..297

                      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

                                  resume: function () {
                                      if (q.paused === false) { return; }
                                      q.paused = false;
                                      q.process();
                                  }
                      Severity: Minor
                      Found in src/vendors/async/lib/async.js and 1 other location - About 35 mins to fix
                      src/vendors/async/lib/async.js on lines 806..810

                      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

                                  pause: function () {
                                      if (q.paused === true) { return; }
                                      q.paused = true;
                                      q.process();
                                  },
                      Severity: Minor
                      Found in src/vendors/async/lib/async.js and 1 other location - About 35 mins to fix
                      src/vendors/async/lib/async.js on lines 811..815

                      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