mjackson/mach

View on GitHub
lib/umd/mach.js

Summary

Maintainability
F
1 mo
Test Coverage

File mach.js has 2315 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function webpackUniversalModuleDefinition(root, factory) {
    if(typeof exports === 'object' && typeof module === 'object')
        module.exports = factory();
    else if(typeof define === 'function' && define.amd)
        define(factory);
Severity: Major
Found in lib/umd/mach.js - About 6 days to fix

    Function makePromise has 553 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            return function makePromise(environment) {
    
                var tasks = environment.scheduler;
                var emitRejection = initEmitRejection();
    
    
    Severity: Major
    Found in lib/umd/mach.js - About 2 days to fix

      Function sendRequest has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function sendRequest(conn, location) {
            return new AbortablePromise(function (resolve, reject, onAbort) {
              var xhr = new XMLHttpRequest();
              xhr.open(conn.method, location.href, true);
      
      
      Severity: Minor
      Found in lib/umd/mach.js - About 1 hr to fix

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

            EventEmitter.prototype.emit = function(type) {
              var er, handler, len, args, i, listeners;
        
              if (!this._events)
                this._events = {};
        Severity: Minor
        Found in lib/umd/mach.js - About 1 hr to fix

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

                pipe: d(function (dest, options) {
                  var source = this;
          
                  function ondata(chunk) {
                    if (dest.writable && false === dest.write(chunk))
          Severity: Minor
          Found in lib/umd/mach.js - About 1 hr to fix

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

                EventEmitter.prototype.addListener = function(type, listener) {
                  var m;
            
                  if (!isFunction(listener))
                    throw TypeError('listener must be a function');
            Severity: Minor
            Found in lib/umd/mach.js - About 1 hr to fix

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

                  EventEmitter.prototype.removeListener = function(type, listener) {
                    var list, position, length, i;
              
                    if (!isFunction(listener))
                      throw TypeError('listener must be a function');
              Severity: Minor
              Found in lib/umd/mach.js - About 1 hr to fix

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

                    exports.merge = function (target, source) {
                
                        if (!source) {
                            return target;
                        }
                Severity: Minor
                Found in lib/umd/mach.js - About 1 hr to fix

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

                      internals.stringify = function (obj, prefix, options) {
                  
                          if (Utils.isBuffer(obj)) {
                              obj = obj.toString();
                          }
                  Severity: Minor
                  Found in lib/umd/mach.js - About 1 hr to fix

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

                        function Connection(options) {
                          options = options || {};
                    
                          var location;
                          if (typeof options === "string") {
                    Severity: Minor
                    Found in lib/umd/mach.js - About 1 hr to fix

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

                          function AbortablePromise(resolver) {
                            if (typeof resolver !== "function") throw new Error("AbortablePromise needs a resolver function");
                      
                            var abort;
                            var promise = new Promise(function (resolve, reject) {
                      Severity: Minor
                      Found in lib/umd/mach.js - About 1 hr to fix

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

                            function BufferedStream(maxSize, source, sourceEncoding) {
                              if (!(this instanceof BufferedStream))
                                return new BufferedStream(maxSize, source, sourceEncoding);
                        
                              BaseClass.call(this);
                        Severity: Minor
                        Found in lib/umd/mach.js - About 1 hr to fix

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

                                      function initEmitRejection() {
                                          /*global process, self, CustomEvent*/
                                          if(typeof process !== 'undefined' && process !== null
                                              && typeof process.emit === 'function') {
                                              // Returning falsy here means to call the default
                          Severity: Minor
                          Found in lib/umd/mach.js - About 1 hr to fix

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

                                EventEmitter.prototype.removeAllListeners = function(type) {
                                  var key, listeners;
                            
                                  if (!this._events)
                                    return this;
                            Severity: Minor
                            Found in lib/umd/mach.js - About 1 hr to fix

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

                                  module.exports = function (mach) {
                                    mach.call = __webpack_require__(24);
                              
                                    ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"].forEach(function (method) {
                                      var property = method.toLowerCase();
                              Severity: Minor
                              Found in lib/umd/mach.js - About 1 hr to fix

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

                                            function traverseWith(tryMap, f, promises) {
                                                var handler = typeof f === 'function' ? mapAt : settleAt;
                                
                                                var resolver = new Pending();
                                                var pending = promises.length >>> 0;
                                Severity: Minor
                                Found in lib/umd/mach.js - About 1 hr to fix

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

                                      internals.parseObject = function (chain, val, options) {
                                  
                                          if (!chain.length) {
                                              return val;
                                          }
                                  Severity: Minor
                                  Found in lib/umd/mach.js - About 1 hr to fix

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

                                                function tryAssimilate(then, thenable, resolve, reject, notify) {
                                    Severity: Minor
                                    Found in lib/umd/mach.js - About 35 mins to fix

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

                                                  function runContinuation3(f, x, h, receiver, next) {
                                      Severity: Minor
                                      Found in lib/umd/mach.js - About 35 mins to fix

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

                                                    function tryCatchReject3(f, x, y, thisArg, next) {
                                        Severity: Minor
                                        Found in lib/umd/mach.js - About 35 mins to fix

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

                                                      function traverseAt(promises, handler, i, x, resolver) {
                                          Severity: Minor
                                          Found in lib/umd/mach.js - About 35 mins to fix

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

                                                        Handler.prototype.chain = function(to, receiver, fulfilled, rejected, progress) {
                                            Severity: Minor
                                            Found in lib/umd/mach.js - About 35 mins to fix

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

                                                          function runNotify(f, x, h, receiver, next) {
                                              Severity: Minor
                                              Found in lib/umd/mach.js - About 35 mins to fix

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

                                                    Object.defineProperties(Location.prototype, {
                                                
                                                      /**
                                                       * Creates and returns a new Location with the path and query of
                                                       * the given location appended.
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 6 days to fix
                                                modules/Location.js on lines 64..217

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function Connection(options) {
                                                      options = options || {};
                                                
                                                      var location;
                                                      if (typeof options === "string") {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 2 days to fix
                                                modules/Connection.js on lines 76..114

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

                                                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

                                                      ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"].forEach(function (method) {
                                                        var property = method.toLowerCase();
                                                
                                                        mach[property] = function (app, options, modifier) {
                                                          if (typeof app !== "function") {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 day to fix
                                                modules/extensions/client.js on lines 12..50

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

                                                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

                                                      call: d(function (app) {
                                                        app = app || defaultApp;
                                                
                                                        var conn = this;
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 day to fix
                                                modules/Connection.js on lines 203..231

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function AbortablePromise(resolver) {
                                                      if (typeof resolver !== "function") throw new Error("AbortablePromise needs a resolver function");
                                                
                                                      var abort;
                                                      var promise = new Promise(function (resolve, reject) {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 day to fix
                                                modules/utils/AbortablePromise.js on lines 42..84

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

                                                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

                                                      headers: d.gs(function () {
                                                        return this._headers;
                                                      }, function (value) {
                                                        this._headers = {};
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 day to fix
                                                modules/Message.js on lines 55..75

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function bufferStream(stream, maxLength) {
                                                      maxLength = maxLength || Infinity;
                                                
                                                      if (!stream.readable) throw new Error("Cannot buffer stream that is not readable");
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 day to fix
                                                modules/utils/bufferStream.js on lines 9..38

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function callApp(app, options, modifier) {
                                                      options = options || {};
                                                
                                                      var c = new Connection(options);
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 7 hrs to fix
                                                modules/utils/callApp.js on lines 25..44

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

                                                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

                                                        xhr.onreadystatechange = function () {
                                                          if (xhr.error) return; // readystatechange triggers before error.
                                                
                                                          if (xhr.readyState === 2 && READ_HEADERS_RECEIVED_STATE) {
                                                            try {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 7 hrs to fix
                                                modules/utils/sendRequest-browser.js on lines 89..111

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function parseURL(url) {
                                                      var origin = ORIGIN_MATCHER.exec(url) || {};
                                                
                                                      var anchor = document.createElement("a");
                                                      anchor.href = url;
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 5 hrs to fix
                                                modules/utils/parseURL-browser.js on lines 3..18

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

                                                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 pipeContent(xhr, stream, offset) {
                                                      var content = getContent(xhr);
                                                
                                                      if (content != null) {
                                                        if (content.toString().match(/ArrayBuffer/)) {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 4 hrs to fix
                                                modules/utils/sendRequest-browser.js on lines 27..43

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

                                                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

                                                      addHeader: d(function (headerName, value) {
                                                        headerName = normalizeHeaderName(headerName);
                                                
                                                        var headers = this.headers;
                                                        if (headerName in headers) {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 4 hrs to fix
                                                modules/Message.js on lines 94..107

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

                                                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

                                                      mediaType: d.gs(function () {
                                                        var contentType = this.contentType,
                                                            match;
                                                        return contentType && (match = contentType.match(/^([^;,]+)/)) ? match[1].toLowerCase() : null;
                                                      }, function (value) {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                modules/Message.js on lines 153..158

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

                                                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

                                                      content: d.gs(function () {
                                                        return this._content;
                                                      }, function (value) {
                                                        if (value == null) value = DEFAULT_CONTENT;
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                modules/Message.js on lines 176..190

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

                                                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 (header) {
                                                            var cookies = parseCookie(header);
                                                
                                                            // From RFC 2109:
                                                            // If multiple cookies satisfy the criteria above, they are ordered in
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                modules/Message.js on lines 116..131

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

                                                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

                                                    Object.defineProperties(Message, {
                                                
                                                      PARSERS: d({
                                                        enumerable: true,
                                                        value: {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                modules/Message.js on lines 34..48

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

                                                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

                                                      charset: d.gs(function () {
                                                        var contentType = this.contentType,
                                                            match;
                                                        return contentType && (match = contentType.match(/\bcharset=([\w-]+)/)) ? match[1] : null;
                                                      }, function (value) {
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                modules/Message.js on lines 166..171

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function copy(source, binary, offset) {
                                                      var length = source.length;
                                                      if (offset === undefined) {
                                                        offset = 0;
                                                        if (binary === undefined) binary = create(length);
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                lib/umd/mach.js on lines 1690..1700

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function fromArray(array, binary, offset) {
                                                      var length = array.length;
                                                      if (offset === undefined) {
                                                        offset = 0;
                                                        if (binary === undefined) binary = create(length);
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                lib/umd/mach.js on lines 1546..1556

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

                                                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

                                                      parseContent: d(function (maxLength) {
                                                        if (this._parsedContent) return this._parsedContent;
                                                
                                                        if (typeof maxLength !== "number") maxLength = DEFAULT_MAX_CONTENT_LENGTH;
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                modules/Message.js on lines 238..249

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function setProperties(location, properties) {
                                                      var propertyName;
                                                      for (var i = 0, len = PROPERTY_NAMES.length; i < len; ++i) {
                                                        propertyName = PROPERTY_NAMES[i];
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 3 hrs to fix
                                                modules/Location.js on lines 26..34

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

                                                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

                                                      extend: function extend() {
                                                        var extension;
                                                        for (var i = 0, len = arguments.length; i < len; ++i) {
                                                          extension = arguments[i];
                                                
                                                
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 2 hrs to fix
                                                modules/index.js on lines 15..25

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 91.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function MaxLengthExceededError(maxLength) {
                                                      Error.call(this);
                                                      Error.captureStackTrace(this, this.constructor);
                                                      this.name = this.constructor.name;
                                                      this.message = "Maximum length exceeded";
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 2 hrs to fix
                                                modules/utils/MaxLengthExceededError.js on lines 6..12

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

                                                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

                                                      pathname: d.gs(function () {
                                                        return this.location.pathname.replace(this.basename, "") || "/";
                                                      }, function (value) {
                                                        this.location.pathname = this.basename + value;
                                                      }),
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 2 hrs to fix
                                                modules/Connection.js on lines 184..188

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function enableBinaryContent(xhr) {
                                                      if ("responseType" in xhr) {
                                                        xhr.responseType = "arraybuffer"; // XHR2
                                                      } else if ("overrideMimeType" in xhr) {
                                                        xhr.overrideMimeType("text/plain; charset=x-user-defined"); // XHR
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 2 hrs to fix
                                                modules/utils/sendRequest-browser.js on lines 45..53

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function propertyAlias(propertyName, defaultValue) {
                                                      return d.gs(function () {
                                                        return this.properties[propertyName] || (defaultValue == null ? null : defaultValue);
                                                      }, function (value) {
                                                        this.properties[propertyName] = value;
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 2 hrs to fix
                                                modules/Location.js on lines 15..21

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function makeAbortable(promise, abort) {
                                                      promise.abort = abort;
                                                
                                                      // Hijack promise.then so it returns an abortable promise.
                                                      var _then = promise.then;
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/utils/AbortablePromise.js on lines 3..13

                                                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

                                                    function defaultApp(conn) {
                                                      conn.status = 404;
                                                      conn.response.contentType = "text/plain";
                                                      conn.response.content = "Not found: " + conn.method + " " + conn.path;
                                                    }
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Connection.js on lines 29..33

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

                                                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

                                                      stringifyContent: d(function (maxLength, encoding) {
                                                        encoding = encoding || this.charset;
                                                
                                                        return this.bufferContent(maxLength).then(function (chunk) {
                                                          return bodec.toString(chunk, encoding);
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Message.js on lines 219..225

                                                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

                                                      path: d.gs(function () {
                                                        return this.pathname + this.search;
                                                      }, function (value) {
                                                        this.location.path = this.basename + value;
                                                      }),
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Connection.js on lines 193..197

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

                                                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

                                                      method: d.gs(function () {
                                                        return this._method;
                                                      }, function (value) {
                                                        this._method = typeof value === "string" ? value.toUpperCase() : "GET";
                                                      }),
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Connection.js on lines 121..125

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function Location(options) {
                                                      this.properties = {};
                                                
                                                      if (typeof options === "string") {
                                                        this.href = options;
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Location.js on lines 54..62

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

                                                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 (header) {
                                                          var parts = header.split(" ", 2);
                                                          var scheme = parts[0];
                                                
                                                          if (scheme.toLowerCase() === "basic") return decodeBase64(parts[1]);
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Connection.js on lines 159..167

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

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function defaultErrorHandler(error) {
                                                      if (typeof console !== "undefined" && console.error) {
                                                        console.error(error && error.stack || error);
                                                      } else {
                                                        throw error; // Don't silently swallow errors!
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Connection.js on lines 19..25

                                                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

                                                    module.exports = ["Content-ID", "Content-MD5", "DNT", "ETag", "P3P", "TE", "WWW-Authenticate", "X-ATT-DeviceId", "X-UA-Compatible", "X-WebKit-CSP", "X-XSS-Protection"].reduce(function (map, headerName) {
                                                      map[headerName.toLowerCase()] = headerName;
                                                      return map;
                                                    }, {});
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/utils/IrregularHeaderNames.js on lines 4..19

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

                                                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

                                                      location: d.gs(function () {
                                                        return this._location;
                                                      }, function (value) {
                                                        this._location = value instanceof Location ? value : new Location(value);
                                                      }),
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Connection.js on lines 130..134

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function locationPropertyAlias(name) {
                                                      return d.gs(function () {
                                                        return this.location[name];
                                                      }, function (value) {
                                                        this.location[name] = value;
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Connection.js on lines 11..17

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

                                                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

                                                      bufferContent: d(function (maxLength) {
                                                        if (this._bufferedContent == null) this._bufferedContent = bufferStream(this.content, maxLength);
                                                
                                                        return this._bufferedContent;
                                                      }),
                                                Severity: Major
                                                Found in lib/umd/mach.js and 1 other location - About 1 hr to fix
                                                modules/Message.js on lines 206..211

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 56.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    function copyStatusAndHeaders(xhr, conn) {
                                                      conn.response.headers = xhr.getAllResponseHeaders();
                                                      conn.status = xhr.status;
                                                      return conn.status;
                                                    }
                                                Severity: Minor
                                                Found in lib/umd/mach.js and 1 other location - About 55 mins to fix
                                                modules/utils/sendRequest-browser.js on lines 6..10

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

                                                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

                                                      contentType: d.gs(function () {
                                                        return this.headers["Content-Type"];
                                                      }, function (value) {
                                                        this.headers["Content-Type"] = value;
                                                      }),
                                                Severity: Minor
                                                Found in lib/umd/mach.js and 1 other location - About 55 mins to fix
                                                modules/Message.js on lines 140..144

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 53.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        Scheduler.prototype.enqueue = function(task) {
                                                            this._queue[this._queueLen++] = task;
                                                            this.run();
                                                        };
                                                Severity: Minor
                                                Found in lib/umd/mach.js and 1 other location - About 50 mins to fix
                                                lib/umd/mach.js on lines 3557..3560

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

                                                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

                                                        Scheduler.prototype.afterQueue = function(task) {
                                                            this._afterQueue[this._afterQueueLen++] = task;
                                                            this.run();
                                                        };
                                                Severity: Minor
                                                Found in lib/umd/mach.js and 1 other location - About 50 mins to fix
                                                lib/umd/mach.js on lines 3548..3551

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

                                                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