Software quality attributes, such as reliability, security, and usability, are often well-defined and understood at the requirement level. They lay the ground foundation necessary to achieve high-quality, robust, user-friendly, and trustworthy software systems. However, when addressing these attributes at the code level, two significant challenges emerge. First, they tend to scatter across the codebase due to improper encapsulation of object-oriented classes, hampering the visibility of quality-related components across the codebase. Second, they become tangled within a single module due to intricate interdependencies with functional aspects of the code. Addressing quality concerns in the presence of scattered and tangled code can lead to unforeseen issues. For example, software developers may inadvertently introduce new and latent bugs or incorrectly implement code components deviating from the original system-wide requirements. To tackle these pressing issues, this dissertation proposes a series of state-of-the-art solutions integrating ML-based techniques and NLP-based techniques, including static program analysis techniques, to automatically and effectively detect and repair quality concerns present at the code level, even when scattered across the codebase. Additionally, we introduce program structural analysis and change impact analysis, complemented by other unsupervised ML-based techniques, to disentangle quality-related changes from functional ones, to gain a holistic understanding of a particular maintenance task. From a practical stance, our techniques can be integrated for quality risk assessment purposes and incorporated into safety-critical continuous integration systems to monitor the evolving nature of quality concerns. Furthermore, they can enhance bidirectional traceability across evolving software artifacts, such as bug reports, commit messages, and source code, and facilitate bug triaging systems for prioritizing the resolution of highly impacted quality-related bugs.