Sonar Warning: Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
Explanation: There is lots of deep nesting of if and if else statements in the code, which makes it a complexity of 18. Therefore, it is important to refactor the code to accommodate it.
Method: Reduce the complexity by reducing nested conditionals
Description: Refactoring code in src/flags.js.
File name: src/flags.js.
Sonar Warning: Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed. Explanation: There is lots of deep nesting of if and if else statements in the code, which makes it a complexity of 18. Therefore, it is important to refactor the code to accommodate it. Method: Reduce the complexity by reducing nested conditionals