--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: simpleBranches.js --- # Input ```jsx function simpleBranches() { if (firstCondition) { // +1 return 1; } else if (secondCondition) { // +1 return 2; } else { // +1 return 3; } } ``` # Diagnostics ``` simpleBranches.js:1:10 lint/complexity/noExcessiveCognitiveComplexity ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Excessive complexity detected. > 1 │ function simpleBranches() { │ ^^^^^^^^^^^^^^ 2 │ if (firstCondition) { // +1 3 │ return 1; i Please refactor this function to reduce its complexity score from 3 to the max allowed complexity 2. ```