AsgardCms/Media

View on GitHub

Showing 30 of 30 total issues

File dropzone.js has 1580 lines of code (exceeds 250 allowed). Consider refactoring.
Open

;(function(){

    /**
     * Require the module at `name`.
     *
Severity: Major
Found in Assets/js/dropzone.js - About 4 days to fix

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

                    Dropzone.prototype.removeEventListeners = function() {
                        var elementListeners, event, listener, _i, _len, _ref, _results;
                        _ref = this.listeners;
                        _results = [];
                        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
    Severity: Major
    Found in Assets/js/dropzone.js and 1 other location - About 1 day to fix
    Assets/js/dropzone.js on lines 910..928

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

    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

                    Dropzone.prototype.setupEventListeners = function() {
                        var elementListeners, event, listener, _i, _len, _ref, _results;
                        _ref = this.listeners;
                        _results = [];
                        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
    Severity: Major
    Found in Assets/js/dropzone.js and 1 other location - About 1 day to fix
    Assets/js/dropzone.js on lines 930..948

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

    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

                    Dropzone.prototype._finished = function(files, responseText, e) {
                        var file, _i, _len;
                        for (_i = 0, _len = files.length; _i < _len; _i++) {
                            file = files[_i];
                            file.status = Dropzone.SUCCESS;
    Severity: Major
    Found in Assets/js/dropzone.js and 1 other location - About 7 hrs to fix
    Assets/js/dropzone.js on lines 1501..1516

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

    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

                    Dropzone.prototype._errorProcessing = function(files, message, xhr) {
                        var file, _i, _len;
                        for (_i = 0, _len = files.length; _i < _len; _i++) {
                            file = files[_i];
                            file.status = Dropzone.ERROR;
    Severity: Major
    Found in Assets/js/dropzone.js and 1 other location - About 7 hrs to fix
    Assets/js/dropzone.js on lines 1484..1499

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

    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 init has 143 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    Dropzone.prototype.init = function() {
                        var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1;
                        if (this.element.tagName === "form") {
                            this.element.setAttribute("enctype", "multipart/form-data");
                        }
    Severity: Major
    Found in Assets/js/dropzone.js - About 5 hrs to fix

      Function uploadFiles has 142 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      Dropzone.prototype.uploadFiles = function(files) {
                          var file, formData, handleError, headerName, headerValue, headers, i, input, inputName, inputType, key, option, progressObj, response, updateProgress, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
                          xhr = new XMLHttpRequest();
                          for (_i = 0, _len = files.length; _i < _len; _i++) {
                              file = files[_i];
      Severity: Major
      Found in Assets/js/dropzone.js - About 5 hrs to fix

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

                        function Dropzone(element, options) {
                            var elementOptions, fallback, _ref;
                            this.element = element;
                            this.version = Dropzone.version;
                            this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, "");
        Severity: Major
        Found in Assets/js/dropzone.js - About 2 hrs to fix

          Function addedfile has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                              addedfile: function(file) {
                                  var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results;
                                  if (this.element === this.previewsContainer) {
                                      this.element.classList.add("dz-started");
                                  }
          Severity: Minor
          Found in Assets/js/dropzone.js - About 1 hr to fix

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

                                for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                    file = _ref[_i];
                                    if (file.status === status) {
                                        _results.push(file);
                                    }
            Severity: Major
            Found in Assets/js/dropzone.js and 1 other location - About 1 hr to fix
            Assets/js/dropzone.js on lines 1297..1302

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

            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

                                    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                        file = _ref[_i];
                                        if (file.xhr === xhr) {
                                            _results.push(file);
                                        }
            Severity: Major
            Found in Assets/js/dropzone.js and 1 other location - About 1 hr to fix
            Assets/js/dropzone.js on lines 654..659

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

            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

            <?php namespace Modules\Media\Image\Intervention\Manipulations;
            
            use Modules\Media\Image\ImageHandlerInterface;
            
            class Crop implements ImageHandlerInterface
            Severity: Major
            Found in Image/Intervention/Manipulations/Crop.php and 1 other location - About 1 hr to fix
            Image/Intervention/Manipulations/Watermark.php on lines 1..26

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

            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

            <?php namespace Modules\Media\Image\Intervention\Manipulations;
            
            use Modules\Media\Image\ImageHandlerInterface;
            
            class Watermark implements ImageHandlerInterface
            Severity: Major
            Found in Image/Intervention/Manipulations/Watermark.php and 1 other location - About 1 hr to fix
            Image/Intervention/Manipulations/Crop.php on lines 1..26

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

            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 resize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                resize: function(file) {
                                    var info, srcRatio, trgRatio;
                                    info = {
                                        srcX: 0,
                                        srcY: 0,
            Severity: Minor
            Found in Assets/js/dropzone.js - About 1 hr to fix

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

                                  for (_i = 0, _len = files.length; _i < _len; _i++) {
                                      file = files[_i];
                                      _results.push(this.addFile(file));
                                  }
              Severity: Major
              Found in Assets/js/dropzone.js and 1 other location - About 1 hr to fix
              Assets/js/dropzone.js on lines 958..961

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

              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

                                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                      file = _ref[_i];
                                      _results.push(this.cancelUpload(file));
                                  }
              Severity: Major
              Found in Assets/js/dropzone.js and 1 other location - About 1 hr to fix
              Assets/js/dropzone.js on lines 1036..1039

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

              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

              Method linkMedia has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function linkMedia(Request $request)
                  {
                      $mediaId = $request->get('mediaId');
                      $entityClass = $request->get('entityClass');
                      $entityId = $request->get('entityId');
              Severity: Minor
              Found in Http/Controllers/Api/MediaController.php - About 1 hr to fix

                Function createThumbnail has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                Dropzone.prototype.createThumbnail = function(file, callback) {
                                    var fileReader;
                                    fileReader = new FileReader;
                                    fileReader.onload = (function(_this) {
                                        return function() {
                Severity: Minor
                Found in Assets/js/dropzone.js - About 1 hr to fix

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

                              Dropzone.discover = function() {
                                  var checkElements, dropzone, dropzones, _i, _len, _results;
                                  if (document.querySelectorAll) {
                                      dropzones = document.querySelectorAll(".dropzone");
                                  } else {
                  Severity: Minor
                  Found in Assets/js/dropzone.js - About 1 hr to fix

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

                                            for (_i = 0, _len = groupedFiles.length; _i < _len; _i++) {
                                                groupedFile = groupedFiles[_i];
                                                groupedFile.status = Dropzone.CANCELED;
                                            }
                    Severity: Major
                    Found in Assets/js/dropzone.js and 1 other location - About 1 hr to fix
                    Assets/js/dropzone.js on lines 426..429

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

                    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