mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Update docs/language/learn-ql/java/basic-query-java.rst
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
This commit is contained in:
@@ -107,11 +107,11 @@ Browsing the results of our basic query shows that it could be improved. Among t
|
||||
.. code-block:: java
|
||||
|
||||
if (...) {
|
||||
...
|
||||
...
|
||||
} else if (!strcmp(option, "-verbose") {
|
||||
// nothing to do - handled earlier
|
||||
// nothing to do - handled earlier
|
||||
} else {
|
||||
error("unrecognized option");
|
||||
error("unrecognized option");
|
||||
}
|
||||
|
||||
In this case, identifying the ``if`` statement with the empty ``then`` branch as redundant is a false positive. One solution to this is to modify the query to ignore empty ``then`` branches if the ``if`` statement has an ``else`` branch.
|
||||
|
||||
Reference in New Issue
Block a user