Class Conference
has 81 methods (exceeds 20 allowed). Consider refactoring. Open
class Conference < ApplicationRecord
include RevisionCount
require 'uri'
serialize :events_per_week, Hash
# Needed to call 'Conference.with_role' in /models/ability.rb
File conference.rb
has 654 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Conference < ApplicationRecord
include RevisionCount
require 'uri'
serialize :events_per_week, Hash
# Needed to call 'Conference.with_role' in /models/ability.rb
Method notify_on_registration_dates_changed?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def notify_on_registration_dates_changed?
return false unless email_settings.send_on_conference_registration_dates_updated
# do not notify unless we allow a registration
return false unless registration_period
# do not notify unless one of the dates changed
- 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 get_events_per_week_by_state
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_events_per_week_by_state
result = {
'Submitted' => {},
'Confirmed' => {},
'Unconfirmed' => {}
- 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 valid_times_range?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def valid_times_range?
if start_hour && end_hour
errors.add(:start_hour, 'is lower than 0') if start_hour < 0
errors.add(:end_hour, 'is lower or equal than start hour') if end_hour <= start_hour
errors.add(:end_hour, 'is greater than 24') if end_hour > 24
- 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 get_submissions_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_submissions_data
return [] unless program&.cfp && program&.events
start_week = program.cfp.start_week
get_events_per_week_by_state.collect do |state, values|
- 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 affiliation_distribution
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def affiliation_distribution
counted_affiliations = registrations.joins(:user).group(:affiliation).count
result = {}
i = 1
others = 0
- 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 notify_on_dates_changed?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def notify_on_dates_changed?
return false unless email_settings.send_on_conference_dates_updated
# do not notify unless one of the dates changed
return false unless saved_change_to_start_date? || saved_change_to_end_date?
- 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"