Skip to content

PDTextBox.razor.js: avoid optional chaining that Codacy's PMD cannot parse - #225

Merged
davidnmbond merged 1 commit into
mainfrom
fix/pmd-textbox-optional-chaining
Oct 4, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
fix/pmd-textbox-optional-chaining

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Clears the last unexpected Codacy issue on main: PMD UnnecessaryBlock at PDTextBox.razor.js:28.

Codacy's PMD uses an old ECMAScript parser that doesn't support optional chaining. _recognition?.abort() (introduced in #224) made it misread the try block further down. Replacing it with an explicit null check behaves the same.

Checked locally with PMD 6.55 using Codacy's rules (now 0), Prettier 3 (clean) and Lizard (file complexity 20, so not "complex").

After this, main should be back to the 8 issues accepted in #223.

🤖 Generated with Claude Code

…parse

PMD's ECMAScript parser does not understand '?.' and mis-reports the following try block as an
UnnecessaryBlock. Same behaviour with an explicit null check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage ∅ diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (88591b9) 15712 15712 100.00%
Head commit (211a082) 15712 (+0) 15712 (+0) 100.00% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#225) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@davidnmbond
davidnmbond merged commit 51457ad into main Oct 4, 2026
8 checks passed
@davidnmbond
davidnmbond deleted the fix/pmd-textbox-optional-chaining branch October 4, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant