I-de-ya/ideyabox

View on GitHub

Showing 33 of 66 total issues

File chosen.jquery.js has 911 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Chosen, a Select Box Enhancer for jQuery and Protoype
// by Patrick Filler for Harvest, http://getharvest.com
// 
// Version 0.9.8
// Full source at https://github.com/harvesthq/chosen
Severity: Major
Found in app/assets/javascripts/chosen.jquery.js - About 2 days to fix

    Function _mouseDrag has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _mouseDrag: function(event) {
    
                //Compute the helpers position
                this.position = this._generatePosition(event);
                this.positionAbs = this._convertPositionTo("absolute");
    Severity: Major
    Found in app/assets/javascripts/jquery.mjs.nestedSortable.js - About 4 hrs to fix

      Class ManyToManyGenerator has 34 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class ManyToManyGenerator < ::Rails::Generators::Base
            source_root File.expand_path('../templates', __FILE__)
            argument :controller_path,    :type => :string
            argument :child_controller_path,    :type => :string
            argument :join_controller_path, :type => :string, :default => nil, :required => false
      Severity: Minor
      Found in lib/generators/ideyabox/many_to_many/many_to_many_generator.rb - About 4 hrs to fix

        File jquery.mjs.nestedSortable.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * jQuery UI Nested Sortable
         * v 1.3.5 / 21 jun 2012
         * http://mjsarfatti.com/code/nestedSortable
         *
        Severity: Minor
        Found in app/assets/javascripts/jquery.mjs.nestedSortable.js - About 3 hrs to fix

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

              class ImagesScaffoldGenerator < ::Rails::Generators::Base
                source_root File.expand_path('../templates', __FILE__)
                argument :controller_path,    :type => :string
                argument :model_name,         :type => :string, :required => false
                argument :layout,             :type => :string, :default => "application",
          Severity: Minor
          Found in lib/generators/ideyabox/images_scaffold/images_scaffold_generator.rb - About 2 hrs to fix

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

                class TreeGenerator < ::Rails::Generators::Base
                  source_root File.expand_path('../templates', __FILE__)
                  argument :controller_path,    :type => :string
                  argument :model_name,         :type => :string, :required => false
                  argument :layout,             :type => :string, :default => "application",
            Severity: Minor
            Found in lib/generators/ideyabox/tree/tree_generator.rb - About 2 hrs to fix

              Class ScaffoldGenerator has 24 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class ScaffoldGenerator < ::Rails::Generators::Base
                    source_root File.expand_path('../templates', __FILE__)
                    argument :controller_path,    :type => :string
                    argument :model_name,         :type => :string, :required => false
                    argument :layout,             :type => :string, :default => "application",
              Severity: Minor
              Found in lib/generators/ideyabox/scaffold/scaffold_generator.rb - About 2 hrs to fix

                Class CropGenerator has 23 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class CropGenerator < ::Rails::Generators::Base
                      source_root File.expand_path('../templates', __FILE__)
                      argument :controller_path,    :type => :string
                      argument :model_name,         :type => :string, :required => false
                      argument :layout,             :type => :string, :default => "application",
                Severity: Minor
                Found in lib/generators/ideyabox/crop/crop_generator.rb - About 2 hrs to fix

                  Function winnow_results has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Chosen.prototype.winnow_results = function() {
                        var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref;
                        this.no_results_clear();
                        results = 0;
                        searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
                  Severity: Major
                  Found in app/assets/javascripts/chosen.jquery.js - About 2 hrs to fix

                    Function register_observers has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        Chosen.prototype.register_observers = function() {
                          var _this = this;
                          this.container.mousedown(function(evt) {
                            return _this.container_mousedown(evt);
                          });
                    Severity: Major
                    Found in app/assets/javascripts/chosen.jquery.js - About 2 hrs to fix

                      Function set_up_html has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          Chosen.prototype.set_up_html = function() {
                            var container_div, dd_top, dd_width, sf_width;
                            this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
                            this.container_id += "_chzn";
                            this.f_width = this.form_field_jq.outerWidth();
                      Severity: Minor
                      Found in app/assets/javascripts/chosen.jquery.js - About 1 hr to fix

                        Function toArray has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                toArray: function(options) {
                        
                                    var o = $.extend({}, this.options, options),
                                        sDepth = o.startDepthCount || 0,
                                        ret = [],
                        Severity: Minor
                        Found in app/assets/javascripts/jquery.mjs.nestedSortable.js - About 1 hr to fix

                          Method sort_tree has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def sort_tree(url, maxlevels)
                              %Q{
                                <script type="text/javascript">
                                  $(document).ready(function(){
                          
                          
                          Severity: Minor
                          Found in app/helpers/admin_helper.rb - About 1 hr to fix

                            Function results_build has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                Chosen.prototype.results_build = function() {
                                  var content, data, _i, _len, _ref;
                                  this.parsing = true;
                                  this.results_data = root.SelectParser.select_to_array(this.form_field);
                                  if (this.is_multiple && this.choices > 0) {
                            Severity: Minor
                            Found in app/assets/javascripts/chosen.jquery.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if (!o.isAllowed(this.currentItem, parentItem) ||
                                              parentItem && parentItem.hasClass(o.disableNesting) ||
                                              o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {
                                                  this.placeholder.addClass(o.errorClass);
                                                  if (maxLevels < levels && maxLevels != 0) {
                              Severity: Critical
                              Found in app/assets/javascripts/jquery.mjs.nestedSortable.js - About 1 hr to fix

                                Function result_select has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    Chosen.prototype.result_select = function(evt) {
                                      var high, high_id, item, position;
                                      if (this.result_highlight) {
                                        high = this.result_highlight;
                                        high_id = high.attr("id");
                                Severity: Minor
                                Found in app/assets/javascripts/chosen.jquery.js - About 1 hr to fix

                                  Method cropable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def cropable(image_name, x,y,w,h)
                                      %Q{
                                        <script type="text/javascript">
                                          function jcropInit() {
                                  
                                  
                                  Severity: Minor
                                  Found in app/helpers/admin_helper.rb - About 1 hr to fix

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

                                        AbstractChosen.prototype.keyup_checker = function(evt) {
                                          var stroke, _ref;
                                          stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
                                          this.search_field_scale();
                                          switch (stroke) {
                                    Severity: Minor
                                    Found in app/assets/javascripts/chosen.jquery.js - About 1 hr to fix

                                      Method updating_models has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                            def updating_models
                                              inject_into_file "app/models/#{resource_name}.rb", "\n
                                        has_ancestry :orphan_strategy => :rootify
                                      
                                      
                                      
                                      Severity: Minor
                                      Found in lib/generators/ideyabox/tree/tree_generator.rb - About 1 hr to fix

                                        Method update_model has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                              def update_model
                                                inject_into_file "app/models/#{resource_name}.rb", "\n  has_many :#{plural_child_name}, :through => :#{plural_linking_resource_name}\n  has_many :#{plural_linking_resource_name}\n
                                          # def self.has_not_this_#{child_name}(#{child_name}_id)
                                          #   h = Hash.new
                                          #   self.order(#{child_model.constantize.column_names.include?('title') ? '\'title\'' : 'created_at'}).each do |p|
                                        Severity: Minor
                                        Found in lib/generators/ideyabox/many_to_many/many_to_many_generator.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language