Loading...
Unleash's Java SDK integrates deeply with Spring — custom strategies, context providers, and toggle listeners can scatter flag logic across your entire service layer. FlagShark traces through all of it.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
@RestController
public class NotificationController {
private final Unleash unleash;
public NotificationController(Unleash unleash) {
this.unleash = unleash;
}
@GetMapping("/notifications")
public ResponseEntity<List<Notification>> getNotifications(Principal user) {
UnleashContext ctx = UnleashContext.builder()
.userId(user.getName()).build();
if (unleash.isEnabled("rich-notifications", ctx)) {
return ResponseEntity.ok(richNotificationService.getAll(user));
}
return ResponseEntity.ok(notificationService.getAll(user));
}
}@RestController
public class NotificationController {
@GetMapping("/notifications")
public ResponseEntity<List<Notification>> getNotifications(Principal user) {
return ResponseEntity.ok(richNotificationService.getAll(user));
}
}FlagShark uses Annotation scanning and Java AST for SDK method detection to find every call to isEnabled(), getVariant(), getAllToggles()across your Spring Boot, Micronaut 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 custom strategies defined as Spring beans keep a reference to the toggle indirectly — removing the toggle from your code without removing the strategy class leaves an orphaned bean that Unleash still evaluates on every poll.
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 scans for `Unleash` interface injections and traces `isEnabled()` and `getVariant()` calls across your Spring bean graph. It also identifies custom `Strategy` implementations registered with the Unleash client.
Yes. FlagShark detects custom strategy classes that implement `Strategy` and correlates them with toggle configurations. When a toggle is removed, it marks the associated strategy for cleanup.
FlagShark identifies `ToggleBootstrapHandler` and event listener registrations. When toggles are removed, it highlights orphaned listeners that no longer serve a purpose.
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.
Detect and safely remove stale Unleash feature toggles from Rails applications and Ruby services.
Use Rust's type system and FlagShark to find and remove dead Unleash toggles from Actix and Axum services.
Practical guide to removing stale LaunchDarkly flags from Spring Boot and Micronaut applications.
Systematically find and remove stale Split.io treatments from Spring Boot and Micronaut applications.
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.