Loading...
Unleash's Rust client returns Results and Options, fitting naturally into idiomatic Rust error handling. But stale toggles still accumulate — FlagShark's `syn`-based analysis identifies them and generates diffs that keep your code lean.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
async fn onboarding_handler(
unleash: web::Data<UnleashClient>,
user: AuthUser,
) -> impl Responder {
let ctx = UnleashContext {
user_id: Some(user.id.clone()),
..Default::default()
};
if unleash.is_enabled("guided-onboarding", Some(&ctx), false) {
HttpResponse::Ok().json(guided_onboarding_steps(&user).await)
} else {
HttpResponse::Ok().json(legacy_onboarding(&user).await)
}
}async fn onboarding_handler(user: AuthUser) -> impl Responder {
HttpResponse::Ok().json(guided_onboarding_steps(&user).await)
}FlagShark uses syn crate for compile-time flag analysis to find every call to isEnabled(), getVariant(), getAllToggles()across your Actix, Axum codebase.
Each detected flag key is matched against your Unleash 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.
Unleash's Rust client uses `Arc` internally, and it's often passed through Actix `web::Data` or Axum `Extension` — removing the last toggle means you can also remove the client from your app state, but you need to update every handler signature that receives it.
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.
isEnabled()getVariant()getAllToggles()Plus custom patterns you define in .flagshark.yaml
FlagShark parses your Rust source with `syn` and detects calls to `is_enabled`, `get_variant`, and related methods on the Unleash client. It follows the client through `web::Data`, `Extension`, and `Arc` wrappers.
Yes. FlagShark handles `async fn` handlers, `.await` expressions, and toggle checks inside async blocks. The generated diffs maintain correct async/await semantics.
FlagShark detects `UnleashContext` struct construction and identifies when the context was only used for a single toggle. It removes both the toggle check and the now-unnecessary context builder code.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
Find and remove stale Unleash feature toggles from React, Next.js, and Node.js TypeScript projects.
Identify and safely remove stale Unleash toggles from Django, FastAPI, and Flask Python applications.
Systematically identify and remove stale Unleash toggles from Go services and CLI applications.
Find and remove dead Unleash toggles from Spring Boot applications and Java microservices.
Detect and safely remove stale Unleash feature toggles from Rails applications and Ruby services.