# VM Rules

Index of all built-in rules available for VM

## Best Practices

Rules which enforce generally accepted best practices.

- AvoidReassigningParameters: Reassigning values to incoming parameters is not recommended. Use temporary local variables inst…
- UnusedMacroParameter: Avoid unused macro parameters. They should be deleted.

## Design

Rules that help you discover design issues.

- AvoidDeeplyNestedIfStmts: Avoid creating deeply nested if-then statements since they are harder to read and error-prone to …
- CollapsibleIfStatements: Sometimes two consecutive ‘if’ statements can be consolidated by separating their conditions with…
- ExcessiveTemplateLength: The template is too long. It should be broken up into smaller pieces.
- NoInlineJavaScript: Avoid inline JavaScript. Import .js files instead.
- NoInlineStyles: Avoid inline styles. Use css classes instead.

## Error Prone

Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.

- EmptyForeachStmt: Empty foreach statements should be deleted.
- EmptyIfStmt: Empty if statements should be deleted.

## Additional rulesets

- Basic Velocity (`rulesets/vm/basic.xml`):

  Deprecated This ruleset is for backwards compatibility.

  It contains the following rules:

  AvoidDeeplyNestedIfStmts, AvoidReassigningParameters, CollapsibleIfStatements, EmptyForeachStmt, EmptyIfStmt, ExcessiveTemplateLength, NoInlineJavaScript, NoInlineStyles, UnusedMacroParameter

Tags: rule_references