Skip to content

[apex] ApexCRUDViolationRule not reporting for Database.query #2628

Open
@wollamshram

Description

@wollamshram

Affects PMD 7.0.0

Rule: ApexCRUDViolation

Description:

The ApexCRUDViolation rule does not report on potential CRUD violations if they are using the Database library to perform queries or DML, for example: Contact c = Database.query('SELECT Name FROM Contact');

The following methods are not yet considered by this rule:

  • Database.countQuery(String query)
  • Database.getQueryLocator(String query)
  • Database.query(String queryString)

See https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_database.htm for full API doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-negativePMD doesn't flag a problematic piece of code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions