Loading...
Ruby's metaprogramming power means flags can hide behind `method_missing`, concern modules, and dynamic helper definitions. FlagShark uses the Parser gem to trace every flag evaluation — even ones generated at boot time.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
class DashboardController < ApplicationController
def index
ctx = LaunchDarkly::LDContext.create({ key: current_user.id.to_s })
@show_widgets = ld_client.variation("dashboard-widgets", ctx, false)
if @show_widgets
render :index_with_widgets
else
render :index
end
end
endclass DashboardController < ApplicationController
def index
render :index_with_widgets
end
endFlagShark uses Parser gem and custom Rake task integration to find every call to variation(), variationDetail(), boolVariation(), stringVariation()across your Rails, Sinatra 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.
Rails concerns and helper modules that mix flag checks into multiple controllers make it easy to miss a reference — removing the flag from one controller but not the shared concern leaves dead code behind.
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 parses your Ruby source with the Parser gem, then follows every call to `ld_client.variation()` and related methods across controllers, models, views, helpers, and initializers. It also detects flag keys defined as constants or stored in YAML config.
Yes. FlagShark scans `.erb` files for embedded flag checks and traces helper methods that wrap flag evaluation. The cleanup diff covers both the Ruby helper and the template that calls it.
FlagShark includes background job files in its scan. It detects LaunchDarkly calls inside Sidekiq `perform` methods and warns you if a flag removal affects async processing logic.
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.
Leverage Rust's type system and FlagShark's syn-based analysis to remove stale LaunchDarkly flags from Actix and Axum services.
Use Roslyn analyzers and FlagShark to find and remove stale LaunchDarkly flags in ASP.NET Core and .NET services.