Is it a bad practice to have multiple returns?

Sonar Lint rule "Methods should not be too complex" (squid:MethodCyclomaticComplexity) has an example of using more than one return statement in the program block. (see!topic/sonarqube/BtvGoF6Tw7E for the cyclormatic complexity calculation rules)The returns shortens the codes in a branch, and result with smaller code blocks. For example, int findBranchNumber(String input) { if ("branch1".equals(input)) { return 1; } if ("branch2".equals(input)) { return 2; } ...Read more