CMU-313 / NodeBB

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

Refactor notification to reduce complexity #579

Open AliceeLe opened 2 months ago

AliceeLe commented 2 months ago

In the SonarCloud warning, the code complexity for the function Notifications.getMultiple is 16, which exceeds the threshold 15. Hence, to reduce code complexity, I modularize a segment of the code and move it into a separate function called cleanPath(notification). In doing so, I reduce the responsibility of Notifications.getMultiple, making it easier to maintain in the future.

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10730923402

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/notifications.js 16 17 94.12%
<!-- Total: 16 17 94.12% -->
Totals Coverage Status
Change from base Build 10607818019: 0.002%
Covered Lines: 22328
Relevant Lines: 25587

💛 - Coveralls
sonarcloud[bot] commented 2 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarCloud