Skip to content

refactor: simplify if statement#16

Open
deepsource-autofix[bot] wants to merge 1 commit into
masterfrom
deepsource-autofix-21319cdc
Open

refactor: simplify if statement#16
deepsource-autofix[bot] wants to merge 1 commit into
masterfrom
deepsource-autofix-21319cdc

Conversation

@deepsource-autofix
Copy link
Copy Markdown

This PR refactors the way the isAdmin flag is assigned by collapsing a multi-line if-else into a single, concise boolean expression.

  • if statement can be simplified: Previously, the code checked for an "Admin" attribute and explicitly set isAdmin to True or False in an if-else block. This was redundant since the condition itself evaluates to a boolean. The fix replaces the block with isAdmin = bool("Admin" in event["request"]["userAttributes"] and event["request"]["userAttributes"]["Admin"]), making the intent clearer and the code more concise.

This Autofix was generated by AI. Please review the change before merging.

This PR refactors the way the `isAdmin` flag is assigned by collapsing a multi-line `if-else` into a single, concise boolean expression.

- if statement can be simplified: Previously, the code checked for an "Admin" attribute and explicitly set `isAdmin` to `True` or `False` in an `if-else` block. This was redundant since the condition itself evaluates to a boolean. The fix replaces the block with `isAdmin = bool("Admin" in event["request"]["userAttributes"] and event["request"]["userAttributes"]["Admin"])`, making the intent clearer and the code more concise.

> This Autofix was generated by AI. Please review the change before merging.
@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Oct 23, 2025

Here's the code health analysis summary for commits 15f1b79..9f68113. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Python LogoPython✅ Success
🎯 2 occurences resolved
View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants