Method update_me
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update_me
user = current_viewer
attributes = params[:user]
if attributes.present?
- 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 me
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def me
carto_viewer = current_viewer.present? ? Carto::User.find(current_viewer.id) : nil
config = {
user_frontend_version: CartoDB::Application.frontend_version
Method render_auth_users_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render_auth_users_data(user, referrer, subdomain, referrer_organization_username=nil)
organization_name = nil
# It doesn't have a organization username component. We assume it's not a organization referer
if referrer_organization_username.nil?
Method render_auth_users_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def render_auth_users_data(user, referrer, subdomain, referrer_organization_username=nil)
organization_name = nil
# It doesn't have a organization username component. We assume it's not a organization referer
if referrer_organization_username.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"
Further reading
Method delete_me
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_me
user = current_viewer
deletion_password_confirmation = params[:deletion_password_confirmation]
- 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"