CMU-313 / NodeBB

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

Refactored code in scr/flags.js to reduce the cognitive complexity from 27 to 15 #544

Closed zhanwen22 closed 2 months ago

zhanwen22 commented 2 months ago

In the function Flags.update located in scr/flags.js there was a cognitive complexity issue due to the overly nested code and many unnecessary if statements.

This resolves #519 with the SonarCloud issue: https://sonarcloud.io/project/issues?cleanCodeAttributeCategories=ADAPTABLE&directories=src&impactSeverities=HIGH&impactSoftwareQualities=MAINTAINABILITY&issueStatuses=OPEN%2CCONFIRMED&id=CMU-313_NodeBB&open=AZFmjARHybYwxy-_uEfu&tab=code

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

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

See analysis details on SonarCloud