acsone/alfodoo

View on GitHub
cmis_web/static/lib/cmisjs/superagent.7.2.0.js

Summary

Maintainability
F
6 days
Test Coverage

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

},{}],3:[function(require,module,exports){
/**
 * Module dependencies.
 */

Severity: Major
Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 2 days to fix

    File superagent.7.2.0.js has 544 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.superagent = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    
    /**
     * Expose `Emitter`.
     */
    Severity: Major
    Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 1 day to fix

      Function 1 has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.superagent = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
      
      /**
       * Expose `Emitter`.
       */
      Severity: Major
      Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 2 hrs to fix

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

        Request.prototype.end = function(fn){
          var self = this;
          var xhr = this.xhr = request.getXHR();
          var query = this._query.join('&');
          var timeout = this._timeout;
        Severity: Major
        Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 2 hrs to fix

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

          function Request(method, url) {
            var self = this;
            Emitter.call(this);
            this._query = this._query || [];
            this.method = method;
          Severity: Minor
          Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}
            Severity: Major
            Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return false;
              Severity: Major
              Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 30 mins to fix

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

                request.get = function(url, data, fn){
                  var req = request('GET', url);
                  if ('function' == typeof data) fn = data, data = null;
                  if (data) req.query(data);
                  if (fn) req.end(fn);
                Severity: Major
                Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 4 other locations - About 2 hrs to fix
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1296..1302
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1332..1338
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1350..1356
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1368..1374

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

                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 5 locations. Consider refactoring.
                Open

                request.patch = function(url, data, fn){
                  var req = request('PATCH', url);
                  if ('function' == typeof data) fn = data, data = null;
                  if (data) req.send(data);
                  if (fn) req.end(fn);
                Severity: Major
                Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 4 other locations - About 2 hrs to fix
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1278..1284
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1296..1302
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1350..1356
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1368..1374

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

                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 5 locations. Consider refactoring.
                Open

                request.put = function(url, data, fn){
                  var req = request('PUT', url);
                  if ('function' == typeof data) fn = data, data = null;
                  if (data) req.send(data);
                  if (fn) req.end(fn);
                Severity: Major
                Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 4 other locations - About 2 hrs to fix
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1278..1284
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1296..1302
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1332..1338
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1350..1356

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

                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 5 locations. Consider refactoring.
                Open

                request.head = function(url, data, fn){
                  var req = request('HEAD', url);
                  if ('function' == typeof data) fn = data, data = null;
                  if (data) req.send(data);
                  if (fn) req.end(fn);
                Severity: Major
                Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 4 other locations - About 2 hrs to fix
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1278..1284
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1332..1338
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1350..1356
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1368..1374

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

                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 5 locations. Consider refactoring.
                Open

                request.post = function(url, data, fn){
                  var req = request('POST', url);
                  if ('function' == typeof data) fn = data, data = null;
                  if (data) req.send(data);
                  if (fn) req.end(fn);
                Severity: Major
                Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 4 other locations - About 2 hrs to fix
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1278..1284
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1296..1302
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1332..1338
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1368..1374

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

                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

                Request.prototype.type = function(type){
                  this.set('Content-Type', request.types[type] || type);
                  return this;
                };
                Severity: Minor
                Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 1 other location - About 50 mins to fix
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 902..905

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

                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

                Request.prototype.accept = function(type){
                  this.set('Accept', request.types[type] || type);
                  return this;
                };
                Severity: Minor
                Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 1 other location - About 50 mins to fix
                cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 863..866

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

                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