jkuchar/MultipleFileUpload

View on GitHub

Showing 205 of 353 total issues

Function updateTracking has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    SWFUpload.prototype.updateTracking = function (file, bytesUploaded) {
        var tracking = this.fileSpeedStats[file.id];
        if (!tracking) {
            this.fileSpeedStats[file.id] = tracking = {};
        }
Severity: Minor
Found in public/swfupload/js/swfupload.speed.js - About 2 hrs 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 uploadProgressHandler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    SWFUpload.proxyDetect.uploadProgressHandler = function (file, bytesComplete, bytesTotal) {
        var ex1 = null, time, differenceMS, bps;
        try {
            if (typeof this.proxyDetectSettings.user_upload_progress_handler === "function") {
                this.proxyDetectSettings.user_upload_progress_handler.call(this, file, bytesComplete, bytesTotal);
Severity: Minor
Found in public/swfupload/js/swfupload.proxy.js - About 2 hrs 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

File jquery.plupload.queue.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * jquery.plupload.queue.js
 *
 * Copyright 2009, Moxiecode Systems AB
 * Released under GPL License.
Severity: Minor
Found in public/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js - About 2 hrs to fix

    Function Html4Runtime has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function Html4Runtime(options) {
            var I = this
            , Test = Runtime.capTest
            , True = Runtime.capTrue
            ;
    Severity: Major
    Found in public/plupload/js/moxie.js - About 2 hrs to fix

      Function _create has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _create: function() {
              var id = this.element.attr('id');
              if (!id) {
                  id = plupload.guid();
                  this.element.attr('id', id);
      Severity: Major
      Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 2 hrs to fix

        Function createSWF has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function createSWF(attObj, parObj, id) {
                var r, el = getElementById(id);
                if (ua.wk && ua.wk < 312) { return r; }
                if (el) {
                    if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
        Severity: Major
        Found in public/uploadify/js/swfobject.js - About 2 hrs to fix

          Function PNG has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function PNG(binstr) {
                  var _binstr, _br, _hm, _ep, _info;
          
                  _binstr = binstr;
          
          
          Severity: Major
          Found in public/plupload/js/moxie.js - About 2 hrs to fix

            Function uploadCompleteHandler has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                SWFUpload.queue.uploadCompleteHandler = function (file) {
                    var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
                    var continueUpload;
                    
                    if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
            Severity: Minor
            Found in public/swfupload/js/swfupload.queue.js - About 2 hrs 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 _read has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function _read(op, blob) {
                        _fr = new RuntimeTarget();
            
                        function error(err) {
                            self.readyState = FileReader.DONE;
            Severity: Major
            Found in public/plupload/js/moxie.js - About 2 hrs to fix

              Function _downsize has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function _downsize(width, height, crop, preserveHeaders) {
                          var self = this
                          , scale
                          , mathFn
                          , x = 0
              Severity: Major
              Found in public/plupload/js/moxie.js - About 2 hrs to fix

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

                    function createSWF(attObj, parObj, id) {
                        var r, el = getElementById(id);
                        if (ua.wk && ua.wk < 312) { return r; }
                        if (el) {
                            if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
                Severity: Major
                Found in public/uploadify/js/swfobject (2).js - About 2 hrs to fix

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

                          onUploadComplete : function(file) {
                              // Load the swfupload settings
                              var settings     = this.settings,
                                  swfuploadify = this;
                  
                  
                  Severity: Major
                  Found in public/uploadify/js/jquery.uploadify-3.1.js - About 2 hrs to fix

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

                    ;var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
                    if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;
                    X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);
                    ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");
                    if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac};
                    Severity: Major
                    Found in public/uploadify/js/jquery.uploadify-3.1.js - About 2 hrs to fix

                      Function onUploadError has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              onUploadError : function(file, errorCode, errorMsg) {
                                  // Load the swfupload settings
                                  var settings = this.settings;
                      
                                  // Set the error string
                      Severity: Major
                      Found in public/uploadify/js/jquery.uploadify-3.1.js - About 2 hrs to fix

                        Function renderUI has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function renderUI(obj) {        
                            obj.id = obj.attr('id');
                        
                            obj.html(
                                '<div class="plupload_wrapper">' +
                        Severity: Major
                        Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 2 hrs to fix

                          Function can has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var can = (function() {
                                  var caps = {
                                          define_property: (function() {
                                              /* // currently too much extra code required, not exactly worth it
                                              try { // as of IE8, getters/setters are supported only on DOM elements
                          Severity: Major
                          Found in public/plupload/js/moxie.js - About 2 hrs to fix

                            Function matchVersions has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function matchVersions() {
                                    var rl = regObjArr.length;
                                    if (rl > 0) {
                                        for (var i = 0; i < rl; i++) { // for each registered object element
                                            var id = regObjArr[i].id;
                            Severity: Major
                            Found in public/uploadify/js/swfobject (2).js - About 2 hrs to fix

                              Function matchVersions has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function matchVersions() {
                                      var rl = regObjArr.length;
                                      if (rl > 0) {
                                          for (var i = 0; i < rl; i++) { // for each registered object element
                                              var id = regObjArr[i].id;
                              Severity: Major
                              Found in public/uploadify/js/swfobject.js - About 2 hrs to fix

                                File MultipleFileUpload.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                
                                /**
                                 * MultipleFileUpload (https://github.com/jkuchar/MultipleFileUpload/)
                                 *
                                Severity: Minor
                                Found in MultipleFileUpload/MultipleFileUpload.php - About 2 hrs to fix

                                  Function dispatchEvent has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              dispatchEvent: function(type) {
                                                  var uid, list, args, tmpEvt, evt = {}, result = true, undef;
                                                  
                                                  if (Basic.typeOf(type) !== 'string') {
                                                      // we can't use original object directly (because of Silverlight)
                                  Severity: Major
                                  Found in public/plupload/js/moxie.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language