Skip to content

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

Merged
jackseceng merged 1 commit into
mainfrom
fix(code-quality)-finding-autofix-b9388573
Apr 20, 2026
Merged

fix(code-quality): Fix for Explicit returns mixed with implicit (fall through) returns#517
jackseceng merged 1 commit into
mainfrom
fix(code-quality)-finding-autofix-b9388573

Conversation

@jackseceng
Copy link
Copy Markdown
Collaborator

To fix this, make input_url() total: every control-flow path must explicitly return a response or raise via abort.
Best minimal fix without changing behavior: add a final fallback return after the match in input_url() that returns the existing 500 handler response. This prevents implicit None return if any path in the "POST" branch ever falls through.

Edit in app/app.py, inside input_url():

  • Keep existing logic unchanged.
  • Replace the unreachable return None after abort(...) in case _ with a concrete response return (or remove it), and
  • Add/retain a final explicit return internal_server_error(HTTPStatus.INTERNAL_SERVER_ERROR) at function end so no implicit return is possible.

No new imports or dependencies are needed.

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

@jackseceng jackseceng marked this pull request as ready for review April 20, 2026 12:54
@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
…) returns

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@jackseceng jackseceng force-pushed the fix(code-quality)-finding-autofix-b9388573 branch from 91b5909 to 216837e Compare April 20, 2026 12:58
@jackseceng jackseceng merged commit 4db2f00 into main Apr 20, 2026
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