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
The "Throwable" that is caught is on line 13, the catch block is lines 13-15. It seems that this rule reports begin line 13 and end line 15 and GitHub annotates line 15.
There are other rules with similar problems (list is incomplete!)
Describe the solution you'd like
The test framework currently can check the begin line (expected-linenumbers). It should be enhanced, so that end line can also be verified.
Then all rules should be reviewed, test cases should be updated and the rules should be corrected.
Describe alternatives you've considered
I thought about changing pmd-github-action to pass only begin-line or pass begin-line as end-line, so that the annotations appear on the "correct" line. However, I think, GitHub made a sensible decision to use the end-line and display the annotation at the end. This makes sense, if the violation actually applies to a whole block. So, I'd rather fix the rules than workaround how GitHub works.
Activity
adangel commentedon Feb 22, 2022
See also #730
UncleOwen commentedon Sep 6, 2025
See also #5906 #5905 #5904 #5669 #5668 #5614 #5613 for [apex]