Address code complexity, and Rubocop for global_slack_handler.rb
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussions from !118289 (merged) should be addressed:
-
@harsimarsandhu started a discussion: (+1 comment) How about we move the below code to a separate method to reduce cognitive complexity? something like
def handle_command(slack_integration) chat_user = ChatNames::FindUserChatService.new(params[:team_id], params[:user_id]).execute integration = slack_integration.integration if chat_user&.user Gitlab::SlashCommands::Command.new(integration.project, chat_user, params).execute else url = ChatNames::AuthorizeUserChatService.new(params).execute Gitlab::SlashCommands::Presenters::Access.new(url).authorize end end
-
@tkuah started a discussion: Follow-up: Should we move this into the model to address this Rubocop ?
/cc @.luke
Edited by 🤖 GitLab Bot 🤖