Showing 12 of 78 total issues
Class Event
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Event < ActiveRecord::Base
audited
@queue = :event_jobs
attr_accessible :name, :description, :event_type_id, :chapter_id, :venue_id
Class User
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ActiveRecord::Base
audited
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
Method setup_scheduled_tasks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def setup_scheduled_tasks
return if disable_background_tasks?
remove_scheduled_tasks()
- Read upRead up
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 mass_update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def mass_update
@event_registrations = @event.event_registrations
errors = []
if verified_request?
- Read upRead up
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 date_time_validator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def date_time_validator
if self.start_time and self.end_time
errors.add(:start_time, 'cannot be before event start') if self.event.start_time > self.start_time
errors.add(:end_time, 'cannot be after event end') if self.event.end_time < self.end_time
errors.add(:end_time, 'cannot modify beyond 30 days after Event End Time') \
- Read upRead up
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 rsvp_user_reminder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def rsvp_user_reminder()
self.event.event_registrations.each do |registration|
next unless registration.confirmed?
EventMailer.rsvp_user_reminder_mail(registration.user, event).deliver_now() unless registration.user.nil?
end
- Read upRead up
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 speaker_remind_presentation_update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def speaker_remind_presentation_update
self.event.event_sessions.each do |ev_session|
next if ev_session.placeholder?
next unless ev_session.presentation_url.to_s.empty?
EventMailer.session_speaker_presentation_update_mail(ev_session).deliver_now()
- Read upRead up
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
Avoid too many return
statements within this method. Open
return s
Avoid too many return
statements within this method. Open
return "http://#{s}" if s !~ /\Ahttp/i # Force protocol
Method registration_active?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def registration_active?
return false unless self.accepting_registration?
if self.registration_start_time and self.registration_end_time
(Time.now > self.registration_start_time) and (Time.now < self.registration_end_time)
- Read upRead up
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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
@event_registration = @event.event_registrations.new(params[:event_registration])
@event_registration.event = @event
@event_registration.user = current_user
- Read upRead up
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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*args)
super(*args)
unless self.event.nil?
self.start_time = self.event.start_time if self.start_time.nil?
- Read upRead up
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"