jkuchar/MultipleFileUpload

View on GitHub
public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js

Summary

Maintainability
F
5 days
Test Coverage

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

/**
 * jquery.ui.plupload.js
 *
 * Copyright 2013, Moxiecode Systems AB
 * Released under GPL License.
Severity: Major
Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 1 day 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 _displayThumbs has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _displayThumbs: function() {
              var self = this
              , tw, th // thumb width/height
              , cols
              , num = 0 // number of simultaneously visible thumbs
      Severity: Major
      Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 3 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 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 _handleFileStatus has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _handleFileStatus: function(file) {
                    var $file = $('#' + file.id), actionClass, iconClass;
                    
                    // since this method might be called asynchronously, file row might not yet be rendered
                    if (!$file.length) {
            Severity: Minor
            Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 1 hr to fix

              Function _enableViewSwitcher has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _enableViewSwitcher: function() {
                      var self = this
                      , view
                      , switcher = $('.plupload_view_switch', this.container)
                      , buttons
              Severity: Minor
              Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 1 hr to fix

                Function _handleState has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _handleState: function() {
                        var up = this.uploader
                        , filesPending = up.files.length - (up.total.uploaded + up.total.failed)
                        , maxCount = up.getOption('filters').max_file_count || 0
                        ;
                Severity: Minor
                Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 1 hr to fix

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

                      _addFiles: function(files) {
                          var self = this, file_html, html = '';
                  
                          file_html = '<li class="plupload_file ui-state-default plupload_file_loading plupload_delete" id="%id%" style="width:%thumb_width%px;">' +
                              '<div class="plupload_file_thumb" style="width:%thumb_width%px;height:%thumb_height%px;">' +
                  Severity: Minor
                  Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 1 hr to fix

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

                        _enableRenaming: function() {
                            var self = this;
                    
                            this.filelist.dblclick(function(e) {
                                var nameSpan = $(e.target), nameInput, file, parts, name, ext = "";
                    Severity: Minor
                    Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js - About 1 hr to fix

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

                              file_html = '<li class="plupload_file ui-state-default plupload_file_loading plupload_delete" id="%id%" style="width:%thumb_width%px;">' +
                                  '<div class="plupload_file_thumb" style="width:%thumb_width%px;height:%thumb_height%px;">' +
                                      '<div class="plupload_file_dummy ui-widget-content" style="line-height:%thumb_height%px;"><span class="ui-state-disabled">%ext% </span></div>' +
                                  '</div>' +
                                  '<div class="plupload_file_status">' +
                      Severity: Major
                      Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js and 1 other location - About 1 hr to fix
                      public/plupload/js/moxie.js on lines 560..576

                      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 65.

                      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

                                  if (!value.start) {
                                      self.start_button.button('disable').hide();
                                  } else {
                                      self.start_button.button('enable').show();
                                  }
                      Severity: Major
                      Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js and 1 other location - About 1 hr to fix
                      public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js on lines 638..642

                      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 61.

                      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

                                  if (!value.stop) {
                                      self.stop_button.button('disable').hide();
                                  } else {
                                      self.start_button.button('enable').show();    
                                  }
                      Severity: Major
                      Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js and 1 other location - About 1 hr to fix
                      public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js on lines 632..636

                      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 61.

                      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

                          start: function() {
                              this.uploader.start();
                              this._trigger('start', null, { up: this.uploader });
                          },
                      Severity: Minor
                      Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js and 1 other location - About 40 mins to fix
                      public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js on lines 665..668

                      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 49.

                      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

                          stop: function() {
                              this.uploader.stop();
                              this._trigger('stop', null, { up: this.uploader });
                          },
                      Severity: Minor
                      Found in public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js and 1 other location - About 40 mins to fix
                      public/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js on lines 654..657

                      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 49.

                      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

                      There are no issues that match your filters.

                      Category
                      Status