Backend Development 11 min read

Introducing the Alchemy Code Quality Analysis Platform for Backend Development

The article presents Alchemy, a comprehensive code quality analysis platform that integrates static analysis, unit‑test rule scanning, duplicate‑code detection, custom rule checks, and code search into GitLab CI/CD pipelines, addressing common DevOps challenges and improving backend development efficiency.

Ctrip Technology
Ctrip Technology
Ctrip Technology
Introducing the Alchemy Code Quality Analysis Platform for Backend Development

Background With the rise of agile and DevOps practices, code quality analysis has become essential for reducing fault risk and enhancing team efficiency. Ctrip has long employed DevOps, using GitLab CI/CD pipelines that incorporate static scanning, unit tests, and integration tests, with SonarQube for static analysis. However, challenges remain such as lack of unified risk analysis, undetected test issues, duplicated code, and unsafe SQL concatenations.

Platform Overview Alchemy is a code quality analysis platform offering Infer analysis, code analysis, custom scans, code search, and more. Integrated with GitLab CI/CD, it provides early feedback on code changes, enforcing red‑line thresholds to block merges when issues exceed defined limits.

System Architecture Alchemy consists of three components: Alchemy‑client (scanning scripts packaged in Docker), Alchemy‑service (backend storage and analysis, using MongoDB), and Alchemy‑web (frontend UI). Developers trigger scans via GitLab pipelines; results are stored and displayed through the web interface.

Features

4.1 Infer Analysis Integrates Facebook’s Infer tool for static analysis of Java, Objective‑C, and C code, supporting both full‑project and incremental modes to reduce scan time.

4.2 Unit‑Test Rule Scanning Detects empty functions, missing assertions, and fake assertions across Java, Kotlin, Groovy, and Node.js, flagging ineffective tests in both full and incremental scans.

4.3 Duplicate Code Scanning Uses PMD‑CPD to identify exact or near‑duplicate code fragments, helping eliminate copy‑paste bloat and improve maintainability.

4.4 Custom Rule Scanning Allows users to define regex‑based rules for detecting patterns such as unsafe SQL concatenation or sensitive keywords, with support for hierarchical sub‑rules.

4.5 Code Analysis Aggregates metrics like lines of code, test coverage, Infer issues, Sonar issues, duplicate code, and cyclomatic complexity, enabling risk‑based prioritization.

4.6 Code Search Provides keyword‑based search across repositories, languages, and authors, and offers variable‑naming recommendations to boost developer productivity.

Conclusion Alchemy enhances static analysis, code exploration, and CI/CD integration, already serving over 800 Ctrip hotel projects. Future work includes expanding language support, building IDE plugins for real‑time scanning, and deepening risk‑metric evaluation.

CI/CDbackend developmentDevOpscode qualityStatic Analysiscode searchduplicate code
Ctrip Technology
Written by

Ctrip Technology

Official Ctrip Technology account, sharing and discussing growth.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.