ApexSharingViolations - lpohl-Reply/pmd-github-action GitHub Wiki

Rule: ApexSharingViolations

Message

Apex classes should declare a sharing model if DML or SOQL/SOSL is used

Description

Detect classes declared without explicit sharing mode if DML methods are used. This forces the developer to take access restrictions into account before modifying objects.

Priority

1 (was 3)

Example

public without sharing class Foo {
    // DML operation here
}