Loading...
Ruby's expressiveness means Split.io treatments often end up in conditionals, case statements, and even dynamically-defined methods. FlagShark uses the Parser gem to locate every `get_treatment` call and its downstream branches.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
class OrdersController < ApplicationController
def create
treatment = split_client.get_treatment(current_user.id.to_s, 'checkout-flow')
case treatment
when 'one-page'
process_one_page_checkout(order_params)
when 'multi-step'
process_multi_step_checkout(order_params)
else
process_legacy_checkout(order_params)
end
end
endclass OrdersController < ApplicationController
def create
process_one_page_checkout(order_params)
end
endFlagShark uses Parser gem and custom Rake task integration to find every call to getTreatment(), getTreatments(), track()across your Rails, Sinatra codebase.
Each detected flag key is matched against your Split.io 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 initializers that create the Split factory at boot time cache the client as a global — removing all flags means cleaning up the initializer, the Gemfile dependency, and any monkey-patches your team added to the Split client.
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.
getTreatment()getTreatments()track()Plus custom patterns you define in .flagshark.yaml
FlagShark parses Ruby source files with the Parser gem and follows every `get_treatment` call through controllers, services, and concerns. It maps string comparisons after `get_treatment` to individual treatment branches.
Yes — case/when is the natural Ruby pattern for multi-treatment flags. FlagShark identifies the winning branch from your Split dashboard and collapses the entire case statement into a direct call.
FlagShark includes background job files in its scan. It detects `get_treatment` calls inside `perform` methods and warns when flag removal would change async behavior.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
Detect and remove abandoned Split.io treatments from your TypeScript frontend and Node.js backend.
Find and clean up stale Split.io feature flag treatments in Django, FastAPI, and Flask projects.
Identify and safely remove stale Split.io treatments from Go services using AST-based analysis.
Systematically find and remove stale Split.io treatments from Spring Boot and Micronaut applications.