Skip to content

Refactor src/posts/category.js to remove Qlty code smell#63

Open
sabualha wants to merge 4 commits into
CMU-17313Q:mainfrom
sabualha:refactor/category
Open

Refactor src/posts/category.js to remove Qlty code smell#63
sabualha wants to merge 4 commits into
CMU-17313Q:mainfrom
sabualha:refactor/category

Conversation

@sabualha
Copy link
Copy Markdown

@sabualha sabualha commented Sep 7, 2025

This pull request refactors the exported functions in 'src/post/category.js' that were flagged by Qlty for too many return statements. I changed the multiple return points into single returns using a result variable to improve the readability and maintainability of the code.

Changes made:

  • Refactored 'Posts.getCidByPid' and 'Posts.filterPidsByCid' to remove any early returns.
  • Applied consistent return styles on all three functions.

Resolves #3

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 Refactoring code in src/posts/category.js

1 participant