Back to all rules
What this rule checks
Event handler contains control flow or calls user-defined functions or instance methods
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
void mousePressed() {
  if (dist(mouseX, mouseY, x, y) < 25) {
    score++;
  }
}
FAIL — this code triggers the rule
void mousePressed() {
  x = mouseX; // no control flow or function calls
}
Overview
Category Topic Event Handling
Level Intermediate
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.HasUsefulEventHandlerRule
Message template Event handlers should contain control flow or call declared functions or instance methods