Skip to content

refactor(src/user/digest.js): simplify complex boolean with Array.every#67

Closed
skkuwari-alt wants to merge 2 commits into
CMU-17313Q:mainfrom
skkuwari-alt:refactor/digest-no-complex-bool
Closed

refactor(src/user/digest.js): simplify complex boolean with Array.every#67
skkuwari-alt wants to merge 2 commits into
CMU-17313Q:mainfrom
skkuwari-alt:refactor/digest-no-complex-bool

Conversation

@skkuwari-alt
Copy link
Copy Markdown

Summary
Refactors the complex boolean in 'digest.send' (file: src/user/digest.js) to improve readability and resolve a Qlty-reported maintainability smell.

Specific changes.

  • Replaced a long chained '&' expression with named checks and 'Array.every(Boolean)'.
  • No behavior change (pure refactor).

qtly
src/user/digest.js
112 Complex binary expression

Validation (Qlty, lint, tests, manual run).

  • Qlty re-run shows the smell is gone.
  • npm run lint passes with no errors.
  • npm test passes with good coverage (mostly green)
  • anual run: inserted temporary console.log("SALWA", userObj.uid) inside refactored code, restarted NodeBB, and observed the log line in test output, confirming the code path executes.
  • Removed debug log after validation.

After
Resolves #61 #61

@skkuwari-alt
Copy link
Copy Markdown
Author

Disreagrd. Meant for team repo

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.

P1B: Refactor (<full/path/to/digest.js:112>): Complex binary expression

1 participant