This rule is defined by the following XPath expression:
//VariableDeclaratorId[string-length(@Image) < 3] [not(ancestor::ForInit)] [not((ancestor::FormalParameter) and (ancestor::TryStatement))]
Example:
public class Something { private int q = 15; // VIOLATION - Field public static void main( String as[] ) { // VIOLATION - Formal int r = 20 + q; // VIOLATION - Local for (int i = 0; i < 10; i++) { // Not a Violation (inside FOR) r += q; } } }