**AST evidence:** `ModifierNode` has `@WithSharing`, `@WithoutSharing`, `@InheritedSharing` — all `false()` means no sharing keyword declared (implicit without sharing in API versions 66.0 and below. In API versions 67.0 and higher, the default changes to implicit with sharing).
Added `@Nested = false()` to exclude inner classes (which inherit from parent).
> ⚠️ **PMD 7 boolean attributes:** `@WithSharing`, `@WithoutSharing`, `@InheritedSharing`, and `@Nested` are boolean-typed in PMD 7 — string comparison (`='false'`) errors with "Cannot compare xs:boolean to xs:string". Always use `= false()` / `= true()`. See [xpath-patterns.md](xpath-patterns.md) for the full list.
### SOQL without WITH USER_MODE or SECURITY_ENFORCED
```xpath
//SoqlExpression[
not(contains(@CanonicalQuery, 'WITH USER_MODE'))
and not(contains(@CanonicalQuery, 'WITH SECURITY_ENFORCED'))
**Note:** `matches()` function may not be available in all PMD XPath versions. The string-length check catches most cases. For precision, use Regex engine instead.