jkuchar/MultipleFileUpload

View on GitHub

Showing 353 of 353 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    function displayAltContent(obj) {
        if (ua.ie && ua.win && obj.readyState != 4) {
            // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
            // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
            var el = createElement("div");
Severity: Major
Found in public/uploadify/js/swfobject.js and 1 other location - About 7 hrs to fix
public/uploadify/js/swfobject (2).js on lines 361..381

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 192.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function handleUploads()
    {
        /* @var $token string */
        $token = $this->httpRequest->getQuery("token");

Severity: Minor
Found in MultipleFileUpload/UI/Plupload/Controller.php - About 7 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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    function addLoadEvent(fn) {
        if (typeof win.addEventListener != UNDEF) {
            win.addEventListener("load", fn, false);
        }
        else if (typeof doc.addEventListener != UNDEF) {
Severity: Major
Found in public/uploadify/js/swfobject.js and 1 other location - About 6 hrs to fix
public/uploadify/js/swfobject (2).js on lines 152..172

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 173.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    function addLoadEvent(fn) {
        if (typeof win.addEventListener != UNDEF) {
            win.addEventListener("load", fn, false);
        }
        else if (typeof doc.addEventListener != UNDEF) {
Severity: Major
Found in public/uploadify/js/swfobject (2).js and 1 other location - About 6 hrs to fix
public/uploadify/js/swfobject.js on lines 152..172

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 173.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function XMLHttpRequest has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function XMLHttpRequest() {
        var _status, _response, _iframe;

        function cleanup(cb) {
            var target = this, uid, form, inputs, i, hasFile = false;
Severity: Major
Found in public/plupload/js/moxie.js - About 6 hrs to fix

    Function _initUploader has 162 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _initUploader: function() {
            var self = this
            , id = this.id
            , uploader
            , options = { 
    Severity: Major
    Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 6 hrs to fix

      Function FileInput has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function FileInput() {
              var _uid, _files = [], _mimes = [], _options;
      
              function addInput() {
                  var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid;
      Severity: Major
      Found in public/plupload/js/moxie.js - About 6 hrs to fix

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

                init : function(options, swfUploadOptions) {
                    
                    return this.each(function() {
        
                        // Create a reference to the jQuery DOM object
        Severity: Major
        Found in public/uploadify/js/jquery.uploadify-3.1.js - About 5 hrs to fix

          Function Runtime has 146 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function Runtime(options, type, caps, modeCaps, preferredMode) {
                  /**
                  Dispatched when runtime is initialized and ready.
                  Results in RuntimeInit on a connected component.
          
          
          Severity: Major
          Found in public/plupload/js/moxie.js - About 5 hrs to fix

            Function onUploadFile has 146 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function onUploadFile(up, file) {
                    var url = up.settings.url
                    , chunkSize = up.settings.chunk_size
                    , retries = up.settings.max_retries
                    , features = up.features
            Severity: Major
            Found in public/plupload/js/plupload.dev.js - About 5 hrs to fix

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                              for (var i in attObj) {
                                  if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
                                      if (i.toLowerCase() == "data") {
                                          parObj.movie = attObj[i];
                                      }
              Severity: Major
              Found in public/uploadify/js/swfobject.js and 1 other location - About 5 hrs to fix
              public/uploadify/js/swfobject (2).js on lines 416..428

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 148.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                              for (var i in attObj) {
                                  if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
                                      if (i.toLowerCase() == "data") {
                                          parObj.movie = attObj[i];
                                      }
              Severity: Major
              Found in public/uploadify/js/swfobject (2).js and 1 other location - About 5 hrs to fix
              public/uploadify/js/swfobject.js on lines 416..428

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 148.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function EventTarget has 137 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function EventTarget() {
                      // hash of event listeners by object uid
                      var eventpool = {};
                              
                      Basic.extend(this, {
              Severity: Major
              Found in public/plupload/js/moxie.js - About 5 hrs to fix

                Function FlashRuntime has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function FlashRuntime(options) {
                        var I = this, initTimer;
                
                        options = Basic.extend({ swf_url: Env.swf_url }, options);
                
                
                Severity: Major
                Found in public/plupload/js/moxie.js - About 5 hrs to fix

                  Function formatUnits has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                      SWFUpload.speed.formatUnits = function (baseNumber, unitDivisors, unitLabels, singleFractional) {
                          var i, unit, unitDivisor, unitLabel;
                  
                          if (baseNumber === 0) {
                              return "0 " + unitLabels[unitLabels.length - 1];
                  Severity: Minor
                  Found in public/swfupload/js/swfupload.speed.js - About 5 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 FileDrop has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function FileDrop() {
                          var _files = [], _allowedExts = [], _options;
                  
                          Basic.extend(this, {
                              init: function(options) {
                  Severity: Major
                  Found in public/plupload/js/moxie.js - About 5 hrs to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        function removeSWF(id) {
                            var obj = getElementById(id);
                            if (obj && obj.nodeName == "OBJECT") {
                                if (ua.ie && ua.win) {
                                    obj.style.display = "none";
                    Severity: Major
                    Found in public/uploadify/js/swfobject (2).js and 1 other location - About 5 hrs to fix
                    public/uploadify/js/swfobject.js on lines 484..502

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 143.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        function removeSWF(id) {
                            var obj = getElementById(id);
                            if (obj && obj.nodeName == "OBJECT") {
                                if (ua.ie && ua.win) {
                                    obj.style.display = "none";
                    Severity: Major
                    Found in public/uploadify/js/swfobject.js and 1 other location - About 5 hrs to fix
                    public/uploadify/js/swfobject (2).js on lines 474..492

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 143.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                                    setTimeout(function() {
                                                        if ($('#' + file.id)) {
                                                            swfuploadify.queueData.queueSize   -= file.size;
                                                            swfuploadify.queueData.queueLength -= 1;
                                                            delete swfuploadify.queueData.files[file.id];
                    Severity: Major
                    Found in public/uploadify/js/jquery.uploadify-3.1.js and 1 other location - About 5 hrs to fix
                    public/uploadify/js/jquery.uploadify-3.1.js on lines 743..752

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 138.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                                setTimeout(function() { 
                                                    if ($('#' + file.id)) {
                                                        swfuploadify.queueData.queueSize   -= file.size;
                                                        swfuploadify.queueData.queueLength -= 1;
                                                        delete swfuploadify.queueData.files[file.id]
                    Severity: Major
                    Found in public/uploadify/js/jquery.uploadify-3.1.js and 1 other location - About 5 hrs to fix
                    public/uploadify/js/jquery.uploadify-3.1.js on lines 756..765

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 138.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language