Skip to content

Refactored code in src/user/jobs.js to reduce high complexity #27

Open
IndyaG wants to merge 1 commit into
CMU-17313Q:mainfrom
IndyaG:refactor-user-jobs
Open

Refactored code in src/user/jobs.js to reduce high complexity #27
IndyaG wants to merge 1 commit into
CMU-17313Q:mainfrom
IndyaG:refactor-user-jobs

Conversation

@IndyaG
Copy link
Copy Markdown

@IndyaG IndyaG commented Sep 2, 2025

Summary

Previously, the src/user/jobs.js file exported a single function, with three inner functions defined within it.

In this refactor:

  • Moved the inner functions (startJobs, stopJobs, and the helper method) out of the exported function to reduce code complexity

Testing

Tested locally by adding a console.log and running the app with ./nodebb dev to verify the changes were executed correctly.

Resolves #22

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 (src/user/jobs.js): Function with high complexity (count = 10): exports

1 participant