Back to all rules
What this rule checks
No drawing functions called inside setup() — drawing belongs in draw()
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);  // the drawing all happens in draw()
  fill(0, 0, 255);
  ellipse(mouseX, mouseY, 30, 30);
}
FAIL — this code triggers the rule
void setup() {
  size(400, 400);
  rect(0, 380, 400, 20);  // drawing a shape inside setup()
}

void draw() {
  ellipse(mouseX, mouseY, 30, 30);
}
Overview
Category PDPS
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.DecentralizedDrawingRule
Message template Do not use drawing function {0} in function {1}.