Class User
has 54 methods (exceeds 20 allowed). Consider refactoring. Open
class User
prepend UserOverrides
include UserLeibverhaeltnisse
include UserNetenvData
File user.rb
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency YourPlatform::Engine.root.join( 'app/models/user' ).to_s
# This class represents a user of the platform. A user may or may not have an account.
# While the most part of the user class is contained in the your_platform engine,
# this re-opened class contains all wingolf-specific additions to the user model.
Method adapt_bv_to_primary_address
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def adapt_bv_to_primary_address
self.groups.reload
new_bv = correct_bv
# Wenn der Philister einen Wunsch-BV hat, wird die automatische Zuordnung
- 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 adapt_bv_to_primary_address
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def adapt_bv_to_primary_address
self.groups.reload
new_bv = correct_bv
# Wenn der Philister einen Wunsch-BV hat, wird die automatische Zuordnung
Method fill_in_template_profile_information
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fill_in_template_profile_information
self.profile_fields.create(label: :personal_title, type: "ProfileFields::General")
self.profile_fields.create(label: :academic_degree, type: "ProfileFields::AcademicDegree")
self.profile_fields.create(label: :cognomen, type: "ProfileFields::General")
self.profile_fields.create(label: :klammerung, type: "ProfileFields::Klammerung")
Method fill_in_template_profile_information
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fill_in_template_profile_information
self.profile_fields.create(label: :personal_title, type: "ProfileFields::General")
self.profile_fields.create(label: :academic_degree, type: "ProfileFields::AcademicDegree")
self.profile_fields.create(label: :cognomen, type: "ProfileFields::General")
self.profile_fields.create(label: :klammerung, type: "ProfileFields::Klammerung")
- 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 in_allen_verbindungen_philistrieren!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def in_allen_verbindungen_philistrieren!
raise "Noch kein Philister. Das geht nur, wenn er schon in einer Verbindung Philister ist." unless philistrationsdatum
self.current_corporations.each do |corporation|
unless self.member_of? corporation.philisterschaft
status_group_ids_in_this_corporation = StatusGroup.find_all_by_group(corporation.aktivitas).map(&:id)
- 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 personal_greeting
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def personal_greeting(options = {})
if self.wingolfit?
bbr = if self.aktiver?
"Bundesbruder"
else
- 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 change_status
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def change_status(new_status, options = {})
corporation_token = options[:in]
corp = if self.current_corporations.count == 1
print "Ignoriere :in-Option, da nur ein Band vorliegt.\n" if corporation_token
self.current_corporations.first
- 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 status_export_string
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def status_export_string
self.corporations.collect do |corporation|
if membership = self.current_status_membership_in(corporation)
"#{membership.group.name.singularize} im #{corporation.name} seit #{I18n.localize(membership.valid_from.to_date) if membership.valid_from}"
else
- 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"