Showing 180 of 222 total issues
Method create_from_aktivmeldung
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_from_aktivmeldung
raise 'Kein Auftrag zur Datenverarbeitung erteilt.' unless params[:privacy].present?
new_user = User.create first_name: params[:first_name], last_name: params[:last_name]
new_user.date_of_birth = params[:date_of_birth].to_date
new_user.mobile = params[:phone]
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 rights_for_signed_in_users
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def rights_for_signed_in_users
#
# Inherited from your_platform:
# - terms of use
# - users
- 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 access_to_this_action_restricted?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def access_to_this_action_restricted?
if kind_of?(PagesController) && (action_name == "show")
page = Page.find(params[:id])
if page.public?
false
- 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 check_corporation_memberships_consistency_for
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_corporation_memberships_consistency_for(netenv_user)
# Aktivmeldungsdatum?
if not netenv_user.aktivmeldungsdatum
warning = { message: 'Kein Aktivmeldungsdatum angegeben.',
- 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_from_keilgast
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_from_keilgast
raise 'Kein Auftrag zur Datenverarbeitung erteilt.' unless params[:privacy].present?
keilgast_group = corporation.sub_group("Keilgäste") || raise("Für die Verbindung #{corporation.name} ist keine Gruppe 'Keilgäste' vorhanden.")
new_user = User.create first_name: params[:first_name], last_name: params[:last_name]
- 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 fix_netenv_aktivitätszahl_format
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fix_netenv_aktivitätszahl_format(str)
if str
str = remove_brackets(str)
str = str.gsub(";", ",")
str = str.gsub(/^,/, "").gsub(/,$/, "")
- 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 deeply nested control flow statements. Open
if (this.settings.timer > 0) {
this.settings.$next_tip
.fadeIn(this.settings.tip_animation_fade_speed)
.show();
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
Avoid deeply nested control flow statements. Open
if (self.S(klass).hasClass('fixed')) {
self.S(klass).removeClass('fixed');
self.S('body').removeClass('f-topbar-fixed');
}
Avoid deeply nested control flow statements. Open
if (this.settings.timer > 0) {
this.settings.$next_tip
.fadeIn(this.settings.tip_animation_fade_speed)
.show();
Avoid deeply nested control flow statements. Open
if (self.S(klass).hasClass('fixed')) {
self.S(klass).removeClass('fixed');
self.S('body').removeClass('f-topbar-fixed');
}
Method add_profile_field
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_profile_field( label, args )
raise 'no :type argument given' unless args[:type].present?
args[:type] = "ProfileFieldTypes::#{args[:type]}" unless args[:type].start_with? "ProfileFieldTypes::"
if (args[:force] or one_argument_present?(args))
args.delete(:force)
- 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 import_contact_profile_fields_from
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def import_contact_profile_fields_from( netenv_user )
add_profile_field :home_email, value: netenv_user.home_email, type: 'Email' unless netenv_user.home_email == netenv_user.email
add_profile_field :work_email, value: netenv_user.work_email, type: 'Email' unless netenv_user.work_email == netenv_user.email
home_address_field = add_profile_field netenv_user.home_address_label, value: netenv_user.home_address, type: 'Address'
- 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
Function normalized_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
normalized_value : function (val, start, end, step, precision) {
Function init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
init : function (scope, libraries, method, options, response) {
Function init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
init : function (scope, libraries, method, options, response) {
Function normalized_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
normalized_value : function (val, start, end, step, precision) {
Method create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
authorize! :create, User
authorize! :update, corporation
raise 'no corporation given' unless corporation
- 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"