jkuchar/MultipleFileUpload

View on GitHub

Showing 205 of 353 total issues

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

            open: function(method, url, async, user, password) {
                var urlp;
                
                // first two arguments are required
                if (!method || !url) {
Severity: Minor
Found in public/plupload/js/moxie.js - About 1 hr to fix

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

                init: function() {
                    var html, el, container;
    
                    container = this.getShimContainer();
    
    
    Severity: Minor
    Found in public/plupload/js/moxie.js - About 1 hr to fix

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

                          _xhr.onreadystatechange = function onReadyStateChange() {
                              
                              // fake Level 2 events
                              switch (_xhr.readyState) {
                                  
      Severity: Minor
      Found in public/plupload/js/moxie.js - About 1 hr to fix

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

        plupload.File = (function() {
            var filepool = {};
        
            function PluploadFile(file) {
        
        
        Severity: Minor
        Found in public/plupload/js/plupload.dev.js - About 1 hr to fix

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

                  onUploadStart : function(file) {
                      // Load the swfupload settings
                      var settings = this.settings;
          
                      var timer        = new Date();
          Severity: Minor
          Found in public/uploadify/js/jquery.uploadify-3.1.js - About 1 hr to fix

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

                var addEvent = function(obj, name, callback, key) {
                    var func, events;
                                
                    name = name.toLowerCase();
            
            
            Severity: Minor
            Found in public/plupload/js/moxie.js - About 1 hr to fix

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

                  SWFUpload.speed.calculateMovingAverage = function (history) {
                      var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0;
                      var i;
                      var mSum = 0, mCount = 0;
                      
              Severity: Minor
              Found in public/swfupload/js/swfupload.speed.js - About 1 hr to fix

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

                w(ab,false);}else{if(Z){Z({success:false,id:ab});}}},getObjectById:function(X){if(M.w3){return z(X);}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};
                Severity: Major
                Found in public/uploadify/js/jquery.uploadify-3.1.js - About 1 hr to fix

                  Function indexOf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    Array.prototype.indexOf = function(elt /*, from*/)
                    {
                      var len = this.length;
                  
                      var from = Number(arguments[1]) || 0;
                  Severity: Minor
                  Found in public/MFUFallbackController.js - About 1 hr 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 embedSWF has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
                  Severity: Major
                  Found in public/uploadify/js/swfobject (2).js - About 1 hr to fix

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

                            embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
                    Severity: Major
                    Found in public/uploadify/js/swfobject.js - About 1 hr to fix

                      Function handleUploads has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function handleUploads()
                          {
                              if (self::$handleUploadsCalled === true) {
                                  return;
                              } else {
                      Severity: Minor
                      Found in MultipleFileUpload/MultipleFileUpload.php - About 1 hr 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 renderImageToCanvas has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function renderImageToCanvas(img, canvas, options) {
                              var iw = img.naturalWidth, ih = img.naturalHeight;
                              var width = options.width, height = options.height;
                              var x = options.x || 0, y = options.y || 0;
                              var ctx = canvas.getContext('2d');
                      Severity: Minor
                      Found in public/plupload/js/moxie.js - About 1 hr to fix

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

                            var atob = function(data, utf8) {
                                if (typeof(window.atob) === 'function') {
                                    return utf8 ? utf8_decode(window.atob(data)) : window.atob(data);
                                }
                        
                        
                        Severity: Minor
                        Found in public/plupload/js/moxie.js - About 1 hr to fix

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

                                      fileQueueError: function(event, file, errorCode, message) {
                                              try {
                                                      if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
                                                              alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
                                                              return;
                          Severity: Minor
                          Found in public/swfupload/js/handlers.js - About 1 hr to fix

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

                                        getResponse: function(responseType) {
                                            var I = this.getRuntime();
                            
                                            try {
                                                switch (responseType) {
                            Severity: Minor
                            Found in public/plupload/js/moxie.js - About 1 hr to fix

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

                                              function initialize(items) {
                                                  var type, constructor;
                              
                                                  // if we ran out of runtimes
                                                  if (!items.length) {
                              Severity: Minor
                              Found in public/plupload/js/moxie.js - About 1 hr to fix

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

                                    $.fn.swfupload = function(){
                                        var args = $.makeArray(arguments);
                                        return this.each(function(){
                                            var swfu;
                                            if (args.length == 1 && typeof(args[0]) == 'object') {
                                Severity: Minor
                                Found in public/swfupload/js/jquery.swfupload.js - About 1 hr to fix

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

                                      function PluploadFile(file) {
                                  
                                          plupload.extend(this, {
                                  
                                              /**
                                  Severity: Minor
                                  Found in public/plupload/js/plupload.dev.js - About 1 hr to fix

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

                                        function createCSS(sel, decl, media, newStyle) {
                                            if (ua.ie && ua.mac) { return; }
                                            var h = doc.getElementsByTagName("head")[0];
                                            if (!h) { return; } // to also support badly authored HTML pages that lack a head element
                                            var m = (media && typeof media == "string") ? media : "screen";
                                    Severity: Minor
                                    Found in public/uploadify/js/swfobject (2).js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language