Skip to content

P1B: Refactor (public/src/client/login.js:init) – reduce function complexity#59

Open
haolinwa wants to merge 1 commit into
CMU-17313Q:mainfrom
haolinwa:hw1b/refactor-public-src-client-login
Open

P1B: Refactor (public/src/client/login.js:init) – reduce function complexity#59
haolinwa wants to merge 1 commit into
CMU-17313Q:mainfrom
haolinwa:hw1b/refactor-public-src-client-login

Conversation

@haolinwa
Copy link
Copy Markdown

@haolinwa haolinwa commented Sep 6, 2025

  • Refactored the Login.init function in public/src/client/login.js.

  • Extracted helper functions (bindSubmitHandler, showError, clearError, handleSuccessRedirect, handleAjaxError, etc.) to simplify logic.

  • Reduced function complexity from 13 → below threshold flagged by Qlty.

  • No behavior changes.

  • ✅ Qlty: qlty smells public/src/client/login.js reports no smells.

  • ✅ Lint: npm run lint passed (0 errors).

  • ✅ Tests: npm run test passed.

  • ✅ Manual validation: temporary console.log("Haolin Wang: login init triggered") confirmed execution on /login page in browser DevTools.

Resolves Issue 57

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