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
[BUG] scanner run fails with => Error (1): Attribute without value => PMD internal error => No adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup
#1439
Open
vnehess opened this issue
Apr 16, 2024
· 3 comments
Description:
When the scanner is run on a specific file in my apex source tree, the scanner will fail and exit with the following message
`
Error (1): Attribute without value
Line: 4
Column: 1
Char: >
`
I've traced this down to an invalid XML payload from the PMD engine
The problem appears to be this string returned from PMD: <pmd xmlns= \"http://pmd.sourceforge.net/report/2.0.0\" xmlns:xsi= \"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"http://pmd.sourceforge.net/report/2.0.0 http://pmd.sourceforge.net/report_2_0_0.xsd\" version= \"7.0.0\" timestamp= \"2024-04-16T14:14:33.966\" No adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup\nNo adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup\nNo adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup\n>\n<file name= \"/Users/ronhess/Repositories/PLM/src/main/default/classes/AuditTrail.cls\">\n<violation...
Note this is invalid XML because the string 'No adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup'.
does not have the form Attribute="value"
Documentation:
Please find attached the XML generated by PmdEngine.js : processStdOut() Untitled-1.txt
Steps To Reproduce:
I have a specific file that causes this (PMD) to fail when specified as the target.
A full run of all Apex class files works as expected.
Expected Behavior:
The individual file is scanned and issues are reported.
Screenshots:
Desktop:
Additional Context:
The issue does not occur for every file, only a few individual files.
My goal is to run the scanner on files changed in a Pull Request, I would like to specify only a few files on the command line.
If I run the scanner on my entire apex code base, it does work as expected, only when an individual or small group of classes is run does this failure occur.
example :
fails: sf scanner run -f html -o ~/scannerapex.html --target ./src/main/default/classes/AuditTrail.cls --category '!Documentation,!Design'
works sf scanner run -f html -o ~/scannerapex.html --target ./src/main/default/classes/ --category '!Documentation,!Design'
Workaround:
I've tried to limit the rule set reported, but that does not resolve the issue
Urgency:
prevents me from using the v4.0.0 scanner in my CI pipeline
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @vnehess and tracking down the root cause. Though this appears to be an issue on the PMD side, we should be able to handle this gracefully. I'll go ahead and create a bug for us to look into this. Thanks!
@vnehess would it be possible to narrow it down to the file that is causing the issue and then send us that file so that we can reproduce it. Then on our end, we hopefully will be able to surface this error much better.
Description:
When the scanner is run on a specific file in my apex source tree, the scanner will fail and exit with the following message
`
Error (1): Attribute without value
Line: 4
Column: 1
Char: >
`
I've traced this down to an invalid XML payload from the PMD engine
The problem appears to be this string returned from PMD:
<pmd xmlns= \"http://pmd.sourceforge.net/report/2.0.0\" xmlns:xsi= \"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"http://pmd.sourceforge.net/report/2.0.0 http://pmd.sourceforge.net/report_2_0_0.xsd\" version= \"7.0.0\" timestamp= \"2024-04-16T14:14:33.966\" No adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup\nNo adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup\nNo adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup\n>\n<file name= \"/Users/ronhess/Repositories/PLM/src/main/default/classes/AuditTrail.cls\">\n<violation...
Note this is invalid XML because the string 'No adapter exists for type com.google.summit.ast.declaration.VariableDeclarationGroup'.
does not have the form Attribute="value"
Documentation:
Please find attached the XML generated by PmdEngine.js : processStdOut()
Untitled-1.txt
Steps To Reproduce:
I have a specific file that causes this (PMD) to fail when specified as the target.
A full run of all Apex class files works as expected.
Expected Behavior:
The individual file is scanned and issues are reported.
Screenshots:
Desktop:
Additional Context:
The issue does not occur for every file, only a few individual files.
My goal is to run the scanner on files changed in a Pull Request, I would like to specify only a few files on the command line.
If I run the scanner on my entire apex code base, it does work as expected, only when an individual or small group of classes is run does this failure occur.
example :
fails:
sf scanner run -f html -o ~/scannerapex.html --target ./src/main/default/classes/AuditTrail.cls --category '!Documentation,!Design'
works
sf scanner run -f html -o ~/scannerapex.html --target ./src/main/default/classes/ --category '!Documentation,!Design'
Workaround:
I've tried to limit the rule set reported, but that does not resolve the issue
Urgency:
prevents me from using the v4.0.0 scanner in my CI pipeline
The text was updated successfully, but these errors were encountered: