joseramonc/adminpanel

View on GitHub

Showing 56 of 138 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 1560 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

          Function init has 146 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 144 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

                    Function parseDate has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            parseDate: function(date, format, language){
                                if (!date)
                                    return undefined;
                                if (date instanceof Date)
                                    return date;
                    Severity: Major
                    Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

                      Function click has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              click: function(e){
                                  e.preventDefault();
                                  var target = $(e.target).closest('span, td, th'),
                                      year, month, day;
                                  if (target.length === 1){
                      Severity: Major
                      Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

                        Function getTemplate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                , getTemplate: function() {
                                    if (this.options.templates[this.options.template]) {
                                        return this.options.templates[this.options.template];
                                    }
                                    if (this.showInputs) {
                        Severity: Major
                        Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js - About 3 hrs to fix

                          Function elementKeypress has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  , elementKeypress: function(e) {
                                      var input = this.$element.get(0);
                                      switch (e.keyCode) {
                                          case 0: //input
                                          break;
                          Severity: Major
                          Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js - About 2 hrs to fix

                            Function _buildEvents has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    _buildEvents: function(){
                                        var events = {
                                            keyup: $.proxy(function(e){
                                                if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
                                                    this.update();
                            Severity: Major
                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 2 hrs to fix

                              Class AdminpanelFormBuilder has 25 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                class AdminpanelFormBuilder < ActionView::Helpers::FormBuilder
                                  include ApplicationHelper
                                  alias_method :text_field_original, :text_field
                                  alias_method :radio_button_original, :radio_button
                                  alias_method :text_area_original, :text_area
                              Severity: Minor
                              Found in app/helpers/adminpanel/adminpanel_form_builder.rb - About 2 hrs to fix

                                Function place has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        place: function(){
                                            if (this.isInline)
                                                return this;
                                            var calendarWidth = this.picker.outerWidth(),
                                                calendarHeight = this.picker.outerHeight(),
                                Severity: Major
                                Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 2 hrs to fix

                                  Function widgetKeypress has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          , widgetKeypress: function(e) {
                                              var input = $(e.target).closest('input').attr('name');
                                  
                                              switch (e.keyCode) {
                                                  case 9: //tab
                                  Severity: Major
                                  Found in app/assets/javascripts/adminpanel/bootstrap-timepicker.js - About 2 hrs to fix

                                    Function fnUpdate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                                    "fnUpdate": function ( oSettings, fnDraw ) {
                                                        var iListLength = 5;
                                                        var oPaging = oSettings.oInstance.fnPagingInfo();
                                                        var an = oSettings.aanFeatures.p;
                                                        var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
                                    Severity: Minor
                                    Found in app/assets/javascripts/adminpanel/tables.js - About 2 hrs to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Method google has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def google
                                          authorize! :read, Adminpanel::Analytic
                                    
                                          unless Adminpanel.analytics_profile_id.nil? || Adminpanel.analytics_key_filename.nil? || Adminpanel.analytics_account_email.nil?
                                            service_account_email = Adminpanel.analytics_account_email # Email of service account
                                    Severity: Major
                                    Found in app/controllers/adminpanel/analytics_controller.rb - About 2 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 app/assets/javascripts/adminpanel/dropzone.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language