Search filters and examples
Copy a code search query for your task, narrow it by path, language, symbol or repository, and exclude what you do not want.
Copy a query into the search box and change the names to yours. Filters are a name, a colon and a value, with no space after the colon, in any order with your words. Start a filter with - to exclude what it matches. The search box suggests filters and values as you type. Search syntax has every filter, value and limit.
Find code
| Task | Query |
|---|---|
| The code behind a behavior | where are webhook signatures verified |
| Only under a folder | retry file:^src/ |
| Without tests | retry backoff -file:test |
| In one language | retry lang:go |
| An error message | "connection refused" |
| Text with that letter case | case:yes "ApiKey" |
| A pattern | /retry_\w+/ |
| Calls of a function in Go | lang:go /spawn_\w+\(/ |
| Both of two words | retry AND backoff |
| Either of two names | RetryPolicy OR BackoffPolicy |
| Text with punctuation, such as a flag | "--force" |
Find declarations
| Task | Query |
|---|---|
| A class by part of its name | refund type:symbol kind:class |
| A name in any naming style | discount policy type:symbol |
Methods that end in Async | /Async$/ type:symbol kind:method |
Go files that declare a name starting with Test | sym:^Test lang:go |
Find files
| Task | Query |
|---|---|
| Files by name | Dockerfile type:path |
| Files by extension | file:\.proto$ |
Search a set of repositories
A search covers every repository you can read unless you limit it. Select repositories or an owner beside the results, use Search in this repository or Exclude this repository in a file's ⋯ menu, or type in Search in this repository on a repository's Overview. Each choice writes a repository filter into the query.
| Task | Query |
|---|---|
| One repository | refund validation repo:acme/payments |
Exactly that repository, not acme/payments-old | refund validation repo:^github\.com/acme/payments$ |
| Several repositories | retry repo:^github\.com/acme/(payments|billing)$ |
| One owner's repositories | retry org:acme |
| Several owners' repositories | retry (org:acme or org:globex) |
| Everything except some repositories | retry -repo:docs |
| Repositories by name | payments type:repo |
| Repositories whose code mentions a name | HttpClient select:repo |
| A saved set of repositories | retry context:"Backend services", see Contexts |
repo: matches part of the full name, which starts with the forge host, as in github.com/acme/payments. Archived repositories and forks are included unless you add archived:no or fork:no.
Find repositories by package or advisory
| Task | Query |
|---|---|
| Repositories that use a package | depends_on:npm/react |
| Repositories that use a package version | depends_on:npm/react@>=18.2 |
| Repositories still below a fixed version | depends_on:npm/lodash@<4.17.21 |
| Repositories affected by an advisory | affected_by:CVE-2021-44228 |
| Code in repositories that use a package | retry depends_on:npm/axios |
A query of only these filters lists the repositories. They rely on dependency analysis and vulnerability scanning. A repository Corfedo cannot decide is left out, and the count line says why, for example N not analyzed or N version not checked. Select it to see which repositories and why.
Related
- Search your code covers results and missing results.
- Add a source explains how repositories get into Corfedo.