lujanfernaud/prevy

View on GitHub

Showing 1,727 of 1,727 total issues

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

class Event < ApplicationRecord
  RECENT_ATTENDEES = 8
  RANDOM_ATTENDEES = 6
  EVENTS_PER_PAGE  = 15

Severity: Minor
Found in app/models/event.rb - About 2 hrs to fix

    Class TopicsController has 22 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Groups::TopicsController < ApplicationController
      include Groups::AuthorizationRedirecter
    
      before_action :find_group
      after_action  :verify_authorized, except: [:index, :show]
    Severity: Minor
    Found in app/controllers/groups/topics_controller.rb - About 2 hrs to fix

      Class Topic has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Topic < ApplicationRecord
        PRIORITY            = 0
        MINIMUM_BODY_LENGTH = 20
        EDITED_OFFSET_TIME  = 600 # 10 minutes
        POINTS              = 3
      Severity: Minor
      Found in app/models/topic.rb - About 2 hrs to fix

        Function lazyUnveil has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var lazyUnveil = rAFIt(function (elem, detail, isAuto, sizes, isImg){
                    var src, srcset, parent, isPicture, event, firesLoad;
        
                    if(!(event = triggerEvent(elem, 'lazybeforeunveil', detail)).defaultPrevented){
        
        

          Function checkElements has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var checkElements = function() {
                      var eLlen, i, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal, beforeExpandVal;
          
                      var lazyloadElems = lazysizes.elements;
          
          

            Assignment Branch Condition size for devise_error_messages! is too high. [19.26/15]
            Open

              def devise_error_messages!
                return "" if resource.errors.empty?
            
                messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
                sentence = I18n.t("errors.messages.not_saved",
            Severity: Minor
            Found in app/helpers/devise_helper.rb by rubocop

            This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

            Function autoSizer has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var autoSizer = (function(){
                    var autosizesElems;
            
                    var sizeElement = rAFIt(function(elem, parent, event, width){
                        var sources, i, len;

              Method has too many lines. [12/10]
              Open

                def devise_error_messages!
                  return "" if resource.errors.empty?
              
                  messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
                  sentence = I18n.t("errors.messages.not_saved",
              Severity: Minor
              Found in app/helpers/devise_helper.rb by rubocop

              This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

              Method has too many lines. [12/10]
              Open

                def destroy
                  @user = User.find(params[:id])
                  @membership = GroupMembership.find_by(group: @group, user: @user)
              
                  authorize @membership

              This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

              Method has too many lines. [11/10]
              Open

                def destroy
                  @membership_request = find_membership_request
                  @user  = @membership_request.user
                  @group = @membership_request.group
              
              

              This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

              Method has too many lines. [11/10]
              Open

                def create
                  @group   = GroupDecorator.new(find_group)
                  @topic   = find_topic
                  @comment = create_comment
              
              

              This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

              Method has too many lines. [11/10]
              Open

                def update
                  @comment = find_comment
                  @topic   = @comment.topic
                  @group   = GroupDecorator.new(@topic.group)
              
              

              This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

              Method has too many lines. [11/10]
              Open

                  def new_topic_from(seed)
                    user = select_user_for seed
              
                    group.topics.new(
                      user:              user,

              This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

              Block has too many lines. [42/25]
              Open

                task :set_annotation_options do
                  # You can override any of these by setting an environment variable of the
                  # same name.
                  Annotate.set_defaults(
                    'routes'                    => 'false',
              Severity: Minor
              Found in lib/tasks/auto_annotate_models.rake by rubocop

              This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

              Assignment Branch Condition size for confirm is too high. [15.26/15]
              Open

                def confirm
                  @confirmation_token = params[resource_name][:confirmation_token]
              
                  self.resource = find_resource_by_confirmation_token
              
              

              This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

              Function throttle has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var throttle = function(fn){
                      var running;
                      var lastTime = 0;
                      var gDelay = lazySizesConfig.throttleDelay;
                      var rICTimeout = lazySizesConfig.ricTimeout;

                Consider simplifying this complex logical expression.
                Open

                            if( (isAuto || !isCompleted) && isImg && (elem[_getAttribute]('src') || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesConfig.errorClass) && hasClass(elem, lazySizesConfig.lazyClass)){return;}

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

                              _: function(){
                                  started = Date.now();
                  
                                  lazysizes.elements = document.getElementsByClassName(lazySizesConfig.lazyClass);
                                  preloadElems = document.getElementsByClassName(lazySizesConfig.lazyClass + ' ' + lazySizesConfig.preloadClass);

                    Function rAF has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var rAF = (function(){
                            var running, waiting;
                            var firstFns = [];
                            var secondFns = [];
                            var fns = firstFns;

                      Complex method DeviseHelper#devise_error_messages! (26.4)
                      Open

                        def devise_error_messages!
                          return "" if resource.errors.empty?
                      
                          messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
                          sentence = I18n.t("errors.messages.not_saved",
                      Severity: Minor
                      Found in app/helpers/devise_helper.rb by flog

                      Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

                      You can read more about ABC metrics or the flog tool

                      Severity
                      Category
                      Status
                      Source
                      Language