alexminichino/trawell

View on GitHub

Showing 303 of 303 total issues

Function _updateFilesUploadProgress has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    value: function _updateFilesUploadProgress(files, xhr, e) {
      var progress = void 0;
      if (typeof e !== 'undefined') {
        progress = 100 * e.loaded / e.total;

Severity: Major
Found in src/main/resources/static/js/dropzone.js - About 3 hrs to fix

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

            for (var _iterator20 = groupedFiles, _isArray20 = true, _i21 = 0, _iterator20 = _isArray20 ? _iterator20 : _iterator20[Symbol.iterator]();;) {
              var _ref19;
    
              if (_isArray20) {
                if (_i21 >= _iterator20.length) break;
    Severity: Major
    Found in src/main/resources/static/js/dropzone.js and 1 other location - About 3 hrs to fix
    src/main/resources/static/js/dropzone.js on lines 752..767

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

    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

    Function CHILD has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                        "CHILD": function(type, what, argument, first, last) {
                            var simple = type.slice(0, 3) !== "nth",
                                forward = type.slice(-4) !== "last",
                                ofType = what === "of-type";
    
    Severity: Major
    Found in src/main/resources/static/js/jQuery.js - About 3 hrs to fix

      Function _uploadData has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          value: function _uploadData(files, dataBlocks) {
            var _this15 = this;
      
            var xhr = new XMLHttpRequest();
      
      
      Severity: Major
      Found in src/main/resources/static/js/dropzone.js - About 3 hrs to fix

        Function Sizzle has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function Sizzle(selector, context, results, seed) {
                        var m, i, elem, nid, match, groups, newSelector,
                            newContext = context && context.ownerDocument,
        
                            // nodeType defaults to 9, since context defaults to document
        Severity: Major
        Found in src/main/resources/static/js/jQuery.js - About 3 hrs to fix

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

                for (var _iterator22 = files, _isArray22 = true, _i24 = 0, _iterator22 = _isArray22 ? _iterator22 : _iterator22[Symbol.iterator]();;) {
                  var _ref21;
          
                  if (_isArray22) {
                    if (_i24 >= _iterator22.length) break;
          Severity: Major
          Found in src/main/resources/static/js/dropzone.js and 1 other location - About 3 hrs to fix
          src/main/resources/static/js/dropzone.js on lines 871..886

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

          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

          Function contentLoaded has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

          var contentLoaded = function contentLoaded(win, fn) {
            var done = false;
            var top = true;
            var doc = win.document;
            var root = doc.documentElement;
          Severity: Minor
          Found in src/main/resources/static/js/dropzone.js - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

                 $.ajax({
                     dataType: "text",
                     url:"/api/itinerary/modify",
                     headers:{
                      'Accept' : 'application/json',
          Severity: Major
          Found in src/main/resources/static/js/modify_itinerary.js and 1 other location - About 3 hrs to fix
          src/main/resources/static/js/modify_carsharing.js on lines 44..59

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

          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

                      $.ajax({
                          dataType: "text",
                          url:"/api/carsharing/modify",
                          headers:{
                           'Accept' : 'application/json',
          Severity: Major
          Found in src/main/resources/static/js/modify_carsharing.js and 1 other location - About 3 hrs to fix
          src/main/resources/static/js/modify_itinerary.js on lines 44..59

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

          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

          Function send has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          send: function(headers, complete) {
                              var i,
                                  xhr = options.xhr();
          
                              xhr.open(
          Severity: Major
          Found in src/main/resources/static/js/jQuery.js - About 3 hrs to fix

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

                        function matcherFromGroupMatchers(elementMatchers, setMatchers) {
                            var bySet = setMatchers.length > 0,
                                byElement = elementMatchers.length > 0,
                                superMatcher = function(seed, context, xml, results, outermost) {
                                    var elem, j, matcher,
            Severity: Major
            Found in src/main/resources/static/js/jQuery.js - About 2 hrs to fix

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

                      add: function(elem, types, handler, data, selector) {
              
                          var handleObjIn, eventHandle, tmp,
                              events, t, handleObj,
                              special, handlers, type, namespaces, origType,
              Severity: Major
              Found in src/main/resources/static/js/jQuery.js - About 2 hrs to fix

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

                    value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {
                      var _this13 = this;
                
                      // Not using `new Image` here because of a bug in latest Chrome versions.
                      // See https://github.com/enyo/dropzone/pull/226
                Severity: Major
                Found in src/main/resources/static/js/dropzone.js - About 2 hrs to fix

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

                      value: function uploadFiles(files) {
                        var _this14 = this;
                  
                        this._transformFiles(files, function (transformedFiles) {
                          if (files[0].upload.chunked) {
                  Severity: Major
                  Found in src/main/resources/static/js/dropzone.js - About 2 hrs to fix

                    Function resolve has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                            function resolve(depth, deferred, handler, special) {
                                                return function() {
                                                    var that = this,
                                                        args = arguments,
                                                        mightThrow = function() {
                    Severity: Major
                    Found in src/main/resources/static/js/jQuery.js - About 2 hrs to fix

                      Function addedfile has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              addedfile: function addedfile(file) {
                                var _this2 = this;
                      
                                if (this.element === this.previewsContainer) {
                                  this.element.classList.add("dz-started");
                      Severity: Major
                      Found in src/main/resources/static/js/dropzone.js - About 2 hrs to fix

                        Function Dropzone has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function Dropzone(el, options) {
                            _classCallCheck(this, Dropzone);
                        
                            var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this));
                        
                        
                        Severity: Major
                        Found in src/main/resources/static/js/dropzone.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                                              if (forward && useCache) {
                          
                                                                  // Seek `elem` from a previously-cached index
                          
                                                                  // ...in a gzip-friendly way
                          Severity: Critical
                          Found in src/main/resources/static/js/jQuery.js - About 2 hrs to fix

                            Function done has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        function done(status, nativeStatusText, responses, headers) {
                                            var isSuccess, success, error, response, modified,
                                                statusText = nativeStatusText;
                            
                                            // Ignore repeat invocations
                            Severity: Major
                            Found in src/main/resources/static/js/jQuery.js - About 2 hrs to fix

                              Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
                                              if (postFilter && !postFilter[expando]) {
                                                  postFilter = setMatcher(postFilter);
                                              }
                                              if (postFinder && !postFinder[expando]) {
                              Severity: Major
                              Found in src/main/resources/static/js/jQuery.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language