Skip to content

Reduced complexity in the file scr/controllers/recent.js#32

Open
mfahad2 wants to merge 1 commit intoCMU-17313Q:mainfrom
mfahad2:reducing-complexity-issue
Open

Reduced complexity in the file scr/controllers/recent.js#32
mfahad2 wants to merge 1 commit intoCMU-17313Q:mainfrom
mfahad2:reducing-complexity-issue

Conversation

@mfahad2
Copy link
Copy Markdown

@mfahad2 mfahad2 commented Sep 3, 2025

Summary
Refactoring the function "getData" in the file src/controllers/recent.js so that the complexity could reduce

Changes Made:
To fix this issue the changes made included extracting the breadcrumbs & title into a new helper function. The logic of the RSS was also put into a helper function called "SetRssFields". An early return was added to simplify the validation.

Validation
To ensure that it was resolved I ran the qlty smell and the npm run lint and npm run test.

Resolves #17

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.

Refactoring code in src/controllers/recent.js

1 participant