Description
Is your feature request related to a problem? Please describe
CodeAnalyzer lacks comprehensive comment analysis capabilities. Current implementation:
- Doesn't distinguish between LINE/BLOCK/JAVADOC comments
- Has fragmented comment associations across different nodes
- Missing orphaned comments
- No JavaDoc structure validation
Describe the solution you'd like
Add Comment
class:
@Data
public class Comment {
private String content;
private CommentType type;
private Location location;
private String commentedNodeType;
private boolean isOrphan;
@Getter
@AllArgsConstructor
public enum CommentType {
LINE,
BLOCK,
JAVADOC
}
public boolean isJavadoc() {
return type == CommentType.JAVADOC;
}
public boolean isBlockComment() {
return type == CommentType.BLOCK;
}
public boolean isLineComment() {
return type == CommentType.LINE;
}
public void validateJavadoc() {
if (isJavadoc()) {
// JavaDoc validation logic
}
}
}
Update models to use centralized comment handling:
- Replace individual comment fields with
comments: List[JComment]
- Add JavaDoc validation
- Track comment-node relationships
Describe alternatives you've considered
- Keep current distributed comment model - Less consistent
- Parse comments as plain text - Loses structural information
- Store only JavaDoc comments - Misses important inline documentation
Additional context
JavaParser provides comment classification and node association capabilities that can be leveraged for implementation.