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