flowjs/flow.js

View on GitHub

Showing 30 of 38 total issues

File flow.js has 918 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license MIT
 */
(function(window, document, undefined) {'use strict';
  if (!window || !document) {
Severity: Major
Found in src/flow.js - About 2 days to fix

    File resumable.js has 747 lines of code (exceeds 250 allowed). Consider refactoring.
    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; };
    Severity: Major
    Found in samples/java/web/resumable.js - About 1 day to fix

      Function exports has 113 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(grunt) {
        // Project configuration.
        grunt.initConfig({
          pkg: grunt.file.readJSON('package.json'),
          uglify: {
      Severity: Major
      Found in Gruntfile.js - About 4 hrs to fix

        Function send has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        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') {
        Severity: Major
        Found in samples/java/web/resumable.js - About 4 hrs to fix

          Function exports has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function(config) {
            // define SL browsers
            var customLaunchers = {
              sl_ie10: {
                base: 'SauceLabs',
          Severity: Major
          Found in karma.conf.js - About 4 hrs to fix

            Function FlowChunk has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function FlowChunk(flowObj, fileObj, offset) {
            
                /**
                 * Reference to parent flow object
                 * @type {Flow}
            Severity: Major
            Found in src/flow.js - About 2 hrs to fix

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

                function Flow(opts) {
                  /**
                   * Supported by browser?
                   * @type {boolean}
                   */
              Severity: Major
              Found in src/flow.js - About 2 hrs to fix

                Function uploadNextChunk has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                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')) {
                Severity: Major
                Found in samples/java/web/resumable.js - About 2 hrs to fix

                  Function uploadNextChunk has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  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;
                  Severity: Minor
                  Found in src/flow.js - About 2 hrs to fix

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

                        webkitReadDataTransfer: function (event) {
                          var $ = this;
                          var queue = event.dataTransfer.items.length;
                          var files = [];
                          each(event.dataTransfer.items, function (item) {
                    Severity: Minor
                    Found in src/flow.js - About 1 hr to fix

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

                          ResumableChunk.prototype.test = function() {
                            var customQuery, headers, key, params, testHandler, value,
                              _this = this;
                            this.xhr = new XMLHttpRequest();
                            testHandler = function(e) {
                      Severity: Minor
                      Found in samples/java/web/resumable.js - About 1 hr to fix

                        Function Resumable has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        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 = [];
                        Severity: Minor
                        Found in samples/java/web/resumable.js - About 1 hr to fix

                          Function assignBrowse has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              assignBrowse: function (domNodes, isDirectory, singleFile, attributes) {
                                if (domNodes instanceof Element) {
                                  domNodes = [domNodes];
                                }
                          
                          
                          Severity: Minor
                          Found in src/flow.js - About 1 hr to fix

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

                                send: function () {
                                  var preprocess = this.flowObj.opts.preprocess;
                                  var read = this.flowObj.opts.readFileFn;
                                  if (typeof preprocess === 'function') {
                                    switch (this.preprocessState) {
                            Severity: Minor
                            Found in src/flow.js - About 1 hr to fix

                              Function assignBrowse has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  Resumable.prototype.assignBrowse = function(domNodes, isDirectory) {
                                    var changeHandler, dn, input, maxFiles, _i, _len,
                                      _this = this;
                                    console.log("assignBrowse");
                                    if (domNodes.length == null) {
                              Severity: Minor
                              Found in samples/java/web/resumable.js - About 1 hr to fix

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

                                    $.post = function(req, callback) {
                                
                                        var fields = req.body;
                                        var files = req.files;
                                
                                
                                Severity: Minor
                                Found in samples/Node.js/flow-node.js - About 1 hr to fix

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

                                      chunkEvent: function (chunk, event, message) {
                                        switch (event) {
                                          case 'progress':
                                            if (Date.now() - this._lastProgressCallback <
                                              this.flowObj.opts.progressCallbacksInterval) {
                                  Severity: Minor
                                  Found in src/flow.js - About 1 hr to fix

                                    Function appendFilesFromFileList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    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];
                                    Severity: Minor
                                    Found in samples/java/web/resumable.js - About 1 hr to fix

                                      Function prepareXhrRequest has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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());
                                      
                                      
                                      Severity: Minor
                                      Found in src/flow.js - About 1 hr to fix

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

                                            function validateRequest(chunkNumber, chunkSize, totalSize, identifier, filename, fileSize) {
                                        Severity: Minor
                                        Found in samples/Node.js/flow-node.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language