# RioCC: Efficient and Accurate Class-Level Code Recommendation Based on Deep Code Clone Detection

**Authors:** Hongcan Gao, Chenkai Guo, Hui Yang

PMC · DOI: 10.3390/e28020223 · 2026-02-14

## TL;DR

RioCC is a new framework for recommending code classes efficiently by using deep learning to detect code clones and narrow down options.

## Contribution

RioCC introduces a two-stage code recommendation system using deep forest-based clone detection for class-level recommendations.

## Key findings

- RioCC outperforms existing methods in code clone detection accuracy and recommendation efficiency.
- The two-stage design effectively balances speed and accuracy in large-scale code spaces.
- Experiments show RioCC works well across four types of code clones.

## Abstract

Context: Code recommendation plays an important role in improving programming efficiency and software quality. Existing approaches mainly focus on method- or API-level recommendations, which limits their effectiveness to local code contexts. From a multi-stage recommendation perspective, class-level code recommendation aims to efficiently narrow a large candidate code space while preserving essential structural information. Objective: This paper proposes RioCC, a class-level code recommendation framework that leverages deep forest-based code clone detection to progressively reduce the candidate space and improve recommendation efficiency in large-scale code spaces. Method: RioCC models the recommendation process as a coarse-to-fine candidate reduction procedure. In the coarse-grained stage, a quick search-based filtering module performs rapid candidate screening and initial similarity estimation, effectively pruning irrelevant candidates and narrowing the search space. In the fine-grained stage, a deep forest-based analysis with cascade learning and multi-grained scanning captures context- and structure-aware representations of class-level code fragments, enabling accurate similarity assessment and recommendation. This two-stage design explicitly separates coarse candidate filtering from detailed semantic matching to balance efficiency and accuracy. Results: Experiments on a large-scale dataset containing 192,000 clone pairs from BigCloneBench and a collected code pool show that RioCC consistently outperforms state-of-the-art methods, including CCLearner, Oreo, and RSharer, across four types of code clones, while significantly accelerating the recommendation process with comparable detection accuracy. Conclusions: By explicitly formulating class-level code recommendation as a staged retrieval and refinement problem, RioCC provides an efficient and scalable solution for large-scale code recommendation and demonstrates the practical value of integrating lightweight filtering with deep forest-based learning.

## Full-text entities

- **Diseases:** RioCC (MESH:C536318), injury to (MESH:D014947), AST (MESH:D021184), crash (MESH:C536029), LLMs (MESH:D007806)
- **Chemicals:** Gemini-Pro-1.0 (-)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12939927/full.md

---
Source: https://tomesphere.com/paper/PMC12939927