Skip to content

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

Open
mrahmed2026 wants to merge 4 commits into
CMU-17313Q:f24from
mrahmed2026:Complexity_16_to_15
Open

Refactoring function Complexity from 22-15 and 16-15, src/install.js#70
mrahmed2026 wants to merge 4 commits into
CMU-17313Q:f24from
mrahmed2026:Complexity_16_to_15

Conversation

@mrahmed2026
Copy link
Copy Markdown

@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
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud 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
Copy Markdown
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.
CMU-17313Q/NodeBB#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