AsgardCms/Media

View on GitHub

Showing 30 of 30 total issues

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

                            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                node = _ref[_i];
                                node.textContent = file.name;
                            }
Severity: Major
Found in Assets/js/dropzone.js and 1 other location - About 1 hr to fix
Assets/js/dropzone.js on lines 1311..1314

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

Function onload has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                    fileReader.onload = (function(_this) {
                        return function() {
                            var img;
                            img = document.createElement("img");
                            img.onload = function() {
Severity: Minor
Found in Assets/js/dropzone.js - About 1 hr to fix

    Function getElements has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                Dropzone.getElements = function(els, name) {
                    var e, el, elements, _i, _j, _len, _len1, _ref;
                    if (els instanceof Array) {
                        elements = [];
                        try {
    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 (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
                              el = _ref[_j];
                              elements.push(el);
                          }
      Severity: Minor
      Found in Assets/js/dropzone.js and 1 other location - About 55 mins to fix
      Assets/js/dropzone.js on lines 718..721

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

      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 = files.length; _i < _len; _i++) {
                                                  file = files[_i];
                                                  _this.addFile(file);
                                              }
      Severity: Minor
      Found in Assets/js/dropzone.js and 1 other location - About 55 mins to fix
      Assets/js/dropzone.js on lines 1672..1675

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

      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 Heighten implements ImageHandlerInterface
      Severity: Minor
      Found in Image/Intervention/Manipulations/Heighten.php and 1 other location - About 50 mins to fix
      Image/Intervention/Manipulations/Widen.php on lines 1..25

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

      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 Widen implements ImageHandlerInterface
      Severity: Minor
      Found in Image/Intervention/Manipulations/Widen.php and 1 other location - About 50 mins to fix
      Image/Intervention/Manipulations/Heighten.php on lines 1..25

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

      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

      Avoid deeply nested control flow statements.
      Open

                                          if (option.selected) {
                                              formData.append(inputName, option.value);
                                          }
      Severity: Major
      Found in Assets/js/dropzone.js - About 45 mins to fix

        Consider simplifying this complex logical expression.
        Open

                        if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
                            if (!("classList" in document.createElement("a"))) {
                                capableBrowser = false;
                            } else {
                                _ref = Dropzone.blacklistedBrowsers;
        Severity: Major
        Found in Assets/js/dropzone.js - About 40 mins to fix

          Avoid too many return statements within this function.
          Open

                          return false;
          Severity: Major
          Found in Assets/js/dropzone.js - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language