Open elliay opened 2 months ago
Issues
2 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/controllers/topics.js | 26 | 27 | 96.3% | ||
<!-- | Total: | 26 | 27 | 96.3% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
src/meta/errors.js | 1 | 76.74% | ||
<!-- | Total: | 1 | --> |
Totals | |
---|---|
Change from base Build 10607818019: | 0.002% |
Covered Lines: | 22335 |
Relevant Lines: | 25595 |
Refactored the getTopic function to reduce its Cognitive Complexity from 38 to the 15 allowed by splitting up the function into smaller helper functions.
This resolves #436
Helper functions added:
isInvalidRequest getUserData isAccessRestricted isTopicUnreadable handleSpecialCases needsSlugRedirect isInvalidPostIndex getSortOption getSetAndReverseOptions