Open ilong4rennes opened 2 months ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
src/meta/errors.js | 1 | 76.74% | ||
<!-- | Total: | 1 | --> |
Totals | |
---|---|
Change from base Build 10607818019: | -0.005% |
Covered Lines: | 22323 |
Relevant Lines: | 25583 |
This PR refactors the post deletion logic in
public/src/client/topic/delete-posts.js
to reduce function nesting and improve readability. Specifically, I added a helper function to reduce nest functions more than 4 levels deep.It resolves SonarCloud warnings about function complexity and ensures code simplicity.
Resolves #510 (https://github.com/CMU-313/NodeBB/issues/510)
(P.S. Below, the code coverage decreased by 0.005%. The reduction in code coverage is unrelated to my changes. It occurred due to a missed line in the file
src/meta/errors.js
, which I did not modify. The coverage decrease is a result of this file not being fully tested during the current test run, even though my code changes were fully covered.)(P.P.S. The modifications in
public/src
don't require additional tests because they primarily involve interaction with the frontend UI, such as handling user actions like deleting posts. These changes rely on browser behavior, event triggers, which are better tested through manual UI testing (e.g.,seeing log messages through developer tools) rather than unit tests. )