AsgardCms/Media

View on GitHub

Showing 14 of 30 total issues

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

;(function(){

    /**
     * Require the module at `name`.
     *
Severity: Major
Found in Assets/js/dropzone.js - About 4 days to fix

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

                    Dropzone.prototype.init = function() {
                        var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1;
                        if (this.element.tagName === "form") {
                            this.element.setAttribute("enctype", "multipart/form-data");
                        }
    Severity: Major
    Found in Assets/js/dropzone.js - About 5 hrs to fix

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

                      Dropzone.prototype.uploadFiles = function(files) {
                          var file, formData, handleError, headerName, headerValue, headers, i, input, inputName, inputType, key, option, progressObj, response, updateProgress, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
                          xhr = new XMLHttpRequest();
                          for (_i = 0, _len = files.length; _i < _len; _i++) {
                              file = files[_i];
      Severity: Major
      Found in Assets/js/dropzone.js - About 5 hrs to fix

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

                        function Dropzone(element, options) {
                            var elementOptions, fallback, _ref;
                            this.element = element;
                            this.version = Dropzone.version;
                            this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, "");
        Severity: Major
        Found in Assets/js/dropzone.js - About 2 hrs to fix

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

                              addedfile: function(file) {
                                  var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results;
                                  if (this.element === this.previewsContainer) {
                                      this.element.classList.add("dz-started");
                                  }
          Severity: Minor
          Found in Assets/js/dropzone.js - About 1 hr to fix

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

                                resize: function(file) {
                                    var info, srcRatio, trgRatio;
                                    info = {
                                        srcX: 0,
                                        srcY: 0,
            Severity: Minor
            Found in Assets/js/dropzone.js - About 1 hr to fix

              Method linkMedia has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function linkMedia(Request $request)
                  {
                      $mediaId = $request->get('mediaId');
                      $entityClass = $request->get('entityClass');
                      $entityId = $request->get('entityId');
              Severity: Minor
              Found in Http/Controllers/Api/MediaController.php - About 1 hr to fix

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

                                Dropzone.prototype.createThumbnail = function(file, callback) {
                                    var fileReader;
                                    fileReader = new FileReader;
                                    fileReader.onload = (function(_this) {
                                        return function() {
                Severity: Minor
                Found in Assets/js/dropzone.js - About 1 hr to fix

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

                              Dropzone.discover = function() {
                                  var checkElements, dropzone, dropzones, _i, _len, _results;
                                  if (document.querySelectorAll) {
                                      dropzones = document.querySelectorAll(".dropzone");
                                  } else {
                  Severity: Minor
                  Found in Assets/js/dropzone.js - About 1 hr to fix

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

                                        fileReader.onload = (function(_this) {
                                            return function() {
                                                var img;
                                                img = document.createElement("img");
                                                img.onload = function() {
                    Severity: Minor
                    Found in Assets/js/dropzone.js - About 1 hr to fix

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

                                  Dropzone.getElements = function(els, name) {
                                      var e, el, elements, _i, _j, _len, _len1, _ref;
                                      if (els instanceof Array) {
                                          elements = [];
                                          try {
                      Severity: Minor
                      Found in Assets/js/dropzone.js - About 1 hr to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                            if (option.selected) {
                                                                formData.append(inputName, option.value);
                                                            }
                        Severity: Major
                        Found in Assets/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 {
                                                  _ref = Dropzone.blacklistedBrowsers;
                          Severity: Major
                          Found in Assets/js/dropzone.js - About 40 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return false;
                            Severity: Major
                            Found in Assets/js/dropzone.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language