CMU-17313Q / NodeBB

GNU General Public License v3.0
0 stars 50 forks source link

Refactored code in src/settings.js #16

Open Abdallah-Abdaljalil opened 2 months ago

Abdallah-Abdaljalil commented 2 months ago

Refactored the code in settings.js to reduce the complexity from 16.

Changes

Created a function getValue to perform the loop needed to traverse the objects. It reduces the amount of conditionals and nested loops or conditions. A ternary operator is also used for def which reduces conditionals. Moving the logic of looping through the object given in a helper function makes the code more efficient and readable, which should ultimately reduce complexity.

Resolving Issue #4

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10687904534

Details


Files with Coverage Reduction New Missed Lines %
src/meta/errors.js 1 76.74%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 10550029021: -0.005%
Covered Lines: 22320
Relevant Lines: 25580

💛 - Coveralls
sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud