Showing 30 of 38 total issues
File flow.js
has 918 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @license MIT
*/
(function(window, document, undefined) {'use strict';
if (!window || !document) {
File resumable.js
has 747 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Generated by CoffeeScript 1.6.1
(function() {
var Resumable, ResumableChunk, ResumableFile,
__slice = [].slice,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
Function exports
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
Function send
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ResumableChunk.prototype.send = function() {
var bytes, customQuery, data, doneHandler, func, headers, key, params, preprocess, progressHandler, query, ret, target, value,
_this = this;
preprocess = this.getOpt('preprocess');
if (typeof preprocess === 'function') {
Function exports
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
// define SL browsers
var customLaunchers = {
sl_ie10: {
base: 'SauceLabs',
Function FlowChunk
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FlowChunk(flowObj, fileObj, offset) {
/**
* Reference to parent flow object
* @type {Flow}
Function Flow
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Flow(opts) {
/**
* Supported by browser?
* @type {boolean}
*/
Function uploadNextChunk
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Resumable.prototype.uploadNextChunk = function() {
var chunk, file, found, outstanding, status, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4;
console.log("uploadNextChunk");
found = false;
if (this.getOpt('prioritizeFirstAndLastChunk')) {
Function uploadNextChunk
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uploadNextChunk: function (preventEvents) {
// In some cases (such as videos) it's really handy to upload the first
// and last chunk of a file quickly; this let's the server check the file's
// metadata and determine if there's even a point in continuing.
var found = false;
Function webkitReadDataTransfer
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
webkitReadDataTransfer: function (event) {
var $ = this;
var queue = event.dataTransfer.items.length;
var files = [];
each(event.dataTransfer.items, function (item) {
Function test
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ResumableChunk.prototype.test = function() {
var customQuery, headers, key, params, testHandler, value,
_this = this;
this.xhr = new XMLHttpRequest();
testHandler = function(e) {
Function Resumable
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Resumable(opt) {
this.opt = opt;
console.log('constructor');
this.support = (typeof File !== "undefined" && File !== null) && (typeof Blob !== "undefined" && Blob !== null) && (typeof FileList !== "undefined" && FileList !== null) && ((Blob.prototype.webkitSlice != null) || (Blob.prototype.mozSlice != null) || (Blob.prototype.slice != null));
this.files = [];
Function assignBrowse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
assignBrowse: function (domNodes, isDirectory, singleFile, attributes) {
if (domNodes instanceof Element) {
domNodes = [domNodes];
}
Function send
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function () {
var preprocess = this.flowObj.opts.preprocess;
var read = this.flowObj.opts.readFileFn;
if (typeof preprocess === 'function') {
switch (this.preprocessState) {
Function assignBrowse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Resumable.prototype.assignBrowse = function(domNodes, isDirectory) {
var changeHandler, dn, input, maxFiles, _i, _len,
_this = this;
console.log("assignBrowse");
if (domNodes.length == null) {
Function post
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.post = function(req, callback) {
var fields = req.body;
var files = req.files;
Function chunkEvent
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
chunkEvent: function (chunk, event, message) {
switch (event) {
case 'progress':
if (Date.now() - this._lastProgressCallback <
this.flowObj.opts.progressCallbacksInterval) {
Function appendFilesFromFileList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Resumable.prototype.appendFilesFromFileList = function(fileList, event) {
var errorCount, file, files, maxFileSize, maxFileSizeErrorCallback, maxFiles, maxFilesErrorCallback, minFileSize, minFileSizeErrorCallback, resumableFile, _i, _len, _ref;
console.log("appendFilesFromFileList");
errorCount = 0;
_ref = this.getOpt(['maxFiles', 'minFileSize', 'maxFileSize', 'maxFilesErrorCallback', 'minFileSizeErrorCallback', 'maxFileSizeErrorCallback']), maxFiles = _ref[0], minFileSize = _ref[1], maxFileSize = _ref[2], maxFilesErrorCallback = _ref[3], minFileSizeErrorCallback = _ref[4], maxFileSizeErrorCallback = _ref[5];
Function prepareXhrRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prepareXhrRequest: function(method, isTest, paramsMethod, blob) {
// Add data from the query options
var query = evalOpts(this.flowObj.opts.query, this.fileObj, this, isTest);
query = extend(query || {}, this.getParams());
Function validateRequest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function validateRequest(chunkNumber, chunkSize, totalSize, identifier, filename, fileSize) {