Reports while loops that could be more effectively written as do-while loops. The focus is on cases where the entire body of the while loop is executed before the condition is checked, leading to potential redundancy in code execution.

Example:


  foo();
  while (x) {
      foo();
  }

Can be replaced with:


  do {
    foo();
  } while (x);

New in 2024.1