rosa-abf/rosa-build

View on GitHub
app/controllers/users/settings_controller.rb

Summary

Maintainability
A
1 hr
Test Coverage

Showing 3 of 3 total issues

Method profile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def profile
if request.patch?
send_confirmation = params[:user][:email] != @user.email
if @user.update_without_password(user_params)
update_avatar(@user, params)
Severity: Minor
Found in app/controllers/users/settings_controller.rb - About 35 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if request.patch?
if @user.builds_setting.update_attributes(user_builds_setting_params)
flash[:notice] = I18n.t("flash.settings.saved")
redirect_to builds_settings_settings_path and return
end
Severity: Minor
Found in app/controllers/users/settings_controller.rb and 1 other location - About 15 mins to fix
app/controllers/users/settings_controller.rb on lines 63..68

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if request.patch?
if @user.notifier.update_attributes(settings_notifier_params)
flash[:notice] = I18n.t("flash.settings.saved")
redirect_to notifiers_settings_path and return
end
Severity: Minor
Found in app/controllers/users/settings_controller.rb and 1 other location - About 15 mins to fix
app/controllers/users/settings_controller.rb on lines 74..79
Category
Status