Back to all rules
What this rule checks
Performs arithmetic on a global variable (write/modify)
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
int x = 100;
void draw() {
  x = x + 2;
  ellipse(x, 200, 50, 50);
}
FAIL — this code triggers the rule
int x = 100;
void draw() {
  ellipse(x, 200, 50, 50);
  // x is never changed with arithmetic
}
Overview
Category Topic Variables
Level Basic
Type Custom Zita
Priority 1 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.GlobalVarArithmeticRule
Message template No arithmetic operations on global variables found.