Skip to content

Enterprise · Code references

The cleanup report

A flag is recommended for archiving only when nothing evaluates it, no code references it, and every repository was scanned recently.

Builds on:Code references

Video coming soon

The cleanup report

Before you start

  • At least one scan has run, or you want to see the report from evaluations alone (Overview).

Open the report

Open Features, then Cleanup report. Choose how long a flag must be unused: 30, 60 or 90 days. The chips filter the table by recommendation. In use is hidden at first.

The report combines three signals for each flag:

  • Evaluations in the window. Evaluations from OpenFeature bulk polls are counted on their own, because a client that polls bulk reads every enabled flag of the team.
  • References on the default branch of each repository.
  • Coverage: whether every repository had a default-branch scan in the last 7 days (the backend's coverage_days).

It holds active and deprecated flags older than the window, expired flags, and archived flags that code still references. Flags of a permanent kind (ops, permission, config) appear only when they expired or are archived and still referenced.

Cleanup report for team Checkout with recommendation chips and rows for one-click-reorder (archived but referenced), legacy-cart-v1 and spring-promo-2026 (plan removal), gift-wrap-option (remove the code) and new-search-bar (archive); the legacy-cart-v1 and gift-wrap-option rows are expanded to show the files and lines (opens full size in a new tab)
The cleanup report of the Checkout team. Expand a row to see where the code still uses the flag.

Recommendations

RecommendationMeaning
Archived but referencedThe flag is archived, but code still references it
Plan removalThe flag is deprecated or expired and still in use
In useThe flag is evaluated and the code references it
Remove codeNothing evaluates the flag, but code still references it. Remove the code at the listed locations, then archive the flag
UnknownNo references were found, but some repositories were not scanned recently. Scan them first
UnverifiedNothing evaluates the flag (or only bulk polls), and no repository is scanned
ArchiveNothing evaluates the flag, no code references it, and every repository is covered
InvestigateThe flag is evaluated, but no code references it: the key may be built at run time, live in a repository you did not register, or be read by another team
Bulk polls onlyOnly bulk polls read the flag, and no code references it

Archive needs all three: no evaluations of any kind, no references, and full coverage. References that a scan found always count, even when some repositories are not covered.

Archive flags

Select the flags with Archive and choose Archive selected. Only those rows can be selected. Open a row with references to see the files and lines.

Delete an archived flag

An archived flag that nothing uses can be deleted for good. FluxGate refuses the delete while code, evaluations, stages, dependents or approvals still use it. See Delete a flag.

Code references to deleted flags

Bottom of the cleanup report with the section Code references to deleted flags listing beta-coupons, deleted minutes ago, with 1 reference in 1 file (opens full size in a new tab)
beta-coupons was deleted from FluxGate, but the storefront still reads it. Apps that call it get the default value from their code.

When code on a default branch still uses a flag key that was deleted from FluxGate in the last 90 days, the report lists the key in Code references to deleted flags, with the number of references and files. The scanner keeps searching deleted keys for 90 days, so these lines show up even after the flag is gone. A key leaves the list when a flag with the same key is created again.

Read the example

The Checkout team's report shows one flag for most recommendations:

FlagEvaluationsReferencesRecommendationWhat to do
one-click-reorder01 in PastOrders.tsxArchived but referencedRemove the useBooleanFlagValue('one-click-reorder', …) call, then delete the flag
legacy-cart-v1152, in both repositoriesPlan removalIt is deprecated but still read: move the remaining callers to the new cart first
spring-promo-2026101Plan removalIt expired on 30 June: remove the promo code path
gift-wrap-option01 in ExpressCheckout.tsxRemove codeDelete the checkbox branch, then archive
new-search-bar00, full coverageArchiveSelect it and choose Archive selected

holiday-banner, saved-cards and address-autocomplete are In use and hidden until you select that chip. checkout-maintenance is an ops flag, a permanent kind, so it is not listed.

Filter the feature list

On Features, the filter In code shows only flags referenced on a default branch (Yes) or only flags that are not (No). The column Code refs counts the references once a repository is scanned. See Code references on the feature page.

Use the API

GET /api/v1/teams/{team_id}/flag-cleanup?inactiveDays=30&recommendation=archive,remove_code returns the report as JSON: coverage (state, number of repositories, the uncovered ones), one row per flag with recommendation, evaluations, bulkEvaluations, references, files and repositories, and deletedFlagReferences. inactiveDays is 1 to 90. The API values of the recommendations are archived_referenced, plan_removal, in_use, remove_code, unknown, unverified, archive, investigate and investigate_bulk_only.

Without the Business edition

The report works in every edition. Without code references, it shows evaluations only, and no flag gets Archive.