Back to all rules
What this rule checks
Uses a recursive method (a method that calls itself)
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);
  noFill();
  for (float d = 300; d > 10; d = d / 2) {  // a loop shrinks the rings
    ellipse(200, 200, d, d);
  }
}
FAIL — this code triggers the rule
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  noFill();
  rings(300);
}

void rings(float d) {
  ellipse(200, 200, d, d);
  if (d > 10) {
    rings(d / 2);  // rings() calls itself
  }
}
Overview
Category Out of Scope
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.HasRecursionRule
Message template Recursive method call found.