Showing 14 of 30 total issues
File dropzone.js
has 1580 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function(){
/**
* Require the module at `name`.
*
Function init
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
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");
}
Function uploadFiles
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
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];
Function Dropzone
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
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, "");
Function addedfile
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
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");
}
Function resize
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
resize: function(file) {
var info, srcRatio, trgRatio;
info = {
srcX: 0,
srcY: 0,
Method linkMedia
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function linkMedia(Request $request)
{
$mediaId = $request->get('mediaId');
$entityClass = $request->get('entityClass');
$entityId = $request->get('entityId');
Function createThumbnail
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Dropzone.prototype.createThumbnail = function(file, callback) {
var fileReader;
fileReader = new FileReader;
fileReader.onload = (function(_this) {
return function() {
Function discover
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Dropzone.discover = function() {
var checkElements, dropzone, dropzones, _i, _len, _results;
if (document.querySelectorAll) {
dropzones = document.querySelectorAll(".dropzone");
} else {
Function onload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fileReader.onload = (function(_this) {
return function() {
var img;
img = document.createElement("img");
img.onload = function() {
Function getElements
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Dropzone.getElements = function(els, name) {
var e, el, elements, _i, _j, _len, _len1, _ref;
if (els instanceof Array) {
elements = [];
try {
Avoid deeply nested control flow statements. Open
Open
if (option.selected) {
formData.append(inputName, option.value);
}
Consider simplifying this complex logical expression. Open
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;
Avoid too many return
statements within this function. Open
Open
return false;