You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Yes. I use default ruleset's override based on apex_ruleset as linked in readme. I noticed the plugin doesn't report Database.query(), Database.insert() etc variants of SOQL/DML in a loop. Ruleset wasn't modified since March 2020.
If you run PMD 6.49.0 from commandline - it emits warnings.
WARNING: Discontinue using Rule name category/apex/performance.xml/AvoidSoqlInLoops as it is scheduled for removal from PMD.
PMD 7.0.0 will remove support for this Rule. (...)
AvoidSoslInLoops (...)
AvoidDmlStatementsInLoops (...)
VariableNamingConventions (...)
replacing the 3 performance rules with category/apex/performance.xml/OperationWithLimitsInLoop correctly detects the Database.query()
Describe the solution you'd like
update your apex_ruleset.xml. Maybe use quickstart.xml, the "ruleset.xml" in same directory is deprecated
Additional context
I'd like this file to count as 4 performance problems even on vanilla installation
public with sharing class PmdDemo {
public void thisWorksAsExpected() {
for(Integer i = 0; i < 10; ++i){
List<Account> accs = [SELECT Id FROM Account WITH SECURITY_ENFORCED LIMIT 10];
insert new Task();
}
}
public void makeThisWorkToo() {
for(Integer i = 0; i < 10; ++i){
List<Account> accs = Database.query('SELECT Id FROM Account WITH SECURITY_ENFORCED LIMIT 10');
Database.insert(new Task());
}
}
}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Yes. I use default ruleset's override based on apex_ruleset as linked in readme. I noticed the plugin doesn't report
Database.query(), Database.insert()
etc variants of SOQL/DML in a loop. Ruleset wasn't modified since March 2020.If you run PMD 6.49.0 from commandline - it emits warnings.
replacing the 3 performance rules with
category/apex/performance.xml/OperationWithLimitsInLoop
correctly detects theDatabase.query()
Describe the solution you'd like
Additional context
I'd like this file to count as 4 performance problems even on vanilla installation
The text was updated successfully, but these errors were encountered: