joseramonc/adminpanel

View on GitHub

Showing 138 of 138 total issues

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

                if (this.showSeconds) {
                    this.$widget.find('input.bootstrap-timepicker-second').val(this.second < 10 ? '0' + this.second : this.second);
                }
Severity: Major
Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js and 1 other location - About 1 hr to fix
app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 479..481

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

                if (this.showSeconds) {
                    this.$widget.find('span.bootstrap-timepicker-second').text(this.second < 10 ? '0' + this.second : this.second);
                }
Severity: Major
Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js and 1 other location - About 1 hr to fix
app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 470..472

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

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 app/assets/javascripts/adminpanel/dropzone.js - About 1 hr to fix

    Function createThumbnailFromUrl has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback) {
          var img;
          img = document.createElement("img");
          img.onload = (function(_this) {
            return function() {
    Severity: Minor
    Found in app/assets/javascripts/adminpanel/dropzone.js - About 1 hr to fix

      Function showWidget has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              , showWidget: function(e) {
                  e.stopPropagation();
                  e.preventDefault();
      
                  if (this.open) {
      Severity: Minor
      Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.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++) {
                    node = _ref[_i];
                    node.textContent = file.name;
                  }
        Severity: Major
        Found in app/assets/javascripts/adminpanel/dropzone.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/adminpanel/dropzone.js on lines 1166..1169

        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

        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 app/assets/javascripts/adminpanel/dropzone.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/adminpanel/dropzone.js on lines 256..259

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

                dateUpdated: function(e){
                    // `this.updating` is a workaround for preventing infinite recursion
                    // between `changeDate` triggering and `setUTCDate` calling.  Until
                    // there is a better mechanism.
                    if (this.updating)
        Severity: Minor
        Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.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 app/assets/javascripts/adminpanel/dropzone.js - About 1 hr to fix

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

                  this.timeout = setTimeout(function() {
                    if (self.hoverState == 'out') self.hide()
                  }, self.options.delay.hide)
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/adminpanel/bootstrap.js on lines 854..856

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

                  this.timeout = setTimeout(function() {
                    if (self.hoverState == 'in') self.show()
                  }, self.options.delay.show)
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/adminpanel/bootstrap.js on lines 866..868

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

                            for (_i = 0, _len = files.length; _i < _len; _i++) {
                              file = files[_i];
                              _this.addFile(file);
                            }
            Severity: Minor
            Found in app/assets/javascripts/adminpanel/dropzone.js and 1 other location - About 55 mins to fix
            app/assets/javascripts/adminpanel/dropzone.js on lines 1538..1541

            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 (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
                    el = _ref[_j];
                    elements.push(el);
                  }
            Severity: Minor
            Found in app/assets/javascripts/adminpanel/dropzone.js and 1 other location - About 55 mins to fix
            app/assets/javascripts/adminpanel/dropzone.js on lines 561..564

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                            if (this.isInput){
                                element = this.element;
                            }
                            else if (this.component){
                                element = this.element.find('input');
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 55 mins to fix
            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 530..534
            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1164..1169

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

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

                             if (this.hour >= 24) {
                                this.hour = 23;
                            } else if (this.hour < 0) {
                                this.hour = 0;
                            }
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 323..327
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 346..350
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 355..359

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

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                        if (this.isInput) {
                            element = this.element;
                        } else if (this.component) {
                            element = this.element.find('input');
                        }
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 55 mins to fix
            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1164..1169
            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1350..1355

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

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

                            } else if (this.second < 0) {
                                this.second = 0;
                            } else if (this.second >= 60) {
                                this.second = 59;
                            }
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 323..327
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 339..343
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 346..350

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

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                        if (this.isInput){
                            element = this.element;
                        }
                        else if (this.component){
                            element = this.element.find('input');
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 55 mins to fix
            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 530..534
            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1350..1355

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

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

                            if (this.hour > 12) {
                                this.hour = 12;
                            } else if (this.hour < 1) {
                                this.hour = 1;
                            }
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 339..343
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 346..350
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 355..359

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

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

                        if (this.minute < 0) {
                            this.minute = 0;
                        } else if (this.minute >= 60) {
                            this.minute = 59;
                        }
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 323..327
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 339..343
            app/assets/javascripts/adminpanel/bootstrap-timepicker.js on lines 355..359

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

            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