Back to all rules
What this rule checks
Event variables only used inside event handler functions
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
void mousePressed() {
  targetX = mouseX;
}
FAIL — this code triggers the rule
void draw() {
  if (mouseX > 200) { } // using mouseX outside event handler
}
Overview
Category PDPS
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.DecentralizedEventHandlingRule
Message template Do not use global event variable {0} in function {1}.