1
0
mirror of synced 2025-12-19 09:57:42 -05:00
Files
docs/content/code-security/code-quality/responsible-use/code-quality.md
Sophie c1ca049106 October 28-29: GitHub Universe 2025 docs-internal megabranch (#57869)
Signed-off-by: Meredith Lancaster <malancas@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Anne-Marie <102995847+am-stead@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: AlonaHlobina <54394529+AlonaHlobina@users.noreply.github.com>
Co-authored-by: Isaac Brown <101839405+isaacmbrown@users.noreply.github.com>
Co-authored-by: Jules <19994093+jules-p@users.noreply.github.com>
Co-authored-by: Siara <108543037+SiaraMist@users.noreply.github.com>
Co-authored-by: Kelly Arwine <kellyarwine@github.com>
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
Co-authored-by: Jon Janego <jonjanego@github.com>
Co-authored-by: Jules Porter <jules-p@users.noreply.github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
Co-authored-by: Laurenzo <lsto@github.com>
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
Co-authored-by: Vanessa <vgrl@github.com>
Co-authored-by: Melanie Yarbrough <11952755+myarb@users.noreply.github.com>
Co-authored-by: Claire W <78226508+crwaters16@users.noreply.github.com>
Co-authored-by: Felix Guntrip <guntrip@github.com>
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com>
Co-authored-by: Tim Rogers <timrogers@github.com>
Co-authored-by: docs-bot <77750099+docs-bot@users.noreply.github.com>
Co-authored-by: Guillaume Perrot <guperrot@github.com>
Co-authored-by: Mark Tareshawty <tarebyte@github.com>
Co-authored-by: Hirsch Singhal <1666363+hpsin@users.noreply.github.com>
Co-authored-by: Emily Gould <4822039+emilyistoofunky@users.noreply.github.com>
Co-authored-by: Sunbrye Ly <56200261+sunbrye@users.noreply.github.com>
Co-authored-by: PJ Quirk <pjquirk@github.com>
Co-authored-by: Steve Ward <steveward@github.com>
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: SiaraMist <siaramist@github.com>
Co-authored-by: Tomoko Tanaka <28242405+tallzeebaa@users.noreply.github.com>
Co-authored-by: a1exmozz <187176404+a1exmozz@users.noreply.github.com>
Co-authored-by: Meredith Lancaster <malancas@users.noreply.github.com>
Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
Co-authored-by: Andy Barnes <kurgol@github.com>
Co-authored-by: Sheena Ganju <sheenyg@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sydney Wilson <86739163+swilson15@users.noreply.github.com>
Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>
Co-authored-by: Vimala Moger <166641453+VimalaMoger@users.noreply.github.com>
Co-authored-by: Sharra-writes <sharra-writes@github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jenni C <97056108+dihydroJenoxide@users.noreply.github.com>
Co-authored-by: Greg Mondello <72952982+gmondello@users.noreply.github.com>
Co-authored-by: Mia Arts <107727642+its-mia@users.noreply.github.com>
Co-authored-by: sunbrye <sunbrye@github.com>
Co-authored-by: Lorenz Vanthillo <lorenz.vanthillo@gmail.com>
Co-authored-by: Eboni <32157169+EboniLM@users.noreply.github.com>
Co-authored-by: Junko Suzuki <pnsk@github.com>
Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com>
Co-authored-by: heiskr <1221423+heiskr@users.noreply.github.com>
Co-authored-by: Patrick Knight <patrick-knight@github.com>
Co-authored-by: T. Greg Doucette <58960990+LawDevNull@users.noreply.github.com>
Co-authored-by: Evan Bonsignori <ebonsignori@github.com>
Co-authored-by: Robert Justin Monzingo <robertjmonzingo@gmail.com>
Co-authored-by: John Coleman <thenewcoke@gmail.com>
Co-authored-by: Brendan Scott-Smith <117171930+bss-mc@users.noreply.github.com>
Co-authored-by: Chad Bentz <1760475+felickz@users.noreply.github.com>
Co-authored-by: Justin Alex <1155821+jusuchin85@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: azenMatt <7584089+azenMatt@users.noreply.github.com>
Co-authored-by: Felix Guntrip <stevecat@github.com>
Co-authored-by: timrogers <116134+timrogers@users.noreply.github.com>
Co-authored-by: John Clement <70238417+jclement136@users.noreply.github.com>
Co-authored-by: vaindil <vaindil@github.com>
Co-authored-by: Matthew Isabel <matthewisabel@github.com>
Co-authored-by: Matthew Isabel <matthew.isabel@gmail.com>
2025-10-28 15:40:35 +00:00

7.6 KiB

title, shortTitle, intro, product, versions, topics, contentType
title shortTitle intro product versions topics contentType
Responsible use of GitHub Code Quality Code quality Learn how to use {% data variables.product.prodname_code_quality %} responsibly by understanding its purposes, capabilities, and limitations. {% data reusables.gated-features.code-quality-availability %}
feature
code-quality
Code Quality
CodeQL
AI
rai

{% data reusables.code-quality.code-quality-preview-note %}

About {% data variables.product.prodname_code_quality %}

{% data variables.product.prodname_code_quality %} helps users improve code reliability, maintainability, and overall project health by surfacing actionable feedback and offering automatic fixes for any findings in pull requests and on the default branch.

When you enable {% data variables.product.prodname_code_quality_short %}, two types of analysis run:

  • {% data variables.product.prodname_codeql %} quality queries run using {% data variables.product.prodname_code_scanning %} analysis and identify problems with the maintainability, reliability, or style of code. This runs on changed code in all pull requests against the default branch. It also runs periodically on the full default branch.

  • Large Language Model (LLM)-powered analysis provides additional insights into potential quality concerns beyond what is covered by deterministic engines like {% data variables.product.prodname_codeql %}. This runs automatically on files changed in recent pushes to the default branch. These findings are displayed in {% data variables.product.prodname_code_quality_short %}'s {% data variables.code-quality.recent_suggestions %} dashboard, under the Security tab of the repository.

When a quality issue is detected by either type of analysis, {% data variables.copilot.copilot_autofix_short %} suggests a relevant fix that can be reviewed and applied by developers.

On pull requests, {% data variables.product.prodname_code_quality_short %} results are displayed as comments left by the github-code-quality bot, which includes a suggested autofix wherever possible.

LLM-powered analysis for recent pushes

After each push to the default branch, the LLM analyzes recently changed files for maintainability, reliability, and other quality issues. {% data variables.product.prodname_code_quality_short %} inspects your code and provides feedback using a combination of natural language processing and machine learning.

Input processing

The code changes are combined with other relevant, contextual information to form a prompt, and that prompt is sent to a large language model.

Language model analysis

The prompt is then passed through the {% data variables.product.prodname_copilot_short %} language model, which is a neural network that has been trained on a large body of text data. The language model analyzes the input prompt.

Response generation

The language model generates a response based on its analysis of the input prompt. This response can take the form of natural language suggestions and code suggestions.

Output formatting

The response generated by {% data variables.product.prodname_code_quality_short %} is presented to the user directly, providing code feedback linked to specific lines of specific files. Where {% data variables.product.prodname_code_quality_short %} has provided a code suggestion, the suggestion is presented as a suggested change, which can be applied with a couple of clicks.

{% data variables.copilot.copilot_autofix %} suggestions

On pull requests, {% data variables.product.prodname_code_quality_short %} results found by {% data variables.product.prodname_code_scanning %} analysis send input to the LLM. If the LLM can generate a potential fix, the github-code-quality bot posts a comment with a suggested change directly in the pull request.

In addition, users can request autofix generation for results in the default branch.

For more information on the suggestion generation process for {% data variables.copilot.copilot_autofix %}, see AUTOTITLE.

Use case for {% data variables.product.prodname_code_quality %}

The goal of {% data variables.product.prodname_code_quality %} is to:

  • Surface code quality issues across your repository, so developers and repository administrators can quickly identify, prioritize and report on areas of risk.
  • Accelerate remediation work by offering {% data variables.copilot.copilot_autofix_short %} suggestions for results found by scans of the default branch, as well as for findings in recent pushes to the default branch.
  • Quickly provide actionable feedback on a developer's code. On pull requests, {% data variables.product.prodname_code_quality_short %} combines information on best practices with details of the codebase and findings to suggest a potential fix to the developer.

Improving the performance of {% data variables.product.prodname_code_quality %}

If you encounter any issues or limitations with suggested fixes on pull requests, we recommend that you provide feedback by using the thumbs up and thumbs down buttons on the github-code-quality bot's comments. This can help {% data variables.product.github %} to improve the tool and address any concerns or limitations.

Limitations of {% data variables.product.prodname_code_quality %}

Limitations of {% data variables.product.prodname_code_quality_short %}'s LLM-powered analysis

{% data variables.product.prodname_code_quality_short %}'s LLM-powered analysis uses the same underlying language model and analysis engine as {% data variables.copilot.copilot_code-review %}. Therefore, it shares similar limitations when analyzing code quality. Key considerations include:

  • Incomplete detection
  • False positives
  • Code suggestion accuracy
  • Potential biases

For detailed information about these limitations, see AUTOTITLE.

You should always review the findings surfaced by {% data variables.product.prodname_code_quality %}'s LLM-powered analysis to verify their accuracy and applicability to your codebase.

Limitations of {% data variables.copilot.copilot_autofix_short %}

{% data variables.copilot.copilot_autofix_short %} for {% data variables.product.prodname_code_quality_short %} findings won't be able to generate a fix for every finding in every situation. The feature operates on a best-effort basis and is not guaranteed to succeed 100% of the time.

When you review a suggestion from {% data variables.copilot.copilot_autofix_short %}, you must always consider the limitations of AI and edit the changes as needed before you accept the changes. You should always carefully review and verify {% data variables.copilot.copilot_autofix_short %} suggestions before applying them.

For more information on the limitations of {% data variables.copilot.copilot_autofix_short %}, the quality of {% data variables.copilot.copilot_autofix_short %} suggestions, and the best way to mitigate its limitations, see AUTOTITLE

Provide feedback

You can provide feedback on {% data variables.product.prodname_code_quality %} in the community discussion.

Next steps

See how {% data variables.product.prodname_code_quality %} works on your default branch to surface code quality issues and help you understand your repository's code health at a glance. See AUTOTITLE.