bborn/communityengine

View on GitHub

Showing 106 of 147 total issues

Function Jcrop has 1311 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.Jcrop = function (obj, opt) {
    var options = $.extend({}, $.Jcrop.defaults),
        docOffset, lastcurs, ie6mode = false;

    // Internal Methods {{{
Severity: Major
Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 6 days to fix

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

    /**
     * jquery.Jcrop.js v0.9.10
     * jQuery Image Cropping Plugin - released under MIT License 
     * Author: Kelly Hallman <khallman@gmail.com>
     * http://github.com/tapmodo/Jcrop
    Severity: Major
    Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 3 days to fix

      Function Coords has 252 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Coords = (function () {
            var x1 = 0,
                y1 = 0,
                x2 = 0,
                y2 = 0,
      Severity: Major
      Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 1 day to fix

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

        /*!
         * jQuery Color Animations v2.0pre
         * http://jquery.org/
         *
         * Copyright 2011 John Resig
        Severity: Major
        Found in app/assets/javascripts/jcrop/jquery.color.js - About 1 day to fix

          Function Selection has 213 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var Selection = (function () {
                var awake,
                    hdep = 370,
                    borders = {},
                    handle = {},
          Severity: Major
          Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 1 day to fix

            Class User has 57 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class User < ActiveRecord::Base
              extend FriendlyId
              include UrlUpload
              include FacebookProfile
              include TwitterProfile
            Severity: Major
            Found in app/models/user.rb - About 1 day to fix

              Function _create has 146 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _create: function() {
                          // for handling static scoping inside callbacks
                          var that = this;
              
                          // There are 2 kinds of DOM nodes this widget can be instantiated on:
              Severity: Major
              Found in app/assets/javascripts/tag-it/tag-it.js - About 5 hrs to fix

                File tag-it.js has 402 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                * jQuery UI Tag-it!
                *
                * @version v2.0 (06/2011)
                *
                Severity: Minor
                Found in app/assets/javascripts/tag-it/tag-it.js - About 5 hrs to fix

                  Class UsersController has 39 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class UsersController < BaseController
                    include Viewable
                    cache_sweeper :taggable_sweeper, :only => [:activate, :update, :destroy]
                  
                    before_action :login_required, :only => [:edit, :edit_account, :update, :welcome_photo, :welcome_about,
                  Severity: Minor
                  Found in app/controllers/users_controller.rb - About 5 hrs to fix

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

                    /*!
                     * jQuery Migrate - v1.2.1 - 2013-05-08
                     * https://github.com/jquery/jquery-migrate
                     * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
                     */
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.migrate.js - About 5 hrs to fix

                      Method page_title has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def page_title
                          divider = " | ".html_safe
                      
                          app_base = configatron.community_name
                          tagline = " #{divider} #{configatron.community_tagline}"
                      Severity: Minor
                      Found in app/helpers/base_helper.rb - About 5 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

                      File users_controller.rb has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class UsersController < BaseController
                        include Viewable
                        cache_sweeper :taggable_sweeper, :only => [:activate, :update, :destroy]
                      
                        before_action :login_required, :only => [:edit, :edit_account, :update, :welcome_photo, :welcome_about,
                      Severity: Minor
                      Found in app/controllers/users_controller.rb - About 4 hrs to fix

                        File user.rb has 366 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require 'digest/sha1'
                        require 'bcrypt'
                        
                        class User < ActiveRecord::Base
                          extend FriendlyId
                        Severity: Minor
                        Found in app/models/user.rb - About 4 hrs to fix

                          Method container_title has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def container_title
                              app_base = configatron.community_name
                              title = app_base
                          
                              case controller.controller_name
                          Severity: Minor
                          Found in app/helpers/base_helper.rb - About 4 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

                          Function Shade has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var Shade = (function() {
                                var enabled = false,
                                    holder = $('<div />').css({
                                      position: 'absolute',
                                      zIndex: 240,
                          Severity: Major
                          Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 4 hrs to fix

                            File base_helper.rb has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            require 'digest/md5'
                            
                            # Methods added to this helper will be available to all templates in the application.
                            module BaseHelper
                              include ActsAsTaggableOn::TagsHelper
                            Severity: Minor
                            Found in app/helpers/base_helper.rb - About 3 hrs to fix

                              Method atom_feed_for has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def atom_feed_for(resources, options = {})
                                    xml = Builder::XmlMarkup.new(:indent => 2)
                              
                                    options[:feed]       ||= {}
                                    options[:item]       ||= {}
                              Severity: Minor
                              Found in lib/resource_feeder/atom.rb - About 3 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

                              Function getFixed has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    function getFixed() //{{{
                                    {
                                      if (!options.aspectRatio) {
                                        return getRect();
                                      }
                              Severity: Major
                              Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 3 hrs to fix

                                Function Tracker has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    var Tracker = (function () {
                                      var onMove = function () {},
                                          onDone = function () {},
                                          trackDoc = options.trackDocument;
                                
                                
                                Severity: Major
                                Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 3 hrs to fix

                                  Class Post has 26 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class Post < ActiveRecord::Base
                                    include Rakismet::Model
                                    rakismet_attrs :comment_type => 'post'
                                  
                                    acts_as_moderated_commentable
                                  Severity: Minor
                                  Found in app/models/post.rb - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language