CMU-313 / NodeBB

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

Refactoring code in src/meta/configs.js #585

Open tanoctavius opened 2 months ago

tanoctavius commented 2 months ago

Addresses issue, resolves #465 Instruction: Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed. (lines 19-54 for deserialize(config) function).

Original: image Cognitive Complexity of 19

Edited: image Cognitive Complexity of 7

To trigger the function: The functions defined in configs.js are utility functions that aid with type conversions and validations for configuration settings. Hence, they are automatically called during the setup/ initialization phase of NodeBB (after running ./nodebb start and ./nodebb log) to ensure that the configuration values are correctly interpreted and validated. So, it is automatic and does not need to be triggered.

image

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

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10731238995

Details


Totals Coverage Status
Change from base Build 10607818019: 0.004%
Covered Lines: 22324
Relevant Lines: 25582

💛 - Coveralls