Loading...
Rust's strong type system catches many flag issues at compile time, but stale runtime flags evaluated via the LaunchDarkly SDK still accumulate. FlagShark uses the `syn` crate to parse your Rust source and identify flags that can be safely inlined.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
async fn feature_handler(
State(ld_client): State<Arc<Client>>,
user: AuthUser,
) -> impl IntoResponse {
let ctx = ContextBuilder::new(&user.id).build().unwrap();
let use_new_algo = ld_client.bool_variation(&ctx, "new-search-algo", false);
if use_new_algo {
Json(search_v2(&user.query).await)
} else {
Json(search_v1(&user.query).await)
}
}async fn feature_handler(user: AuthUser) -> impl IntoResponse {
Json(search_v2(&user.query).await)
}FlagShark uses syn crate for compile-time flag analysis to find every call to variation(), variationDetail(), boolVariation(), stringVariation()across your Actix, Axum codebase.
Each detected flag key is matched against your LaunchDarkly project to check rollout status, last evaluation date, and whether the flag is archived or still active.
For each stale flag, FlagShark creates a pull request that removes the SDK call, eliminates the dead code branch, and preserves the winning path. Every PR includes a before/after diff you can review.
When the LaunchDarkly client is wrapped in an `Arc<Mutex<>>` and shared across async tasks, removing the last flag reference may also let you remove the client from your application state entirely — FlagShark detects these cascading cleanups.
Grep misses flags behind abstractions. AST-level scanning catches SDK calls that regex can't.
Every cleanup goes through code review. No surprises, no broken builds.
Only flags at 100% rollout for your configured threshold are suggested for removal.
New stale flags are detected automatically. Your codebase stays clean without manual audits.
variation()variationDetail()boolVariation()stringVariation()Plus custom patterns you define in .flagshark.yaml
FlagShark uses the `syn` crate to parse Rust source files and identify calls to `bool_variation`, `string_variation`, and other SDK methods on the LaunchDarkly client. It resolves the client through `Arc`, `State`, and `Data` wrappers common in Actix and Axum.
Yes — and Rust makes this safer than most languages. Once FlagShark generates the removal diff, `cargo check` will immediately surface any type errors, unreachable code warnings, or missing import issues before you even run tests.
FlagShark detects flags used in match arms, if-let expressions, and async blocks. It also identifies feature-gated modules using `cfg` attributes and Cargo features that complement runtime flags.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
A hands-on guide to finding and safely removing stale LaunchDarkly feature flags from TypeScript and React codebases.
Step-by-step process for identifying and removing dead LaunchDarkly flags in Django, FastAPI, and Flask applications.
How to find, evaluate, and remove unused LaunchDarkly feature flags from Go microservices and CLI tools.
Practical guide to removing stale LaunchDarkly flags from Spring Boot and Micronaut applications.
Find and safely remove LaunchDarkly feature flags buried in Rails controllers, views, and background jobs.
Use Roslyn analyzers and FlagShark to find and remove stale LaunchDarkly flags in ASP.NET Core and .NET services.