Code references currently support GitHub repositories only. They perform a basic text search using the GitHub Search API; they do not parse code or detect semantic usage. Results may include matches inside comments, strings, or unrelated code.

Code references show where a feature flag is referenced in your source code by searching the repositories linked to your application.

Code references are available when they’re enabled for your organization.

Before viewing code references, link components to an application. You can connect a repository directly from the flag’s Flag summary page, or from the integrations and components settings. For setup instructions, refer to Set up code references.

This page explains how the search works, what it can and cannot detect, and how code references connect to flag cleanup.

What code references are

The Code references tab on a flag displays the files in your connected repositories where that flag name appears. Results are scoped to the application you are viewing: CloudBees Unify searches only the repositories associated with that application’s components, not your entire organization.

This scoping is intentional. Feature flags are evaluated in the context of a specific application, so the relevant code is the code that belongs to that application’s components.

How the search works

CloudBees Unify uses the GitHub Search API to search for the flag name as a plain text string across all files in the connected repositories. Results are returned as file-level links that open the relevant GitHub search view in a new tab. CloudBees Unify does not link to specific lines within files. GitHub handles result highlighting.

If no repository filter is selected, the search runs across all repositories connected to the application’s components. Selecting a specific repository narrows the results to that repository only.

Limitations

Because the search is text-based rather than parsed or semantic, results require interpretation. A match may appear inside a comment, a string literal, or unrelated code that happens to share the flag name.

The current implementation supports GitHub repositories only. GitHub code search does not support forked repositories, so searches do not return results from them.

These limitations mean code references provide a strong signal about where a flag is likely referenced, but not a guarantee. Before concluding that a flag is safe to remove, review the results in GitHub to confirm the matches represent actual flag evaluations.

GitHub search indexing

Code references depend on GitHub’s search index. GitHub must index a repository before its contents are searchable. Repositories that have never been indexed return no results until indexing is complete.

If you connect a new repository and see no code references for flags you know are referenced there, the repository may not yet be indexed by GitHub. To check the indexing status of your repository or request indexing, refer to GitHub’s code search documentation.

Code references and flag cleanup

Code references are most valuable during flag cleanup. A flag that the health view marks as stale or inactive may still appear in code, particularly if the SDK calls have not yet been removed from the codebase. Checking code references before deleting a flag surfaces these cases and prevents breaking changes.

A flag cannot be deleted if other flags depend on it. Dependencies of this kind also appear on the Code references tab.

For guidance on the full cleanup process, refer to Review and clean up feature flags.