Research
Independent Thinking, Formal Foundations, Real-World Impact!
© Héla Ben Khalfallah, 2025. All rights reserved.
Code Health Meter
Héla Ben Khalfallah
Code Health Meter: A Quantitative and Graph-Theoretic Foundation for Automated Code Quality and Architecture Assessment
ACM Transactions on Software Engineering and Methodology (TOSEM)
https://doi.org/10.1145/3737670
Publisher: Association for Computing Machinery (ACM)
ISSN: 1049-331X
DOI: 10.1145/3737670
Keywords: static analysis, graph theory, modularity, maintainability, software quality metrics, Louvain method, Halstead metrics, cyclomatic complexity, architectural analysis
Abstract:
Quantifying code quality and architectural soundness remains a persistent challenge in modern software engineering. Existing tools often rely on isolated or superficial metrics, lacking architectural awareness and actionable insight.
This paper introduces Code Health Meter (CHM), a fully automated, referentially transparent framework for quantitative and graph-theoretic code quality assessment. CHM statically analyzes source code and produces a six-dimensional signature per module, capturing semantic complexity (Maintainability Index, Halstead Volume, Cyclomatic Complexity), architectural structure (graph centrality, modularity), and redundancy (code duplication via Rabin–Karp fingerprinting).
The framework is designed to be deterministic, explainable, and amenable to longitudinal analysis. We validate CHM on a 14,000-line JavaScript system by tracking its evolution across multiple versions. Our analysis reveals increasing architectural fragmentation, rising code duplication, and declining maintainability.
These findings demonstrate CHM’s capability to surface actionable architectural insights, quantify technical debt, and support evidence-driven refactoring decisions. CHM bridges the gap between classical software metrics and architectural reasoning, offering a robust foundation for integrating automated code health monitoring into engineering workflows.
This is a summary with citation and abstract only. The full article is available via the ACM Digital Library: https://doi.org/10.1145/3737670
