Content-Length: 273231 | pFad | http://github.com/github/codeql/pull/19998/commits/5edb60ea04eba92465377d78d0f766ffe7cd13b5

D7 Java: Add query to detect non-case labels in switch statements by tamasvajk · Pull Request #19998 · github/codeql · GitHub
Skip to content

Java: Add query to detect non-case labels in switch statements #19998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Improve query documentation
  • Loading branch information
tamasvajk committed Jul 10, 2025
commit 5edb60ea04eba92465377d78d0f766ffe7cd13b5
4 changes: 2 additions & 2 deletions java/ql/src/Language Abuse/LabelInSwitch.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class Test {
}
```

In the example, `case2` is most likely a typo and should be fixed. For the intensional `notcaselabel`, placing the labelled code into a function and then calling that function is more readable.
In the example, `case2` is most likely a typo and should be fixed. For the intentional `notcaselabel`, placing the labelled code into a function and then calling that function is more readable.

## References

Similar to the JS CodeQL query - [js/label-in-switch](https://codeql.github.com/codeql-query-help/javascript/js-label-in-switch/).
CodeQL query help for JavaScript and TypeScript - [Non-case label in switch statement](https://codeql.github.com/codeql-query-help/javascript/js-label-in-switch/).








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/codeql/pull/19998/commits/5edb60ea04eba92465377d78d0f766ffe7cd13b5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy