Open fdounis 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
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/flags.js | 20 | 21 | 95.24% | ||
<!-- | Total: | 20 | 21 | 95.24% | --> |
Totals | |
---|---|
Change from base Build 10550029021: | 0.001% |
Covered Lines: | 22330 |
Relevant Lines: | 25589 |
This pull request refactors the
getFlagIdsWithFilters
function inflags.js
to address multiple concerns, including reducing Cognitive Complexity and fixing various linting errors. The following changes were made:Reduced Cognitive Complexity:
initializeFilters
function to separate concerns.buildSets
function to encapsulate the logic for constructingsets
andorSets
, improving the readability of the main function.sets
into a newgetFlagIdsFromSets
function.orSets
into two functions:getFlagIdsFromOrSets
to handle retrieval andmergeFlagIds
to handle the merging logic, reducing nested conditions and overall complexity.Fixed Linting Errors:
getFlagIdsFromOrSets
function).else
statement after areturn
, as theelse
was redundant and removed to streamline the code.This pull request resolves Issue #53