Source code vulnerabilities pose a serious threat to software development, with reported Common Vulnerabilities and Exposures exceeding 25,000 entries per year, making manual inspection unscalable. This study aims to evaluate and compare four deep learning architectures for automated source code vulnerability detection: Convolutional Neural Network, Bidirectional Long Short-Term Memory, CodeBERT, and GraphCodeBERT, and to measure CodeBERT's ability to classify eight types of Common Weakness Enumeration. The research method uses a quantitative experimental approach with 43,164 C and C++ functions derived from the combined BigVul and CVEfixes datasets. The data were processed through comment cleaning, MD5 hash-based deduplication to prevent data leakage, and class balancing with a one-to-three ratio. The datasets were then divided into training, validation, and test datasets. In addition to conventional metrics such as accuracy, precision, recall, F1-score, and AUC-ROC, this study applies a Vulnerability Detection Score, which measures the proportion of missed vulnerabilities at a false positive rate below zero point five percent. The results showed that CodeBERT achieved the best performance with an F1-score of 0.702, an AUC-ROC of 0.896, and a Vulnerability Detection Score of 0.857, outperforming the baseline model, which only achieved an F1-score of around 0.64. However, all models recorded high Vulnerability Detection Scores in the range of 0.857 to 0.906, meaning that approximately 86 percent of vulnerabilities were still missed under realistic operating conditions. The eight-class Common Weakness Enumeration classification only achieved a macro-F1 of 0.28. This study concluded that conventional metrics tend to overestimate the model's readiness for real-world deployment.
Copyrights © 2026