alexminichino/trawell

View on GitHub
src/main/resources/static/js/dropzone.js

Summary

Maintainability
F
2 mos
Test Coverage

Function Dropzone has a Cognitive Complexity of 1133 (exceeds 5 allowed). Consider refactoring.
Open

var Dropzone = function (_Emitter) {
  _inherits(Dropzone, _Emitter);

  _createClass(Dropzone, null, [{
    key: "initClass",
Severity: Minor
Found in src/main/resources/static/js/dropzone.js - About 3 wks 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

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

var Dropzone = function (_Emitter) {
  _inherits(Dropzone, _Emitter);

  _createClass(Dropzone, null, [{
    key: "initClass",
Severity: Major
Found in src/main/resources/static/js/dropzone.js - About 1 wk to fix

    File dropzone.js has 2373 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
    
    function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
    Severity: Major
    Found in src/main/resources/static/js/dropzone.js - About 6 days to fix

      Function initClass has 354 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          value: function initClass() {
      
            // Exposing the emitter class, mainly for tests
            this.prototype.Emitter = Emitter;
      
      
      Severity: Major
      Found in src/main/resources/static/js/dropzone.js - About 1 day to fix

        Function Emitter has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

        var Emitter = function () {
          function Emitter() {
            _classCallCheck(this, Emitter);
          }
        
        
        Severity: Minor
        Found in src/main/resources/static/js/dropzone.js - About 6 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

        Function ExifRestore has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

        var ExifRestore = function () {
          function ExifRestore() {
            _classCallCheck(this, ExifRestore);
          }
        
        
        Severity: Minor
        Found in src/main/resources/static/js/dropzone.js - About 6 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

        Function getElements has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

        Dropzone.getElements = function (els, name) {
          var el = void 0,
              elements = void 0;
          if (els instanceof Array) {
            elements = [];
        Severity: Minor
        Found in src/main/resources/static/js/dropzone.js - About 6 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

        Function ExifRestore has 156 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var ExifRestore = function () {
          function ExifRestore() {
            _classCallCheck(this, ExifRestore);
          }
        
        
        Severity: Major
        Found in src/main/resources/static/js/dropzone.js - About 6 hrs to fix

          Function init has 137 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              value: function init() {
                var _this3 = this;
          
                // In case it isn't set already
                if (this.element.tagName === "form") {
          Severity: Major
          Found in src/main/resources/static/js/dropzone.js - About 5 hrs to fix

            Function discover has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

            Dropzone.discover = function () {
              var dropzones = void 0;
              if (document.querySelectorAll) {
                dropzones = document.querySelectorAll(".dropzone");
              } else {
            Severity: Minor
            Found in src/main/resources/static/js/dropzone.js - About 5 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

            Function isBrowserSupported has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

            Dropzone.isBrowserSupported = function () {
              var capableBrowser = true;
            
              if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
                if (!("classList" in document.createElement("a"))) {
            Severity: Minor
            Found in src/main/resources/static/js/dropzone.js - About 4 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

            Function isValidFile has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            Dropzone.isValidFile = function (file, acceptedFiles) {
              if (!acceptedFiles) {
                return true;
              } // If there are no accepted mime types, it's OK
              acceptedFiles = acceptedFiles.split(",");
            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

            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

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

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

                        Function Emitter has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var Emitter = function () {
                          function Emitter() {
                            _classCallCheck(this, Emitter);
                          }
                        
                        
                        Severity: Major
                        Found in src/main/resources/static/js/dropzone.js - About 2 hrs to fix

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

                                img.onload = function () {
                                  var loadExif = function loadExif(callback) {
                                    return callback(1);
                                  };
                                  if (typeof EXIF !== 'undefined' && EXIF !== null && fixOrientation) {
                          Severity: Major
                          Found in src/main/resources/static/js/dropzone.js - About 2 hrs to fix

                            Function discover has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Dropzone.discover = function () {
                              var dropzones = void 0;
                              if (document.querySelectorAll) {
                                dropzones = document.querySelectorAll(".dropzone");
                              } else {
                            Severity: Major
                            Found in src/main/resources/static/js/dropzone.js - About 2 hrs to fix

                              Function cancelUpload has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  value: function cancelUpload(file) {
                                    if (file.status === Dropzone.UPLOADING) {
                                      var groupedFiles = this._getFilesWithXhr(file.xhr);
                                      for (var _iterator20 = groupedFiles, _isArray20 = true, _i21 = 0, _iterator20 = _isArray20 ? _iterator20 : _iterator20[Symbol.iterator]();;) {
                                        var _ref19;
                              Severity: Minor
                              Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

                                Function resize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        resize: function resize(file, width, height, resizeMethod) {
                                          var info = {
                                            srcX: 0,
                                            srcY: 0,
                                            srcWidth: file.width,
                                Severity: Minor
                                Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

                                  Function setupHiddenFileInput has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          var setupHiddenFileInput = function setupHiddenFileInput() {
                                            if (_this3.hiddenFileInput) {
                                              _this3.hiddenFileInput.parentNode.removeChild(_this3.hiddenFileInput);
                                            }
                                            _this3.hiddenFileInput = document.createElement("input");
                                  Severity: Minor
                                  Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                    Dropzone.getElements = function (els, name) {
                                      var el = void 0,
                                          elements = void 0;
                                      if (els instanceof Array) {
                                        elements = [];
                                    Severity: Minor
                                    Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                          value: function _addFilesFromDirectory(directory, path) {
                                            var _this6 = this;
                                      
                                            var dirReader = directory.createReader();
                                      
                                      
                                      Severity: Minor
                                      Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

                                        Function contentLoaded has 38 lines of code (exceeds 25 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 1 hr to fix

                                          Function _addFormElementData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              value: function _addFormElementData(formData) {
                                                // Take care of other input elements
                                                if (this.element.tagName === "FORM") {
                                                  for (var _iterator24 = this.element.querySelectorAll("input, textarea, select, button"), _isArray24 = true, _i26 = 0, _iterator24 = _isArray24 ? _iterator24 : _iterator24[Symbol.iterator]();;) {
                                                    var _ref23;
                                          Severity: Minor
                                          Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

                                            Function decode64 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                value: function decode64(input) {
                                                  var output = '';
                                                  var chr1 = undefined;
                                                  var chr2 = undefined;
                                                  var chr3 = '';
                                            Severity: Minor
                                            Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

                                              Function _addFilesFromItems has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  value: function _addFilesFromItems(items) {
                                                    var _this5 = this;
                                              
                                                    return function () {
                                                      var result = [];
                                              Severity: Minor
                                              Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                Dropzone.isValidFile = function (file, acceptedFiles) {
                                                  if (!acceptedFiles) {
                                                    return true;
                                                  } // If there are no accepted mime types, it's OK
                                                  acceptedFiles = acceptedFiles.split(",");
                                                Severity: Minor
                                                Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                          fallback: function fallback() {
                                                            // This code should pass in IE7... :(
                                                            var messageElement = void 0;
                                                            this.element.className = this.element.className + " dz-browser-not-supported";
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

                                                    Function drawImageIOSFix has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                    var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
                                                    Severity: Major
                                                    Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                          value: function encode64(input) {
                                                            var output = '';
                                                            var chr1 = undefined;
                                                            var chr2 = undefined;
                                                            var chr3 = '';
                                                      Severity: Minor
                                                      Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                              var readEntries = function readEntries() {
                                                                return dirReader.readEntries(function (entries) {
                                                                  if (entries.length > 0) {
                                                                    for (var _iterator16 = entries, _isArray16 = true, _i17 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) {
                                                                      var _ref15;
                                                        Severity: Minor
                                                        Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                              value: function _finishedUploading(files, xhr, e) {
                                                                var response = void 0;
                                                          
                                                                if (files[0].status === Dropzone.CANCELED) {
                                                                  return;
                                                          Severity: Minor
                                                          Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                            var detectVerticalSquash = function detectVerticalSquash(img) {
                                                              var iw = img.naturalWidth;
                                                              var ih = img.naturalHeight;
                                                              var canvas = document.createElement("canvas");
                                                              canvas.width = 1;
                                                            Severity: Minor
                                                            Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                              Dropzone.isBrowserSupported = function () {
                                                                var capableBrowser = true;
                                                              
                                                                if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
                                                                  if (!("classList" in document.createElement("a"))) {
                                                              Severity: Minor
                                                              Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

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

                                                                    value: function addFile(file) {
                                                                      var _this7 = this;
                                                                
                                                                      file.upload = {
                                                                        uuid: Dropzone.uuidv4(),
                                                                Severity: Minor
                                                                Found in src/main/resources/static/js/dropzone.js - About 1 hr to fix

                                                                  Function value has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                      value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {
                                                                  Severity: Major
                                                                  Found in src/main/resources/static/js/dropzone.js - About 50 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                      if (_i10 >= _iterator10.length) break;
                                                                    Severity: Major
                                                                    Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                      Function value has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                      Open

                                                                          value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) {
                                                                      Severity: Minor
                                                                      Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                          if (_i10.done) break;
                                                                        Severity: Major
                                                                        Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                    if (_i37 >= _iterator35.length) break;
                                                                          Severity: Major
                                                                          Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                          if (_i28 >= _iterator26.length) break;
                                                                            Severity: Major
                                                                            Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                            if (_i28.done) break;
                                                                              Severity: Major
                                                                              Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                              if (option.selected) {
                                                                                                formData.append(inputName, option.value);
                                                                                              }
                                                                                Severity: Major
                                                                                Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                          if (_i39 >= _iterator37.length) break;
                                                                                  Severity: Major
                                                                                  Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                  if (_isArray25) {
                                                                                                    if (_i27 >= _iterator25.length) break;
                                                                                                    _ref24 = _iterator25[_i27++];
                                                                                                  } else {
                                                                                                    _i27 = _iterator25.next();
                                                                                    Severity: Major
                                                                                    Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                if (_i37.done) break;
                                                                                      Severity: Major
                                                                                      Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                if (_i39.done) break;
                                                                                        Severity: Major
                                                                                        Found in src/main/resources/static/js/dropzone.js - About 45 mins to fix

                                                                                          Consider simplifying this complex logical expression.
                                                                                          Open

                                                                                            if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
                                                                                              if (!("classList" in document.createElement("a"))) {
                                                                                                capableBrowser = false;
                                                                                              } else {
                                                                                                // The browser supports the API, but may be blacklisted.
                                                                                          Severity: Major
                                                                                          Found in src/main/resources/static/js/dropzone.js - About 40 mins to fix

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

                                                                                                value: function resizeImage(file, width, height, resizeMethod, callback) {
                                                                                            Severity: Minor
                                                                                            Found in src/main/resources/static/js/dropzone.js - About 35 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                return false;
                                                                                              Severity: Major
                                                                                              Found in src/main/resources/static/js/dropzone.js - About 30 mins to fix

                                                                                                Function detectVerticalSquash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                Open

                                                                                                var detectVerticalSquash = function detectVerticalSquash(img) {
                                                                                                  var iw = img.naturalWidth;
                                                                                                  var ih = img.naturalHeight;
                                                                                                  var canvas = document.createElement("canvas");
                                                                                                  canvas.width = 1;
                                                                                                Severity: Minor
                                                                                                Found in src/main/resources/static/js/dropzone.js - About 25 mins 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

                                                                                                Function _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                Open

                                                                                                var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
                                                                                                Severity: Minor
                                                                                                Found in src/main/resources/static/js/dropzone.js - About 25 mins 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

                                                                                                    value: function _finished(files, responseText, e) {
                                                                                                      for (var _iterator31 = files, _isArray31 = true, _i33 = 0, _iterator31 = _isArray31 ? _iterator31 : _iterator31[Symbol.iterator]();;) {
                                                                                                        var _ref30;
                                                                                                
                                                                                                        if (_isArray31) {
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 1 day to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 2823..2850

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

                                                                                                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

                                                                                                    value: function _errorProcessing(files, message, xhr) {
                                                                                                      for (var _iterator32 = files, _isArray32 = true, _i34 = 0, _iterator32 = _isArray32 ? _iterator32 : _iterator32[Symbol.iterator]();;) {
                                                                                                        var _ref31;
                                                                                                
                                                                                                        if (_isArray32) {
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 1 day to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 2789..2816

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

                                                                                                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

                                                                                                      for (var _iterator14 = files, _isArray14 = true, _i15 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) {
                                                                                                        var _ref13;
                                                                                                
                                                                                                        if (_isArray14) {
                                                                                                          if (_i15 >= _iterator14.length) break;
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 5 hrs to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 1853..1868

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

                                                                                                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

                                                                                                      for (var _iterator17 = files, _isArray17 = true, _i18 = 0, _iterator17 = _isArray17 ? _iterator17 : _iterator17[Symbol.iterator]();;) {
                                                                                                        var _ref16;
                                                                                                
                                                                                                        if (_isArray17) {
                                                                                                          if (_i18 >= _iterator17.length) break;
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 5 hrs to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 1666..1681

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

                                                                                                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

                                                                                                  }, {
                                                                                                    key: "setupEventListeners",
                                                                                                    value: function setupEventListeners() {
                                                                                                      return this.listeners.map(function (elementListeners) {
                                                                                                        return function () {
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 4 hrs to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 1533..1550

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

                                                                                                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

                                                                                                  }, {
                                                                                                    key: "removeEventListeners",
                                                                                                    value: function removeEventListeners() {
                                                                                                      return this.listeners.map(function (elementListeners) {
                                                                                                        return function () {
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 4 hrs to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 1516..1533

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

                                                                                                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

                                                                                                        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

                                                                                                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

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

                                                                                                        for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                                                                                                          args[_key - 1] = arguments[_key];
                                                                                                        }
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 2 other locations - About 1 hr to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 986..988
                                                                                                src/main/resources/static/js/dropzone.js on lines 2263..2265

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

                                                                                                      for (var _len2 = arguments.length, objects = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                                                                                                        objects[_key2 - 1] = arguments[_key2];
                                                                                                      }
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 2 other locations - About 1 hr to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 66..68
                                                                                                src/main/resources/static/js/dropzone.js on lines 2263..2265

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

                                                                                                        for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
                                                                                                          args[_key3 - 1] = arguments[_key3];
                                                                                                        }
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 2 other locations - About 1 hr to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 66..68
                                                                                                src/main/resources/static/js/dropzone.js on lines 986..988

                                                                                                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

                                                                                                        for (var _iterator24 = this.element.querySelectorAll("input, textarea, select, button"), _isArray24 = true, _i26 = 0, _iterator24 = _isArray24 ? _iterator24 : _iterator24[Symbol.iterator]();;) {
                                                                                                          var _ref23;
                                                                                                
                                                                                                          if (_isArray24) {
                                                                                                            if (_i26 >= _iterator24.length) break;
                                                                                                Severity: Minor
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 556..575

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

                                                                                                            for (var _iterator5 = file.previewElement.querySelectorAll("[data-dz-remove]"), _isArray5 = true, _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
                                                                                                              var _ref4;
                                                                                                
                                                                                                              if (_isArray5) {
                                                                                                                if (_i5 >= _iterator5.length) break;
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 5 other locations - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 752..767
                                                                                                src/main/resources/static/js/dropzone.js on lines 768..779
                                                                                                src/main/resources/static/js/dropzone.js on lines 838..854
                                                                                                src/main/resources/static/js/dropzone.js on lines 871..886
                                                                                                src/main/resources/static/js/dropzone.js on lines 911..926

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

                                                                                                            for (var _iterator3 = file.previewElement.querySelectorAll("[data-dz-name]"), _isArray3 = true, _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
                                                                                                              var _ref3;
                                                                                                
                                                                                                              if (_isArray3) {
                                                                                                                if (_i3 >= _iterator3.length) break;
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 5 other locations - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 768..779
                                                                                                src/main/resources/static/js/dropzone.js on lines 804..819
                                                                                                src/main/resources/static/js/dropzone.js on lines 838..854
                                                                                                src/main/resources/static/js/dropzone.js on lines 871..886
                                                                                                src/main/resources/static/js/dropzone.js on lines 911..926

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

                                                                                                            for (var _iterator4 = file.previewElement.querySelectorAll("[data-dz-size]"), _isArray4 = true, _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
                                                                                                              if (_isArray4) {
                                                                                                                if (_i4 >= _iterator4.length) break;
                                                                                                                node = _iterator4[_i4++];
                                                                                                              } else {
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 5 other locations - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 752..767
                                                                                                src/main/resources/static/js/dropzone.js on lines 804..819
                                                                                                src/main/resources/static/js/dropzone.js on lines 838..854
                                                                                                src/main/resources/static/js/dropzone.js on lines 871..886
                                                                                                src/main/resources/static/js/dropzone.js on lines 911..926

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

                                                                                                            for (var _iterator8 = file.previewElement.querySelectorAll("[data-dz-uploadprogress]"), _isArray8 = true, _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
                                                                                                              var _ref7;
                                                                                                
                                                                                                              if (_isArray8) {
                                                                                                                if (_i8 >= _iterator8.length) break;
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 5 other locations - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 752..767
                                                                                                src/main/resources/static/js/dropzone.js on lines 768..779
                                                                                                src/main/resources/static/js/dropzone.js on lines 804..819
                                                                                                src/main/resources/static/js/dropzone.js on lines 838..854
                                                                                                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 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

                                                                                                          for (var _iterator2 = this.element.getElementsByTagName("div"), _isArray2 = true, _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
                                                                                                            var _ref2;
                                                                                                
                                                                                                            if (_isArray2) {
                                                                                                              if (_i2 >= _iterator2.length) break;
                                                                                                Severity: Minor
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 2540..2584

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

                                                                                                            for (var _iterator6 = file.previewElement.querySelectorAll("[data-dz-thumbnail]"), _isArray6 = true, _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
                                                                                                              var _ref5;
                                                                                                
                                                                                                              if (_isArray6) {
                                                                                                                if (_i6 >= _iterator6.length) break;
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 5 other locations - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 752..767
                                                                                                src/main/resources/static/js/dropzone.js on lines 768..779
                                                                                                src/main/resources/static/js/dropzone.js on lines 804..819
                                                                                                src/main/resources/static/js/dropzone.js on lines 871..886
                                                                                                src/main/resources/static/js/dropzone.js on lines 911..926

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

                                                                                                            for (var _iterator7 = file.previewElement.querySelectorAll("[data-dz-errormessage]"), _isArray7 = true, _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
                                                                                                              var _ref6;
                                                                                                
                                                                                                              if (_isArray7) {
                                                                                                                if (_i7 >= _iterator7.length) break;
                                                                                                Severity: Major
                                                                                                Found in src/main/resources/static/js/dropzone.js and 5 other locations - About 50 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 752..767
                                                                                                src/main/resources/static/js/dropzone.js on lines 768..779
                                                                                                src/main/resources/static/js/dropzone.js on lines 804..819
                                                                                                src/main/resources/static/js/dropzone.js on lines 838..854
                                                                                                src/main/resources/static/js/dropzone.js on lines 911..926

                                                                                                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

                                                                                                      return files = this.files.filter(function (file) {
                                                                                                        return file.xhr === xhr;
                                                                                                      }).map(function (file) {
                                                                                                        return file;
                                                                                                      });
                                                                                                Severity: Minor
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 35 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 1146..1150

                                                                                                Duplicated Code

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

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

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

                                                                                                Tuning

                                                                                                This issue has a mass of 47.

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

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

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

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

                                                                                                Refactorings

                                                                                                Further Reading

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

                                                                                                      return this.files.filter(function (file) {
                                                                                                        return file.status === status;
                                                                                                      }).map(function (file) {
                                                                                                        return file;
                                                                                                      });
                                                                                                Severity: Minor
                                                                                                Found in src/main/resources/static/js/dropzone.js and 1 other location - About 35 mins to fix
                                                                                                src/main/resources/static/js/dropzone.js on lines 2192..2196

                                                                                                Duplicated Code

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

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

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

                                                                                                Tuning

                                                                                                This issue has a mass of 47.

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

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

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

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

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                There are no issues that match your filters.

                                                                                                Category
                                                                                                Status