# Introduction

Improving code quality is a software development practice based on the principle that *new code* (code that you added or modified recently) needs to comply with quality standards. The Sonar solution supports improving code quality by warning you whenever issues are detected in your new code.

When you add new code to your projects, you usually touch a portion of the old code in the process. As a consequence, analyzing and cleaning new code allows you to fix issues in your old code and gradually improve the overall quality of your codebase.

![](/files/TzIxDgsOYJA7bG4dNq6V)

The end goal is to achieve high code quality across your entire codebase. This approach is also suitable for legacy projects with a substantial amount of code, although in this case a full cleanup can hardly be achieved.

Sometimes, you may want to implement additional measures to ensure the quality of the overall code base, such as checking for vulnerabilities and performing refactoring. This approach does not prevent you from pursuing these additional use cases.

## Benefits of improving code quality <a href="#benefits-of-clean-as-you-code" id="benefits-of-clean-as-you-code"></a>

### For developers <a href="#for-developers" id="for-developers"></a>

* You ensure that all new code added to the project is always clean.
* You gain time by reducing and even eliminating debt-addressing sprints.
* You adopt a sustainable approach to software development, as cleaning code becomes part of the development routine.
* You fix issues in your own code, reducing the complexity that comes with fixing old code that is hard to understand.

### For organizations <a href="#for-organizations" id="for-organizations"></a>

* The overall quality of your code increases over time.
* You ensure your software meets high quality standards.
* You increase developer morale by reducing debt-addressing sprints.
* Engineering/Feature development velocity increases.

In SonarQube Server, you can get a visual representation of your code quality improvements based on the data in your projects by navigating to **More** > **Clean as You Code**.

## Related pages <a href="#related-pages" id="related-pages"></a>

* [Software qualities](/sonarqube-server/10.8/core-concepts/software-qualities.md)
* [Setting up new code](/sonarqube-server/10.8/project-administration/setting-up-clean-as-you-code.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/10.8/core-concepts/clean-as-you-code/introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
