Table of Contents
Fetching ...

CodeFuse-Query: A Data-Centric Static Code Analysis System for Large-Scale Organizations

Xiaoheng Xie, Gang Fan, Xiaojun Lin, Ang Zhou, Shijie Li, Xunjin Zheng, Yinan Liang, Yu Zhang, Na Yu, Haokun Li, Xinyu Chen, Yingzhuang Chen, Yi Zhen, Dejun Dong, Xianjin Fu, Jinzhou Su, Fuxiong Pan, Pengshuai Luo, Youzheng Feng, Ruoxiang Hu, Jing Fan, Jinguo Zhou, Xiao Xiao, Peng Di

TL;DR

CodeFuse-Query reframes static code analysis as data-centric computation to address the demands of large-scale organizations. By combining Domain Optimized System Design with Logic Oriented Computation Design, it employs a COREF two-tier data model and the Gödel DSL (built on Datalog) to support hundreds of tasks across multiple languages with incremental extraction and code-change awareness. Empirical results show robust scalability, competitive performance with CodeQL, and clear efficiency gains through IFRA and DCA task designs, as well as strong data reuse in practice. The work exhibits substantial practical impact for change impact analysis, LLM data preparation, and productivity metrics in enterprise software development, and it is released as open source for community collaboration.

Abstract

In the domain of large-scale software development, the demands for dynamic and multifaceted static code analysis exceed the capabilities of traditional tools. To bridge this gap, we present CodeFuse-Query, a system that redefines static code analysis through the fusion of Domain Optimized System Design and Logic Oriented Computation Design. CodeFuse-Query reimagines code analysis as a data computation task, support scanning over 10 billion lines of code daily and more than 300 different tasks. It optimizes resource utilization, prioritizes data reusability, applies incremental code extraction, and introduces tasks types specially for Code Change, underscoring its domain-optimized design. The system's logic-oriented facet employs Datalog, utilizing a unique two-tiered schema, COREF, to convert source code into data facts. Through Godel, a distinctive language, CodeFuse-Query enables formulation of complex tasks as logical expressions, harnessing Datalog's declarative prowess. This paper provides empirical evidence of CodeFuse-Query's transformative approach, demonstrating its robustness, scalability, and efficiency. We also highlight its real-world impact and diverse applications, emphasizing its potential to reshape the landscape of static code analysis in the context of large-scale software development.Furthermore, in the spirit of collaboration and advancing the field, our project is open-sourced and the repository is available for public access

CodeFuse-Query: A Data-Centric Static Code Analysis System for Large-Scale Organizations

TL;DR

CodeFuse-Query reframes static code analysis as data-centric computation to address the demands of large-scale organizations. By combining Domain Optimized System Design with Logic Oriented Computation Design, it employs a COREF two-tier data model and the Gödel DSL (built on Datalog) to support hundreds of tasks across multiple languages with incremental extraction and code-change awareness. Empirical results show robust scalability, competitive performance with CodeQL, and clear efficiency gains through IFRA and DCA task designs, as well as strong data reuse in practice. The work exhibits substantial practical impact for change impact analysis, LLM data preparation, and productivity metrics in enterprise software development, and it is released as open source for community collaboration.

Abstract

In the domain of large-scale software development, the demands for dynamic and multifaceted static code analysis exceed the capabilities of traditional tools. To bridge this gap, we present CodeFuse-Query, a system that redefines static code analysis through the fusion of Domain Optimized System Design and Logic Oriented Computation Design. CodeFuse-Query reimagines code analysis as a data computation task, support scanning over 10 billion lines of code daily and more than 300 different tasks. It optimizes resource utilization, prioritizes data reusability, applies incremental code extraction, and introduces tasks types specially for Code Change, underscoring its domain-optimized design. The system's logic-oriented facet employs Datalog, utilizing a unique two-tiered schema, COREF, to convert source code into data facts. Through Godel, a distinctive language, CodeFuse-Query enables formulation of complex tasks as logical expressions, harnessing Datalog's declarative prowess. This paper provides empirical evidence of CodeFuse-Query's transformative approach, demonstrating its robustness, scalability, and efficiency. We also highlight its real-world impact and diverse applications, emphasizing its potential to reshape the landscape of static code analysis in the context of large-scale software development.Furthermore, in the spirit of collaboration and advancing the field, our project is open-sourced and the repository is available for public access
Paper Structure (43 sections, 6 figures, 12 tables)

This paper contains 43 sections, 6 figures, 12 tables.

Figures (6)

  • Figure 1: The Architecture of CodeFuse-Query
  • Figure 2: CodeFuse-Query worker layer, which executes queries on a distributed cluster of VMs
  • Figure 3: The Computation Design
  • Figure 4: COREF for Java ER Diagram
  • Figure 5: COREF for Java Class Diagram
  • ...and 1 more figures