XoopsModules25x/smallworld

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

Summary

Maintainability
F
4 days
Test Coverage

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

/*
 * jQuery File Upload User Interface Plugin 7.3
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
Severity: Major
Found in assets/js/jquery.fileupload-ui.js - About 1 day to fix

    Function fail has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                fail: function (e, data) {
                    var that = $(this).data('blueimp-fileupload') ||
                        $(this).data('fileupload'),
                        template,
                        deferred;
    Severity: Major
    Found in assets/js/jquery.fileupload-ui.js - About 2 hrs to fix

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

                  done: function (e, data) {
                      var that = $(this).data('blueimp-fileupload') ||
                          $(this).data('fileupload'),
                          files = that._getFilesFromResponse(data),
                          template,
      Severity: Major
      Found in assets/js/jquery.fileupload-ui.js - About 2 hrs to fix

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

                _initButtonBarEventHandlers: function () {
                    var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
                        filesList = this.options.filesContainer;
                    this._on(fileUploadButtonBar.find('.start'), {
                        click: function (e) {
        Severity: Minor
        Found in assets/js/jquery.fileupload-ui.js - About 1 hr to fix

          Avoid too many return statements within this function.
          Open

                      return bits.toFixed(2) + ' bit/s';
          Severity: Major
          Found in assets/js/jquery.fileupload-ui.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return null;
            Severity: Major
            Found in assets/js/jquery.fileupload-ui.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return 'File is too small';
              Severity: Major
              Found in assets/js/jquery.fileupload-ui.js - About 30 mins to fix

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

                                            that._transition($(this)).done(
                                                function () {
                                                    var node = $(this);
                                                    template = that._renderDownload([file])
                                                        .replaceAll(node);
                Severity: Major
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 5 hrs to fix
                assets/js/jquery.fileupload-ui.js on lines 156..171

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

                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

                                        that._transition($(this)).done(
                                            function () {
                                                var node = $(this);
                                                template = that._renderDownload([file])
                                                    .replaceAll(node);
                Severity: Major
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 5 hrs to fix
                assets/js/jquery.fileupload-ui.js on lines 215..230

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

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

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

                            this._on(fileUploadButtonBar.find('.start'), {
                                click: function (e) {
                                    e.preventDefault();
                                    filesList.find('.start button').click();
                                }
                Severity: Major
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 1 hr to fix
                assets/js/jquery.fileupload-ui.js on lines 639..644

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

                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._on(fileUploadButtonBar.find('.cancel'), {
                                click: function (e) {
                                    e.preventDefault();
                                    filesList.find('.cancel button').click();
                                }
                Severity: Major
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 1 hr to fix
                assets/js/jquery.fileupload-ui.js on lines 633..638

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

                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

                        _initSpecialOptions: function () {
                            this._super();
                            this._initFilesContainer();
                            this._initTemplates();
                            this._initRegExpOptions();
                Severity: Minor
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 45 mins to fix
                assets/js/jqueryui.min.js on lines 11723..11728

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

                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

                        _disableFileInputButton: function () {
                            this.element.find('.fileinput-button input')
                                .prop('disabled', true)
                                .parent().addClass('disabled');
                        },
                Severity: Minor
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 40 mins to fix
                assets/js/jquery.fileupload-ui.js on lines 691..695

                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

                        _enableFileInputButton: function () {
                            this.element.find('.fileinput-button input')
                                .prop('disabled', false)
                                .parent().removeClass('disabled');
                        },
                Severity: Minor
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 40 mins to fix
                assets/js/jquery.fileupload-ui.js on lines 697..701

                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

                            if ($.type(options.previewSourceFileTypes) === 'string') {
                                options.previewSourceFileTypes = this._stringToRegExp(
                                    options.previewSourceFileTypes
                                );
                            }
                Severity: Minor
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 35 mins to fix
                assets/js/jquery.fileupload-ui.js on lines 736..740

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

                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 ($.type(options.acceptFileTypes) === 'string') {
                                options.acceptFileTypes = this._stringToRegExp(
                                    options.acceptFileTypes
                                );
                            }
                Severity: Minor
                Found in assets/js/jquery.fileupload-ui.js and 1 other location - About 35 mins to fix
                assets/js/jquery.fileupload-ui.js on lines 741..745

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

                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