A loop is continued early with continue, so the rest of its body runs only under conditions stated elsewhere

tx0/java:continue-statementstrictwarningstyle/conventionsdepth faststyle

What it finds

A continue skips the rest of a loop body from somewhere inside it. To know when the code after it runs, the reader has to find every continue above. An if around that code, or a method that returns early, states the condition where it applies.

From the rule's source, continue_statement.rs.

Example from the rule's tests
class Loops {  void run(int[] items) {    for (int item : items) {      if (item < 0) {        continue;tx0 reports: skips the rest      }      use(item);    }  }  void use(int item) {}}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:continue-statement" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:continue-statement] reason="..."

tx0 explain tx0/java:continue-statement shows the same in the terminal. Found a false positive? Report it.