Skip to content

fix(code-quality): Fix for Explicit returns mixed with implicit (fall through) returns#516

Merged
jackseceng merged 2 commits into
mainfrom
finding-autofix-37eeb6f0
Apr 20, 2026
Merged

fix(code-quality): Fix for Explicit returns mixed with implicit (fall through) returns#516
jackseceng merged 2 commits into
mainfrom
finding-autofix-37eeb6f0

Conversation

@jackseceng
Copy link
Copy Markdown
Collaborator

General fix: ensure redirect_url has an explicit return for all code paths, and avoid return None after abort() in view functions. In Flask handlers, either return a valid response object/string/tuple or raise via abort().

Best fix in this file: in app/app.py, inside redirect_url (around lines 167–201), replace the abort(...); return None block with a direct return page_not_found(...) using the existing error handler function. This guarantees an explicit Flask response object on that branch and removes the problematic None return path. Also add a final defensive return after the match to ensure an explicit response in all analyzer-visible paths.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@jackseceng jackseceng changed the title Fix for Explicit returns mixed with implicit (fall through) returns fix(code-quality): Fix for Explicit returns mixed with implicit (fall through) returns Apr 20, 2026
…urns may indicate an error, as implicit returns always return None
@jackseceng jackseceng marked this pull request as ready for review April 20, 2026 12:48
@jackseceng jackseceng merged commit a219e51 into main Apr 20, 2026
21 of 22 checks passed
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.

1 participant