arrow
Return

Detecting Inline Code Comment Smells Leveraging CodeBERT Model

delete2026-02-20
delete0
delete
OA
AI
S
Sajjad Mahmood
DOI:10.1109/ACCESS.2026.3666288delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Inline code comments provide contextual information within source code, potentially enhancing readability and maintainability. However, suboptimal commenting practices, commonly referred to as comment smells, can obscure code intent, reduce maintainability, and increase the likelihood of defects. Automated detection of these smells remains challenging due to their diverse manifestations and the interplay between code and natural language. In this paper, we present a model that leverages CodeBERT embeddings to detect and classify multiple types of inline comment smells. The method incorporates systematic preprocessing of code comment pairs, class balancing to mitigate skewed label distributions, and contextual representation learning to capture semantic and syntactic aspects of the code. The proposed approach is evaluated on a publicly available benchmark dataset comprising 2,189 manually annotated code–comment pairs extracted from open-source Java and Python projects. Evaluation on a benchmark dataset shows that CodeBERT consistently outperforms traditional machine/deep learning classifiers in accuracy and Matthews Correlation Coefficient (MCC), establishing a new state-of-the-art for multi-class comment-smell detection. These results demonstrate the effectiveness of pre-trained, code-aware language models for detecting inline comment smells in a software project. These findings highlight the promise of code-aware transformer models for automated assessment of inline comment quality in real-world software systems.
Keywords:
Inline code comments
comment smells
automated detection
CodeBERT embeddings
Taxonomy of inline code comment smells
err2024-04-03
err1
errOAAI
errJabrayilzade, Elgun; Yurtoglu, Ayda; Tuzun, Eray
errShare
errSave
A Comparative Study on Method Comment and Inline Comment
err2023-07-22
err8
errOAAI
errHuang, Yuan; Guo, Hanyang; Ding, Xi; Shu, Junhuai; Chen, Xiangping; Luo, Xiapu; Zheng, Zibin; Zhou, Xiaocong
errShare
errSave
Just-In-Time Obsolete Comment Detection and Update
err2023-01-01
err11
errOAAI
errLiu, Zhongxin; Xia, Xin; Lo, David; Yan, Meng; Li, Shanping
errShare
errSave
RepliComment: Identifying clones in code comments
err2021-12-01
err2
errOAAI
errBlasi, Arianna; Stulova, Nataliia; Gorla, Alessandra; Nierstrasz, Oscar
errShare
errSave
CCISolver: End-to-End Detection and Repair of Method-Level Code-Comment Inconsistency
err2026-08-06
err0
PREAI
errRenyi Zhong; Yintong Huo; Wenwei Gu; Jinxi Kuang; Zhihan Jiang; Guangba Yu; Yichen Li; David Lo; Michael R. Lyu
errShare
errSave
An alternative to code comment generation? Generating comment from bytecode
err2025-03-01
err0
PREAI
errChen, Xiangping; Chen, Junqi; Lian, Zhilu; Huang, Yuan; Zhou, Xiaocong; Wu, Yunzhi; Zheng, Zibin
errShare
errSave

Journal

IEEE Access cover
IEEE Access
IF:
3.6
Papers:
10.1W
Citations:
36.3W

Organization

K
King Fahd University of Petroleum and Minerals
Scholars:
1.6K
Papers: 693
Citations: 796
Cited Papers

Cited Papers

Classifying code comments in Java software systems
err2019-04-26
err34
errOAAI
errPascarella, Luca; Bruntink, Magiel; Bacchelli, Alberto
errShare
errSave
On the Significance of Category Prediction for Code-Comment Synchronization
err2023-03-29
err22
PREAI
errYang, Zhen; Keung, Jacky Wai; Yu, Xiao; Xiao, Yan; Jin, Zhi; Zhang, Jingyu
errShare
errSave
Analyzing APIs Documentation and Code to Detect Directive Defects
err2017-05-01
err0
PREAI
errYu Zhou; Ruihang Gu; Taolue Chen; Zhiqiu Huang; Sebastiano Panichella; Harald Gall
errShare
errSave
A Comparative Study on Method Comment and Inline Comment
err2023-07-22
err8
errOAAI
errHuang, Yuan; Guo, Hanyang; Ding, Xi; Shu, Junhuai; Chen, Xiangping; Luo, Xiapu; Zheng, Zibin; Zhou, Xiaocong
errShare
errSave
Taxonomy of inline code comment smells
err2024-04-03
err1
errOAAI
errJabrayilzade, Elgun; Yurtoglu, Ayda; Tuzun, Eray
errShare
errSave
errShare
errSave
Automatic model generation from documentation for Java API functions
err2016-05-14
err0
errOAAI
errJuan Zhai; Jianjun Huang; Shiqing Ma; Xiangyu Zhang; Lin Tan; Jianhua Zhao; Feng Qin
errShare
errSave
researcher View more