SONARJAVA-6782: Implement S9355: use Javadoc syntax for almost-Javadoc comments - #5960
Conversation
Flag comments that contain Javadoc or HTML tags but are not started with /**, so they do not document the following declaration.
|
❌ Ruling needs updating. A fix PR has been created: #5962 Please review and merge it into your branch. |
Deduplicate multi-declarator fields, ignore trailing comments and local classes, and mark the implemented quick fix as covered.
|
❌ Ruling needs updating. A fix PR has been created: #5962 Please review and merge it into your branch. |
Sanity Test crashed because QuickFixHelper.previousVariable does not support IMPLICIT_CLASS parents on compact source files. Walk class members locally instead, skip the unnamed class itself, and cover the case with a compact-source sample.
Ruling Diff SummaryDetected changes in 3 rule files: 0 issues removed, 34 issues added. S9355 (
|
Exercise the // /** quick fix and a second top-level type so compilation-unit siblings and the last convert-to-Javadoc branch are covered by tests.
The first auto-generated ruling update covered eclipse-jetty and guava only. The similar-to-main project reports the same HttpChannel/Request/ContextHandler issues and needs its own expected dump.
The combined HTML/Javadoc regex exceeded the allowed complexity of 20. Match closing HTML tags and @tags separately against a known tag set.
S2920 is not implemented in the Java analyzer, so the generated
{rule:java:S2920} link did not resolve for users.
|
Code Review ✅ ApprovedImplements the new S9355 rule to detect and convert almost-Javadoc comments using standard Javadoc syntax. No issues found. Implementation Status ✅ 1 / 1 issues implemented✅ SONARJAVA-6782 — 1 / 1 objectivesThe PR implements rule S9355 to detect almost-Javadoc comments before documentable declarations. ✅ 1 complete
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |




Summary
AlmostJavadocCheck./*comments and// ... */comments that contain Javadoc or HTML tags immediately before a documentable declaration./**.Links
AI disclosure