Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring function Complexity from 22-15 and 16-15, src/install.js #70

Open
wants to merge 4 commits into
base: f24
Choose a base branch
from

Conversation

mrahmed2026
Copy link

@mrahmed2026 mrahmed2026 commented Sep 3, 2024

This resolves #3
Refactored 2 different functions from their complexities (22 and 16) to a complexity of at least 15.
I broke the code down and put many of the conditional statements into different helper functions.
This in turn helped to reduce the complexity of the function, as instead of doing the complex conditional logic, it simply had to make a function call.
Hence reducing the overall complexity.
The file path is src/install.js

@mrahmed2026 mrahmed2026 changed the title complexity from 16 to 15 test 1 Refactoring function Complexity from 22-15 and 16-15, NodeBB/src/install.js Sep 3, 2024
@mrahmed2026 mrahmed2026 marked this pull request as draft September 3, 2024 15:48
@mrahmed2026 mrahmed2026 marked this pull request as ready for review September 3, 2024 15:48
Copy link

sonarcloud bot commented Sep 3, 2024

@mrahmed2026 mrahmed2026 changed the title Refactoring function Complexity from 22-15 and 16-15, NodeBB/src/install.js Refactoring function Complexity from 22-15 and 16-15, src/install.js Sep 4, 2024
@mrahmed2026
Copy link
Author

I have fixed the elint errors and sonar cloud issues on this file and refactored the code.
However, for the coverage, this file was not covered, so as per the announcement on Slack, i chose a new file to do the coverage and trigger on.
Please find the other pull request i made for this file using the link below.
#87

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/install.js
1 participant