codn/adminpanel

View on GitHub

Showing 139 of 139 total issues

File bootstrap-datepicker.js has 1622 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Datepicker for Bootstrap v1.5.0-dev (https://github.com/eternicode/bootstrap-datepicker)
 *
 * Copyright 2012 Stefan Petre
 * Improvements by Andrew Rowls
Severity: Major
Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 days to fix

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

    
    /*
     *
     * More info at [www.dropzonejs.com](http://www.dropzonejs.com)
     *
    Severity: Major
    Found in app/assets/javascripts/adminpanel/dropzone.js - About 4 days to fix

      File bootstrap.js has 1311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* ===================================================
       * bootstrap-transition.js v2.2.2
       * http://twitter.github.com/bootstrap/javascript.html#transitions
       * ===================================================
       * Copyright 2012 Twitter, Inc.
      Severity: Major
      Found in app/assets/javascripts/adminpanel/bootstrap.js - About 3 days to fix

        File bootstrap-timepicker.js has 686 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* =========================================================
         * bootstrap-timepicker.js
         * http://www.github.com/jdewit/bootstrap-timepicker
         * =========================================================
         * Copyright 2012
        Severity: Major
        Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js - About 1 day to fix

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

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

          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._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 app/assets/javascripts/adminpanel/dropzone.js and 1 other location - About 7 hrs to fix
          app/assets/javascripts/adminpanel/dropzone.js on lines 1389..1404

          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._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 app/assets/javascripts/adminpanel/dropzone.js and 1 other location - About 7 hrs to fix
          app/assets/javascripts/adminpanel/dropzone.js on lines 1406..1421

          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

                  _unapplyEvents: function(evs){
                      for (var i=0, el, ev, ch; i < evs.length; i++){
                          el = evs[i][0];
                          if (evs[i].length === 2){
                              ch = undefined;
          Severity: Major
          Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 6 hrs to fix
          app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 275..288

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

          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

                  _applyEvents: function(evs){
                      for (var i=0, el, ch, ev; i < evs.length; i++){
                          el = evs[i][0];
                          if (evs[i].length === 2){
                              ch = undefined;
          Severity: Major
          Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 6 hrs to fix
          app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 289..302

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

          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 148 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 app/assets/javascripts/adminpanel/dropzone.js - About 5 hrs to fix

            Function uploadFiles has 146 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, method, option, progressObj, response, updateProgress, url, 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 app/assets/javascripts/adminpanel/dropzone.js - About 5 hrs to fix

              Function fill has 124 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      fill: function(){
                          var d = new Date(this.viewDate),
                              year = d.getUTCFullYear(),
                              month = d.getUTCMonth(),
                              startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
              Severity: Major
              Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

                Function keydown has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        keydown: function(e){
                            if (!this.picker.is(':visible')){
                                if (e.keyCode === 40 || e.keyCode === 27) // allow down to re-show picker
                                    this.show();
                                return;
                Severity: Major
                Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

                  Function _process_options has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _process_options: function(opts){
                              // Store raw options for reference
                              this._o = $.extend({}, this._o, opts);
                              // Processed options
                              var o = this.o = $.extend({}, this._o);
                  Severity: Major
                  Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

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

                      $.fn.scrollspy = function (option) {
                        return this.each(function () {
                          var $this = $(this)
                            , data = $this.data('scrollspy')
                            , options = typeof option == 'object' && option
                    Severity: Major
                    Found in app/assets/javascripts/adminpanel/bootstrap.js and 5 other locations - About 4 hrs to fix
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1028..1036
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1146..1154
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1247..1255
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1623..1631
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 2130..2138

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

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

                      $.fn.typeahead = function (option) {
                        return this.each(function () {
                          var $this = $(this)
                            , data = $this.data('typeahead')
                            , options = typeof option == 'object' && option
                    Severity: Major
                    Found in app/assets/javascripts/adminpanel/bootstrap.js and 5 other locations - About 4 hrs to fix
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 593..601
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1028..1036
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1146..1154
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1247..1255
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1623..1631

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

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

                      $.fn.popover = function (option) {
                        return this.each(function () {
                          var $this = $(this)
                            , data = $this.data('popover')
                            , options = typeof option == 'object' && option
                    Severity: Major
                    Found in app/assets/javascripts/adminpanel/bootstrap.js and 5 other locations - About 4 hrs to fix
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 593..601
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1028..1036
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1247..1255
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1623..1631
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 2130..2138

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

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

                      $.fn.collapse = function (option) {
                        return this.each(function () {
                          var $this = $(this)
                            , data = $this.data('collapse')
                            , options = typeof option == 'object' && option
                    Severity: Major
                    Found in app/assets/javascripts/adminpanel/bootstrap.js and 5 other locations - About 4 hrs to fix
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 593..601
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1028..1036
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1146..1154
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1247..1255
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 2130..2138

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

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

                      $.fn.tooltip = function ( option ) {
                        return this.each(function () {
                          var $this = $(this)
                            , data = $this.data('tooltip')
                            , options = typeof option == 'object' && option
                    Severity: Major
                    Found in app/assets/javascripts/adminpanel/bootstrap.js and 5 other locations - About 4 hrs to fix
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 593..601
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1146..1154
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1247..1255
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 1623..1631
                    app/assets/javascripts/adminpanel/bootstrap.js on lines 2130..2138

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

                    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