GitHub Copilot tries to prevent developers from copying code from another GitHub project with a new feature. Developers actually need to clean up Copilot’s bugs themselves, as the AI assistant sometimes simply copies published code.
GitHub Copilot is a digital AI assistant for developers. Its main advantage is the increased speed at which code can be developed.
However, there are also less pretty sides to the feature. For example, the tool was previously criticised for shamelessly copying pieces of code from other developers.
GitHub now hopes to solve this problem with a new feature. It involves a code referencing feature that notifies developers if some code has already been used in another project. Developers find the notification in a sidebar and will need to check for themselves if there are indeed problems lurking.
The blog details exactly how the feature works: “When the filter is enabled, GitHub Copilot checks code suggestions with surrounding code of about 150 characters and compares it against an index of all the public code on GitHub.com.”
Feature will improve over time
The feature is currently only available as a private beta. Taking the feature to the general public is currently not an option, as further refinement is still needed. For example, it is currently not yet possible to set specific alerts for when code matches specific licenses. This is what Thomas Dohmke, CEO of GitHub, told TechCrunch in an interview.
Furthermore, it appears that the feature alerts too quickly if a developer does not put much context into the code. That mainly poses a problem at the beginning of the development phase.