XoopsModules25x/smallworld

View on GitHub
assets/js/jquery.fileupload-uix.js

Summary

Maintainability
C
1 day
Test Coverage

File jquery.fileupload-uix.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jQuery File Upload User Interface Extended Plugin 4.4.1
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
Severity: Minor
Found in assets/js/jquery.fileupload-uix.js - About 2 hrs to fix

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

            this.beforeSend = function (event, files, index, xhr, handler, callBack) {
    Severity: Minor
    Found in assets/js/jquery.fileupload-uix.js - About 45 mins to fix

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

              this.destroyEventHandlers = function () {
                  uploadHandler.downloadTable.find('a:not([target="_blank"])')
                      .die('click', uploadHandler.downloadHandler);
                  uploadHandler.downloadTable.find('.file_download_delete button')
                      .die('click', uploadHandler.deleteHandler);
      Severity: Major
      Found in assets/js/jquery.fileupload-uix.js and 1 other location - About 1 hr to fix
      assets/js/jquery.fileupload-uix.js on lines 214..219

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

      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

              this.initEventHandlers = function () {
                  uploadHandler.downloadTable.find('a:not([target="_blank"])')
                      .live('click', uploadHandler.downloadHandler);
                  uploadHandler.downloadTable.find('.file_download_delete button')
                      .live('click', uploadHandler.deleteHandler);
      Severity: Major
      Found in assets/js/jquery.fileupload-uix.js and 1 other location - About 1 hr to fix
      assets/js/jquery.fileupload-uix.js on lines 221..226

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

      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

                  link.bind('dragstart', function (event) {
                      try {
                          event.originalEvent.dataTransfer
                              .setData('DownloadURL', [type, name, url].join(':'));
                      } catch (e) {
      Severity: Major
      Found in assets/js/jquery.fileupload-uix.js and 1 other location - About 1 hr to fix
      assets/js/jquery.fileupload-ui.js on lines 373..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 64.

      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 3 locations. Consider refactoring.
      Open

                      uploadHandler.multiButtons.find('.file_upload_start:first')
                          .button({icons: {primary: 'ui-icon-circle-arrow-e'}})
                          .bind('click', {selector: '.file_upload_start'}, uploadHandler.multiButtonHandler);
      Severity: Major
      Found in assets/js/jquery.fileupload-uix.js and 2 other locations - About 1 hr to fix
      assets/js/jquery.fileupload-uix.js on lines 241..243
      assets/js/jquery.fileupload-uix.js on lines 244..246

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

      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 3 locations. Consider refactoring.
      Open

                  uploadHandler.multiButtons.find('.file_download_delete:first')
                      .button({icons: {primary: 'ui-icon-trash'}})
                      .bind('click', {selector: '.file_download_delete'}, uploadHandler.multiButtonHandler);
      Severity: Major
      Found in assets/js/jquery.fileupload-uix.js and 2 other locations - About 1 hr to fix
      assets/js/jquery.fileupload-uix.js on lines 237..239
      assets/js/jquery.fileupload-uix.js on lines 241..243

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

      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 3 locations. Consider refactoring.
      Open

                  uploadHandler.multiButtons.find('.file_upload_cancel:first')
                      .button({icons: {primary: 'ui-icon-cancel'}})
                      .bind('click', {selector: '.file_upload_cancel'}, uploadHandler.multiButtonHandler);
      Severity: Major
      Found in assets/js/jquery.fileupload-uix.js and 2 other locations - About 1 hr to fix
      assets/js/jquery.fileupload-uix.js on lines 237..239
      assets/js/jquery.fileupload-uix.js on lines 244..246

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

      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