Back to all rules
What this rule checks
At least one event handler contains if/for/while (composed post-Zita from HasEventHandlerRule + Marker-only rule 20)
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
void keyPressed() {
  if (key == ' ') {
    paused = !paused;
  }
}
FAIL — this code triggers the rule
void keyPressed() {
  speed = 5;
  // no if/for/while inside
}
Overview
Category Topic Event Handling
Level Intermediate
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Message template No event handler contains a for loop or if statement.