typescript:S1763 All code should be reachable rule false positive

Hello, I’m using SonarQube - Community Edition, Version 9.1 (build 47736).

I think there is a false positive for rule typescript:S1763 | All code should be reachable.
As docs mention: “This rule ignores unreachable break statements in switch clauses”. However, my code triggers the rule:

Is it a bug or am I missing something?


Hey there.

SonarQube directly uses ESLint’s implementation of no-unreachable – and in the very latest versions of SonarQube (the only supported 9.x version is currently the latest, v9.5) we no longer include the exception about break statements in switch clauses in the rule description.

Without the exception, do you still believe it’s a false-positive?

Thanks for the reply.

Ok so it is a docs leftover bound to older versions of SonarQube. No false positive then. I tried other configurations with //NOSONAR and solving the issue, and Sonar behaved correctly.

Best regards, Thefolle.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.