CMU-17313Q / NodeBB

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

Refactored from 17 to 15 in cognitive complexity src/categories/create.js #45

Open lhitmi opened 2 months ago

lhitmi commented 2 months ago

This refactor introduces a local variable cloneFromCid to store the parsed integer value, reducing redundant parseInt calls. The if condition is now only checks cloneFromCid, which handles invalid cases due to parseInt returning NaN for non-numeric strings. This overall reduces the cognitive complexity from 17 to 15. Resolves #25

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10673316856

Details


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

💛 - 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