Back to all rules
What this rule checks
At least one local variable is read or written after declaration (Q3.6)
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);
  float d = dist(mouseX, mouseY, 200, 200);
  ellipse(200, 200, d, d);
}
FAIL — this code triggers the rule
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  float d = dist(mouseX, mouseY, 200, 200);  // d is never used
  ellipse(200, 200, 50, 50);
}
Overview
Category Topic Variables
Level Basic
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.HasLocalVarUseRule
Message template No local variable is used (read or written) after declaration.