Back to all rules
What this rule checks
Uses a do-while loop
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  int i = 0;
  while (i < 3) {  // a while loop checks first
    rect(i * 100 + 50, 180, 40, 40);
    i++;
  }
}
FAIL — this code triggers the rule
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  int i = 0;
  do {  // a do-while loop
    rect(i * 100 + 50, 180, 40, 40);
    i++;
  } while (i < 3);
}
Overview
Category Out of Scope
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.HasDoWhileRule
Message template A do-while loop is used.