GITHUB-COPILOT practice question 7 of 15

What is the process behind identifying public code matches when using a public code filter enabled in GitHub Copilot?

Full set: 65 questions
Answer options
A: Running code suggestions through filters designed to detect public code Correct answer
B: Comparing suggestions against public code using machine learning.
C: Analyzing the context and structure of the code being written
D: Reviewing the user's browsing history to identify public repositories
Correct Answer:
A. Running code suggestions through filters designed to detect public code
Explanation

When the public code filter is enabled in GitHub Copilot, it checks generated code suggestions against a comprehensive index of public code hosted on GitHub. This process involves comparing the suggestion and its surrounding context (approximately 150 characters) against this index. If a direct or near-match is found, the suggestion is suppressed and not presented to the user. This mechanism acts as a filter to help users avoid unintentionally incorporating code that matches public repositories.

Why Incorrect

B. Comparing suggestions against public code using machine learning. This is imprecise. The process is a direct comparison against an index of public code, not necessarily another machine learning model for the comparison itself.
C. Analyzing the context and structure of the code being written. This describes how Copilot generates suggestions in the first place, not the specific, separate process of filtering them against public code.
D. Reviewing the user's browsing history to identify public repositories. This is incorrect. GitHub Copilot does not access a user's browsing history; this would be a major privacy violation.

References

1. GitHub Docs. (2024). "Configuring GitHub Copilot settings on GitHub.com." In GitHub Docs. Retrieved from https://docs.github.com/en/copilot/configuring-github-copilot/configuring-github-copilot-settings-on-githubcom#allowing-or-blocking-suggestions-matching-public-code.

Reference Details: The section "Allowing or blocking suggestions matching public code" explicitly states, "GitHub Copilot includes a filter to help you block suggestions that match public code on GitHub. ... When the filter is enabled, GitHub Copilot checks code suggestions with their surrounding code of about 150 characters against public code on GitHub. If there is a match or near match, the suggestion will not be shown to you." This directly supports the concept of a filter (Option A).

2. GitHub. (2023). "GitHub Copilot Trust Center." Retrieved from https://github.com/features/copilot/trust-center.

Reference Details: Under the "Filtering" section, it is explained: "We have a filter that detects and suppresses suggestions that contain code that matches public code on GitHub." This confirms the process is a filter designed for detection and suppression.

Scroll to Top