Multi-label code smell Detection Method based on CodeBERT

Code smells usually hint at possible problems or design flaws in the code. Efficient code smell detection methods can significantly improve code quality. However, existing code smell detection methods rely heavily on information such as metrics and indicators, fail to make full use of the syntax and semantics of source code, and have shortcomings in multi-label code smell detection. To this end, this paper proposes a Multi-Label Code Smell Detection Based on CodeBERT (MLCSDCB) based on the pre-trained model CodeBERT. Firstly, the constructed data set is preprocessed and standardized to reduce noise interference, and the multi-label data set is constructed by the label power set method. Then, CodeBERT is used to embed the code and extract its rich syntactic and semantic information. Then, Bi-LSTM was used to fully learn the Code Representation Information [CLS] vector of each layer of CodeBERT to enhance the context understanding ability of the model. Finally, the attention mechanism was used to strengthen the key information according to the importance of each layer [CLS] vector, and the multi-label prediction was performed based on the strengthened feature vector to improve the detection effect of the model. Compared with the existing detection methods based on source code representation, MLCSDCB improves the precision, recall and F1 value by 2.02%, 1.04%and 4.75%respectively.

Authors

Institutions

Publication Details

Published
2024-09-20
DOI
https://doi.org/10.1109/eit63098.2024.10762501
Citations
3
Primary Topic
Web Application Security Vulnerabilities
Type
article
Field-Weighted Citation Impact
2.34

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Multi-label code smell Detection Method based on CodeBERT

Wei Le, H. -R. Bao
3 citations
Web Application Security Vulnerabilities
2.34
article

Multi-label code smell Detection Method based on CodeBERT

Wei Le, H. -R. Bao
article en
3 citations

Abstract

Code smells usually hint at possible problems or design flaws in the code. Efficient code smell detection methods can significantly improve code quality. However, existing code smell detection methods rely heavily on information such as metrics and indicators, fail to make full use of the syntax and semantics of source code, and have shortcomings in multi-label code smell detection. To this end, this paper proposes a Multi-Label Code Smell Detection Based on CodeBERT (MLCSDCB) based on the pre-trained model CodeBERT. Firstly, the constructed data set is preprocessed and standardized to reduce noise interference, and the multi-label data set is constructed by the label power set method. Then, CodeBERT is used to embed the code and extract its rich syntactic and semantic information. Then, Bi-LSTM was used to fully learn the Code Representation Information [CLS] vector of each layer of CodeBERT to enhance the context understanding ability of the model. Finally, the attention mechanism was used to strengthen the key information according to the importance of each layer [CLS] vector, and the multi-label prediction was performed based on the strengthened feature vector to improve the detection effect of the model. Compared with the existing detection methods based on source code representation, MLCSDCB improves the precision, recall and F1 value by 2.02%, 1.04%and 4.75%respectively.

Chengdu University of Information Technology (CN)
Research and Development
Openalex Percentile: Top 8%
Web Application Security Vulnerabilities
2.34
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Multi-label code smell Detection Method based on CodeBERT — Wei Le, H. -R. Bao · (2024) | TGRS Research Map | TGRS