Loading...
Enterprise Java codebases accumulate flags in annotations, Spring configurations, and deeply nested service layers. FlagShark scans your entire Java project — annotation processors, Spring beans, and raw SDK calls — to surface flags ready for retirement.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
@RestController
public class FeatureController {
@Autowired private LDClient ldClient;
@GetMapping("/api/recommendations")
public ResponseEntity<?> getRecommendations(@AuthUser User user) {
LDContext ctx = LDContext.builder(user.getId()).build();
boolean useML = ldClient.boolVariation("ml-recommendations", ctx, false);
if (useML) {
return ResponseEntity.ok(mlService.recommend(user));
}
return ResponseEntity.ok(legacyService.recommend(user));
}
}@RestController
public class FeatureController {
@GetMapping("/api/recommendations")
public ResponseEntity<?> getRecommendations(@AuthUser User user) {
return ResponseEntity.ok(mlService.recommend(user));
}
}FlagShark uses Annotation scanning and Java AST for SDK method detection to find every call to variation(), variationDetail(), boolVariation(), stringVariation()across your Spring Boot, Micronaut 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.
Spring's dependency injection makes it hard to trace flag usage across the object graph — a flag evaluated in a `@Service` bean might control behavior three layers deep in a `@Repository`, and removing it requires understanding the full dependency chain.
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 scans your Java source tree for LaunchDarkly SDK imports, then traces every `boolVariation`, `stringVariation`, and `jsonValueVariation` call. It also detects custom annotations that wrap flag evaluation and follows Spring bean wiring to map flag propagation.
Yes. FlagShark recognizes Micronaut's compile-time DI model and correctly resolves injected `LDClient` instances. The generated diffs account for Micronaut's annotation-based routing and conditional bean loading.
FlagShark detects flags referenced in custom annotations and their processors. It warns you when a flag removal would affect compile-time code generation, so you can update processors before deleting the flag.
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.
Find and safely remove LaunchDarkly feature flags buried in Rails controllers, views, and background jobs.
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.
Systematically find and remove stale Split.io treatments from Spring Boot and Micronaut applications.
Find and remove dead Unleash toggles from Spring Boot applications and Java microservices.
Find and remove dead PostHog flags from Spring Boot and Java backend services.
Find and safely remove stale ConfigCat feature flags from Spring Boot and Java enterprise applications.