GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [apex] ApexCRUDViolation doesn't report SOQL for loops · Issue #3329 · pmd/pmd

[apex] ApexCRUDViolation doesn't report SOQL for loops #3329

New issue
Copy link
New issue
Copy link
Closed
#3367
Closed
[apex] ApexCRUDViolation doesn't report SOQL for loops#3329
#3367
Copy link
Labels
a:false-negativePMD doesn't flag a problematic piece of code
Milestone
6.37.0

Description

@jonathanwiesel
jonathanwiesel
opened on Jun 9, 2021
Issue body actions

Affects PMD Version:
5.5.3 - 6.35.0

Rule:
ApexCRUDViolation

Description:

When using SOQL For loops the CRUD check seems to be not enforced

Code Sample demonstrating the issue:

// won't report it
for (Account acc : [SELECT Id FROM Account]) {
  //whatever
}

// will report it
Account[] accs = [SELECT Id FROM Account];

Expected outcome:

PMD should report a violation at line 1, but doesn't. This is a false-negative.

Running PMD through: Apex PMD VSCode Plugin

Activity

  1. jonathanwiesel
    added
    a:false-negativePMD doesn't flag a problematic piece of code
    on Jun 9, 2021
  2. adangel
    added this to the 6.37.0 milestone on Jul 2, 2021
  3. adangel
    added a commit that references this issue on Jul 2, 2021

    [doc] Update release notes (#3329, #3367)

    94a16e3
  4. adangel
    closed this as completedin #3367on Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      • 6.37.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.