Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apex] ApexCrudViolation: False positives with new access levels #4597

Closed
yuliusmj opened this issue Jun 17, 2023 · 1 comment
Closed

[apex] ApexCrudViolation: False positives with new access levels #4597

yuliusmj opened this issue Jun 17, 2023 · 1 comment
Labels
a:false-positive PMD flags a piece of code that is not problematic needs:user-input Maintainers are waiting for feedback from author was:invalid

Comments

@yuliusmj
Copy link

Affects PMD Version:

Rule:

Please provide the rule name and a link to the rule documentation:
https://docs.pmd-code.org/latest/pmd_rules_apex_security.html#apexcrudviolation

Description:

Code Sample demonstrating the issue:

List<PatientConnect__PC_Association__c> associationList = [
			SELECT PatientConnect__PC_Program__c, PatientConnect__PC_Account__c
			FROM PatientConnect__PC_Association__c
			WITH SYSTEM_MODE
		];

Validate CRUD permission before SOQL/DML operation (rule: Security-ApexCRUDViolation)
Expected outcome:
Dont provide that validation warning
PMD reports a violation at line ..., but that's wrong. That's a false positive.

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]

@yuliusmj yuliusmj added the a:false-positive PMD flags a piece of code that is not problematic label Jun 17, 2023
@adangel adangel changed the title APEX: When the code is using the new Access level PDM is providing an alert [apex] ApexCrudViolation: False positives with new access levels Jun 24, 2023
@adangel
Copy link
Member

adangel commented Jun 24, 2023

There are two sides to this:

@adangel adangel added the needs:user-input Maintainers are waiting for feedback from author label Jun 24, 2023
@jsotuyod jsotuyod added the needs:pmd7-revalidation The issue hasn't yet been retested vs PMD 7 and may be stale label Mar 17, 2024
@jsotuyod jsotuyod added was:invalid and removed needs:pmd7-revalidation The issue hasn't yet been retested vs PMD 7 and may be stale labels Apr 2, 2024
@jsotuyod jsotuyod closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:false-positive PMD flags a piece of code that is not problematic needs:user-input Maintainers are waiting for feedback from author was:invalid
Projects
None yet
Development

No branches or pull requests

3 participants