1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Files
docs/content/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-code-review.md
2025-04-04 15:13:27 +00:00

95 lines
7.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Responsible use of GitHub Copilot code review
shortTitle: Code review
intro: "Learn how to use {% data variables.copilot.copilot_code-review %} safely and responsibly by understanding its purposes, capabilities, and limitations."
versions:
feature: copilot
topics:
- Copilot
type: rai
redirect_from:
- /early-access/copilot/code-review/responsible-use-of-copilot-code-review
- /early-access/copilot/code-reviews/responsible-use-of-copilot-code-review
- /early-access/copilot/code-reviews/responsible-use-of-copilot-code-reviews
---
## About {% data variables.copilot.copilot_code-review %}
{% data variables.copilot.copilot_code-review %} is an AI-powered feature that reviews code and provides feedback.
When a user requests a code review from {% data variables.product.prodname_copilot_short %}, {% data variables.product.prodname_copilot_short %} scans through the code changes, plus additional relevant context, and provides feedback on the code. As part of that feedback, it may also provide specific suggested code changes.
{% data variables.product.prodname_copilot_short %}'s review can be customized with coding guidelines, which are natural language descriptions of coding style and best practices. For more information, see [AUTOTITLE](/copilot/using-github-copilot/code-review/configuring-coding-guidelines).
The only supported language for {% data variables.copilot.copilot_code-review %} is English.
{% data variables.copilot.copilot_code-review %} inspects your code and provides feedback using a combination of natural language processing and machine learning. This process can be broken down into a number of steps.
### Input processing
The code changes are combined with other relevant, contextual information (for example, the pull requests title and body on {% data variables.product.github %}) and your coding guidelines 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_copilot_short %} is presented to the user directly in {% data variables.product.prodname_vscode %} or as a pull request review on {% data variables.product.github %}, providing code feedback linked to specific lines of specific files.
Where {% data variables.product.prodname_copilot_short %} has provided a code suggestion, the suggestion is presented as a suggested change, which can be applied with a couple of clicks.
## Use case for {% data variables.copilot.copilot_code-review %}
The goal of {% data variables.copilot.copilot_code-review %} is to quickly provide feedback on a developers code. This can enable developers to get code ready to merge more quickly and increase overall code quality.
## Improving the performance of {% data variables.copilot.copilot_code-review %}
### Use {% data variables.copilot.copilot_code-review_short %} to supplement human reviews, not to replace them
While {% data variables.copilot.copilot_code-review %} can be a powerful tool for improving code quality, it is important to use it as a tool, rather than to replace human reviews.
You should always review and verify the feedback generated by {% data variables.copilot.copilot_code-review_short %}, and supplement {% data variables.product.prodname_copilot_short %}'s feedback with careful human review to ensure your code meets your requirements.
### Provide feedback
If you encounter any issues or limitations with {% data variables.copilot.copilot_code-review_short %}, we recommend that you provide feedback by using the thumbs up and thumbs down buttons on {% data variables.product.prodname_copilot_short %}'s comments. This can help GitHub to improve the tool and address any concerns or limitations.
### Configure coding guidelines
You can configure coding guidelines to help {% data variables.product.prodname_copilot_short %} understand your coding style and best practices. For more information, see [AUTOTITLE](/copilot/using-github-copilot/code-review/configuring-coding-guidelines).
## Limitations of {% data variables.copilot.copilot_code-review %}
Depending on factors such as your codebase and programming language, you may encounter different levels of performance when using {% data variables.copilot.copilot_code-review %}. The following information is designed to help you understand system limitations and key concepts about performance as they apply to {% data variables.copilot.copilot_code-review %}.
### Limited scope
{% data variables.copilot.copilot_code-review_short %} only supports a specific set of programming languages, and it is only designed to identify a limited, fixed set of code quality issues. To ensure that all relevant problems are identified and corrected, {% data variables.copilot.copilot_code-review_short %} should be supplemented with careful human code review.
### Missed code quality problems
{% data variables.product.prodname_copilot_short %} may not identify all of the problems that are present in code, especially where changes are large or complex. To ensure that all relevant problems are identified and corrected, {% data variables.copilot.copilot_code-review_short %} should be supplemented with careful human code review.
### False positives
{% data variables.copilot.copilot_code-review_short %} has a risk of "hallucination" - that is, it may highlight problems in reviewed code that do not exist or are based on misunderstandings of the code. Comments generated by {% data variables.copilot.copilot_code-review_short %} should be carefully reviewed and considered before taking action and making changes.
### Inaccurate or insecure code
As part of its comments, {% data variables.copilot.copilot_code-review_short %} may provide specific code suggestions. The code generated may appear to be valid, but may not actually be semantically or syntactically correct, or may not correctly resolve the problem identified in the comment. In addition, code generated by {% data variables.product.prodname_copilot_short %} may contain security vulnerabilities or other issues. You should always carefully review and test code generated by {% data variables.product.prodname_copilot_short %}.
### Potential biases
{% data variables.product.prodname_copilot_short %}'s training data is drawn from existing code repositories, which may contain biases and errors that can be perpetuated by the tool. Additionally, {% data variables.copilot.copilot_code-review_short %} may be biased toward certain programming languages or coding styles, which can lead to suboptimal or incomplete feedback.
## Next steps
For details of how to use {% data variables.copilot.copilot_code-review_short %}, see:
* [AUTOTITLE](/copilot/using-github-copilot/code-review/using-copilot-code-review)