How to use the similar code tool
Manual usage
Comment on the PR:
COMPONENT_NAME is the name of a code component in the PR (class, method, function).
You can set a specific class or file where the component will be taken from:
analyze tool. On a PR, comment:
similar checkbox.


Search results
Each search result includes:extracted keywords: Keywords identified in your code. Clicking the link to view the keywords and adjust the search if needed.search context: The context in which the tool looks for similar code, either inside your organization’s repositories or across public open-source projects (Global).similar code: Matching code snippets found in the selected search context. Click the link to open the code component in the relevant file.relevant repositories: Open-source repos that contain code related to your component and its keywords.
Configuration options
Configure thesimilar code tool by setting configurations under the pr_find_similar_component part in your configuration file.
Example usage
Global Search for a method calledchat_completion:


