Rules
All 128 rules by topic, level, and category
128 rules
Getting Started (5)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| DoesItBuildRule | Basic | Custom | Enabled | Sketch parses into a valid syntax tree (aliased from ProcessingJavaBuildRule; no compilation — processing-java is not run) |
| Has2DShapesRule | Basic | Custom | Enabled | Uses 2+ shape functions, e.g. rect(), ellipse(), line() |
| HasDrawRule | Basic | Custom | Enabled | Defines a void draw() function |
| HasSetupRule | Basic | Custom | Enabled | Defines a void setup() function |
| HasStandardProcessingStructure | Basic | Custom | Enabled | Defines both void setup() and void draw() with correct signatures |
Variables (15)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| GlobalVarArithmeticRule | Basic | Custom | Enabled | Performs arithmetic on a global variable (write/modify) |
| GlobalVarDeclRule | Basic | Custom | Enabled | Declares at least one global (main-tab) variable |
| GlobalVarInitRule | Basic | Custom | Enabled | Declares at least one global variable with an initializer (e.g. int score = 0, not just int score) |
| GlobalVarUsageRule | Basic | Custom | Enabled | Reads (uses) at least one global variable somewhere in the sketch |
| HasLocalVarDeclRule | Basic | Custom | Enabled | At least one local variable is declared (Q3.5) — distinct from fields |
| HasLocalVarUseRule | Basic | Custom | Enabled | At least one local variable is read or written after declaration (Q3.6) |
| LocalVarArithmeticRule | Basic | Custom | Enabled | Performs arithmetic on a local variable |
| LocalVarInitRule | Basic | Custom | Enabled | Declares at least one local variable with an initializer |
| FieldNamingConventions | Intermediate | Built-in | Enabled | Field names follow lowerCamelCase |
| LocalVariableNamingConventions | Intermediate | Built-in | Enabled | Local variable names follow lowerCamelCase |
| LongVariable | Intermediate | Built-in | Enabled | Variable names not too long (max 17 chars) |
| PixelHardcodeIgnoranceRule | Intermediate | Custom | Enabled | Drawing calls use variables instead of hardcoded pixel values |
| IdempotentOperations | Advanced | Built-in | Enabled | No redundant operations |
| UnusedAssignment | Advanced | Built-in | Enabled | No unused assignments |
| UnusedLocalVariable | Advanced | Built-in | Enabled | No unused local variables |
Conditionals (12)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| HasConditionsRule | Basic | Custom | Enabled | Uses at least two if statements (else-if counts) |
| HasIfWithBooleanOperatorRule | Basic | Custom | Enabled | An if (or else-if) condition uses && or || (! alone does not count) |
| HasNoBooleanOperatorRule | Basic | Custom | Enabled | Uses && or || somewhere in the sketch (not necessarily in an if condition; ! does not count) |
| HasNoElseStatementRule | Basic | Custom | Enabled | Uses else or else-if branching |
| ControlStatementBraces | Intermediate | Built-in | Enabled | Control statements use braces |
| SimplifyBooleanExpressions | Intermediate | Built-in | Enabled | Boolean expressions can be simplified |
| SimplifyBooleanReturns | Intermediate | Built-in | Enabled | Boolean returns can be simplified |
| SimplifyConditional | Intermediate | Built-in | Enabled | No null check before instanceof (instanceof is already false for null) |
| AssignmentInOperand | Advanced | Built-in | Enabled | No assignments inside expressions |
| AvoidDeeplyNestedIfStmts | Advanced | Built-in | Enabled | Avoids deeply nested conditionals (3+ levels) |
| CollapsibleIfStatements | Advanced | Built-in | Enabled | Nested ifs can be collapsed |
| UnconditionalIfStatement | Advanced | Built-in | Enabled | No always-true/false conditions |
Iteration (5)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| HasLoopRule | Basic | Custom | Enabled | Uses a loop |
| HasModuloOperatorRule | Basic | Custom | Enabled | Uses the modulo operator |
| AvoidReassigningLoopVariables | Intermediate | Built-in | Enabled | Loop variables not reassigned in body |
| ForLoopVariableCount | Intermediate | Built-in | Enabled | For-loop declares only one control variable |
| HasLoopCounterUseRule | Intermediate | Custom | Enabled | A for loop uses its counter variable inside the loop body (e.g. print(i)) |
Functions (8)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| HasUserDefinedMethod | Basic | Custom | Enabled | Defines a function or class method of their own (top-level Processing callbacks like setup()/draw() don't count) |
| AvoidReassigningParameters | Intermediate | Built-in | Enabled | Function parameters not reassigned |
| FormalParameterNamingConventions | Intermediate | Built-in | Enabled | Parameter names follow lowerCamelCase |
| HasReturnOrParamCallableRule | Intermediate | Custom | Enabled | Has a function or class method that returns a value or takes a parameter (composed post-Zita from Marker-only rule 25 + Marker-only rule 28) |
| MethodNamingConventions | Intermediate | Built-in | Enabled | Function names follow lowerCamelCase |
| ShortMethodName | Intermediate | Built-in | Enabled | Function names not too short (min 3 chars) |
| ExcessiveParameterList | Advanced | Built-in | Enabled | Function parameter count within limits |
| HasParamNonVoidCallableRule | Advanced | Custom | Enabled | Has a top-level function or a class method that both takes a parameter and returns a value (composed post-Zita from Marker-only rule 29 + Marker-only rule 30) |
Classes (16)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| ClassCallsDrawMethodRule | Basic | Custom | Enabled | An inner class method calls a drawing function |
| ConstructorUsesParamRule | Basic | Custom | Enabled | A constructor takes a parameter and uses it |
| HasClassWithConstructorRule | Basic | Custom | Enabled | At least one user-defined class has an explicit constructor |
| HasUserDefinedClass | Basic | Custom | Enabled | Defines a custom class |
| HasUserDefinedConstructor | Basic | Custom | Enabled | Every user-defined class declares its own constructor |
| UsingUserDefinedClass | Basic | Custom | Enabled | Every user-defined class is created with new somewhere in the sketch |
| ClassAttrDeclRule | Intermediate | Custom | Enabled | A user-defined class declares at least one attribute (field) |
| ClassAttrInitRule | Intermediate | Custom | Enabled | A user-defined class declares an attribute with an initializer |
| ClassAttrModifyRule | Intermediate | Custom | Enabled | An attribute of a user-defined class is changed somewhere in the sketch (in the class or through an object) |
| ClassAttrUseRule | Intermediate | Custom | Enabled | An attribute of a user-defined class is read somewhere in the sketch (in the class or through an object) |
| ClassNamingConventions | Intermediate | Built-in | Enabled | Class names follow UpperCamelCase |
| MultipleInstantiationRule | Intermediate | Custom | Enabled | A user-defined class is instantiated more than once (a new inside a loop counts as several; an array allocation such as new Ball[3] does not) |
| AvoidFieldNameMatchingTypeName | Advanced | Built-in | Enabled | No field named after the class it's in (e.g. a field score in class Score) |
| HasObjectMethodCallRule | Advanced | Custom | Enabled | A method is called on an object of a user-defined class (e.g. ball.move()) |
| HasObjectMethodCallWithArgRule | Advanced | Custom | Enabled | A method is called with at least one argument on an object of a user-defined class (e.g. ball.moveBy(10)) |
| MethodWithSameNameAsEnclosingClass | Advanced | Built-in | Enabled | Method name differs from its class name |
Arrays (13)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| ArrayIndexForLoopRule | Basic | Custom | Enabled | Iterates an array with an index-based for loop (alias of HasArrayIndexForLoop, copied post-Zita) |
| ArrayInitRule | Basic | Custom | Enabled | Creates an array when declaring it, e.g. new int[5], {1, 2, 3} or new Ball[3] (composed post-Zita from Marker-only rule 6 / ArrayUserInitRule) |
| ArrayModifyRule | Basic | Custom | Enabled | Writes to an array element, e.g. scores[i] = 10 or balls[i] = new Ball() (composed post-Zita from Marker-only rule 7 / ArrayUserModifyRule) |
| ArrayUseRule | Basic | Custom | Enabled | Reads an array element, e.g. ellipse(xs[i], 50, 5, 5) or balls[i].show() (composed post-Zita from Marker-only rule 8 / ArrayUserUseRule) |
| HasArrayDeclRule | Basic | Custom | Enabled | At least one array is declared (Q6.2) |
| ArrayLoopAggregateRule | Intermediate | Custom | Enabled | A for loop folds array elements into a variable declared outside the loop (e.g. sum = sum + a[i]) |
| ArrayLoopUpdateRule | Intermediate | Custom | Enabled | A for loop writes to an array element indexed by its counter (e.g. a[i] = 10) |
| HasArrayIndexForLoop | Intermediate | Custom | Enabled | Iterates an array with an index-based for loop |
| ArrayLoopSelfUpdateRule | Advanced | Custom | Enabled | A for loop updates an array element from its own array (e.g. a[i] = a[i] + 1, a[i] += 5, a[i]++) |
| ArrayParameterLoopRule | Advanced | Custom | Enabled | A method loops over an array it received as a parameter |
| ArrayUserInitRule | Advanced | Custom | Enabled | Declares an array of a user-defined class with an initializer (e.g. Ball[] balls = new Ball[3]) |
| ArrayUserModifyRule | Advanced | Custom | Enabled | Writes to an element of a user-defined-class array (e.g. balls[0] = new Ball()) |
| ArrayUserUseRule | Advanced | Custom | Enabled | Reads an element of a user-defined-class array (e.g. balls[0].show()) |
Event Handling (4)
| Rule | Level | Type | Status | Description |
|---|---|---|---|---|
| HasEventHandlerRule | Basic | Custom | Enabled | Defines an event handler |
| EventHandlerNoControlFlowRule | Intermediate | Custom | Enabled | At least one event handler contains if/for/while (composed post-Zita from HasEventHandlerRule + Marker-only rule 20) |
| HasUserCallInsideEHRule | Intermediate | Custom | Enabled | At least one event handler calls a user-declared method (Q5.3) |
| UsefulEventHandlerRule | Intermediate | Custom | Enabled | Event handler contains control flow or calls user-defined functions or instance methods |
PDPS — Program Design (15)
| Rule | Type | Status | Description |
|---|---|---|---|
| AllFunctionsUsedRule | Custom | Enabled | Every declared top-level function is called somewhere in the sketch |
| CognitiveComplexity | Built-in | Enabled | Code cognitive complexity within limits (threshold: 10) |
| DecentralizedDrawStateRule | Custom | Enabled | State-setting functions not called from event handlers |
| DecentralizedDrawingRule | Custom | Enabled | No drawing functions called inside setup() — drawing belongs in draw() |
| DecentralizedEventHandlingRule | Custom | Enabled | Event variables only used inside event handler functions |
| GodClassRule | Custom | Enabled | No single class has too many responsibilities (composed post-Zita from Marker-only rule 35 + Marker-only rule 34 + Marker-only rule 37) |
| HardcodedArrayRule | Custom | Enabled | An array is initialized entirely with hardcoded literal or constructor values |
| HasOverloadedBuiltinMethodRule | Custom | Enabled | A user-declared method shares its name with a Processing built-in function |
| LongMethodRule | Custom | Enabled | No function with more than 50 statements |
| LongParameterListRule | Custom | Enabled | Parameter list within limits (5) |
| ManualLifecycleCallRule | Custom | Enabled | Calls setup() or draw() manually instead of letting Processing drive the lifecycle |
| OutOfScopeStateChangeRule | Custom | Enabled | No class assigns to a global variable from the main tab |
| ReservedMethodInClassRule | Custom | Enabled | A user-defined class declares a method named setup(), draw(), or settings() |
| StatelessClassRule | Custom | Enabled | Classes declare fields |
| UnusedVariableRule | Custom | Enabled | A declared variable is never referenced |
Outside Unit Scope (28)
| Rule | Type | Status | Description |
|---|---|---|---|
| AdvancedProcessingFunctionRule | Custom | Enabled | Uses advanced Processing functions |
| HasAbstractClassOrInterfaceRule | Custom | Enabled | Declares an abstract class or interface |
| HasAccessModifierRule | Custom | Enabled | Uses access modifiers |
| HasArrayListRule | Custom | Enabled | Uses ArrayList |
| HasBeginEndShapeRule | Custom | Enabled | Uses beginShape()/endShape()/vertex() for custom shapes |
| HasBezierRule | Custom | Enabled | Uses bezier curves (bezier(), bezierVertex(), etc.) |
| HasBitwiseOperatorRule | Custom | Enabled | Uses a bitwise operator (&, |, ^, <<, >>, >>>) |
| HasBreakContinueRule | Custom | Enabled | Uses break or continue (a break inside a switch doesn't count) |
| HasCastRule | Custom | Enabled | Uses an explicit type cast |
| HasClassUsageRule | Custom | Enabled | Uses a Java library class such as ArrayList, HashMap, Math or Color (PVector excluded) |
| HasDoWhileRule | Custom | Enabled | Uses a do-while loop |
| HasFinalVariableRule | Custom | Enabled | Uses final variable declarations |
| HasForEachLoopRule | Custom | Enabled | Uses a for-each loop |
| HasGenericsRule | Custom | Enabled | Uses a generic type argument (e.g. List<Integer>) |
| HasImportStatementRule | Custom | Enabled | Uses import statements |
| HasInheritanceRule | Custom | Enabled | Uses inheritance via extends |
| HasIntegerConstantsRule | Custom | Enabled | Uses Integer.MAX_VALUE or Integer.MIN_VALUE |
| HasNoiseRule | Custom | Enabled | Uses noise()/noiseSeed()/noiseDetail() for Perlin noise |
| HasPVectorRule | Custom | Enabled | Uses Processing's PVector class (declaration, parameter, new, or static call) |
| HasPushPopMatrixRule | Custom | Enabled | Uses pushMatrix()/popMatrix() for coordinate transformations |
| HasRecursionRule | Custom | Enabled | Uses a recursive method (a method that calls itself) |
| HasRotateRule | Custom | Enabled | Uses rotate() for coordinate transformations |
| HasSettingsMethodRule | Custom | Enabled | Declares a settings() method |
| HasShapeMethodRule | Custom | Enabled | Uses shape(), loadShape() or createShape() to work with PShape objects |
| HasSwitchRule | Custom | Enabled | Uses a switch statement |
| HasTernaryOperatorRule | Custom | Enabled | Uses the ternary operator |
| HasTripleNestedClassRule | Custom | Enabled | Has triple-nested classes |
| ThisKeywordUsageRule | Custom | Enabled | Uses the this keyword |
Academic Integrity (6)
| Rule | Type | Status | Description |
|---|---|---|---|
| HasCitationCommentsRule | Custom | Enabled | Flags [cite: N] markers left in comments by AI tools like Perplexity — strong indicator that code was generated, not written |
| HasDecorativeSectionCommentsRule | Custom | Enabled | Flags elaborate ASCII dividers (--------, ========, ********) in comments — common in AI output but rarely written by first-year students |
| HasMarkdownArtifactsRule | Custom | Enabled | Flags backticks or markdown code fences in .pde files — indicates code was pasted from ChatGPT or similar tools |
| HasPlaceholderAuthorRule | Custom | Enabled | Flags unfilled author placeholders ([Your Name], TODO: add name) — suggests the student pasted AI-generated code without personalising it |
| HasRandomDirectionPatternRule | Custom | Enabled | Flags random(1) == 0 ? 1 : -1 — a pattern students almost never write but AI tools generate frequently for random movement |
| SingleFileSubmissionRule | Custom | Enabled | Flags submissions with classes defined in a single .pde file — AI tools typically generate everything in one file |
Standalone (1)
| Rule | Type | Status | Description |
|---|---|---|---|
| HasHeaderCommentRule | Custom | Enabled | Has a comment, anywhere in the sketch, matching a configurable pattern (default: any URL) |