Affects PMD Version: 7.3.0
Description:
I'm one of the lead software engineers at Salesforce who maintains the Salesforce Code Analyzer product which incorporates PMD into our product. Each month before upgrading, we run a comparison report of our tool against a large number of repos containing apex code. During this month's upgrade from PMD 7.2.0 to 7.3.0 we found a number of false negatives (violations which used to exist in 7.2.0 that no longer exist with 7.3.0). But the release notes don't account for these.
Attached is the comparison report
PMD_7_2_vs_PMD_7_3.zip
If you download and unzip this report, navigate to PMD_7_2_vs_PMD_7_3 > overall_report.html where you will fine an aggregate page that shows:
Found 435 mismatches:
* OperationWithHighCostInLoop: 2
* ApexCRUDViolation: 64
* CognitiveComplexity: 25
* UnusedLocalVariable: 67
* StdCyclomaticComplexity: 43
* AvoidDeeplyNestedIfStmts: 185
* CyclomaticComplexity: 20
* OperationWithLimitsInLoop: 8
* NcssMethodCount: 9
* AvoidLogicInTrigger: 4
* AvoidDebugStatements: 6
* DebugsShouldUseLoggingLevel: 6
* LocalVariableNamingConventions: 10
* IfElseStmtsMustUseBraces: 8
* IfStmtsMustUseBraces: 8
* EmptyStatementBlock: 5
and you can navigate down the report to the individual repo reports. For example you will see the report for https://git.soma.salesforce.com/cli-scanner/SalesforceLabsUnmanaged.git contains 13 mismatches. Clicking its report.html link you'll find it says
Found 13 mismatches:
* OperationWithHighCostInLoop: 1
* ApexCRUDViolation: 7
* CognitiveComplexity: 1
* UnusedLocalVariable: 4
It will reveal a number of violations that PMD 7.2.0 found but PMD 7.3.0 did not find. For example:
There are hundreds of these that it found. Overall, there still was over 99% match between but false negatives are something we were hoping your team could investigate further to see if these were intentional or not.
Running PMD through: CLI
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4