Open zhanwen22 opened 2 months ago
Totals | |
---|---|
Change from base Build 10607818019: | 0.001% |
Covered Lines: | 22325 |
Relevant Lines: | 25584 |
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
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 was fixed by breaking down a big function into smaller functions and reducing or statements, ultimately leading to cleaner code.
Edit to add: TA told me that my coverage was ok, because it was from a file that I did not work on. So I reverted my test cases to the original ones, because that caused the least SonarCloud errors.
This resolves https://github.com/CMU-313/NodeBB/issues/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