Loading...
ConfigCat's Java SDK integrates smoothly with Spring Boot, but enterprise Java projects tend to wrap it in service layers, configuration beans, and abstract factories. FlagShark cuts through the abstraction to find every `getValue` call.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
@Service
public class OnboardingService {
private final ConfigCatClient configCat;
public OnboardingService(ConfigCatClient configCat) {
this.configCat = configCat;
}
public OnboardingFlow getFlow(String userId) {
ConfigCatUser user = ConfigCatUser.newBuilder().build(userId);
boolean useGuided = configCat.getValue(Boolean.class, "guided_onboarding", user, false);
if (useGuided) {
return new GuidedOnboardingFlow(userId);
}
return new ClassicOnboardingFlow(userId);
}
}@Service
public class OnboardingService {
public OnboardingFlow getFlow(String userId) {
return new GuidedOnboardingFlow(userId);
}
}FlagShark uses Annotation scanning and Java AST for SDK method detection to find every call to getValue(), getValueDetails(), getAllKeys()across your Spring Boot, Micronaut codebase.
Each detected flag key is matched against your ConfigCat 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.
ConfigCat's Java client uses generics for `getValue<T>()` — the type parameter affects what default value is expected, and removing the flag means you need to inline a value of the correct type, not just `true` or `false`.
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.
getValue()getValueDetails()getAllKeys()Plus custom patterns you define in .flagshark.yaml
FlagShark scans for `ConfigCatClient` bean injections and traces every `getValue()` and `getValueDetails()` call, including the generic type parameter. It resolves flag keys from string literals and constants.
Yes. FlagShark detects ConfigCat lifecycle hooks like `onConfigChanged` and `onFlagEvaluated`. When flags are removed, it marks unused hook registrations for cleanup.
FlagShark scans test source sets alongside main sources. When a flag is removed from production code, it identifies test mocks and fixtures that reference the same flag key.
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 stale ConfigCat feature flags from React and Node.js TypeScript projects.
Find and remove stale ConfigCat flags from Django, FastAPI, and Flask Python applications.
Use Roslyn analyzers and FlagShark to find and remove stale ConfigCat flags from ASP.NET Core and .NET 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 Unleash toggles from Spring Boot applications and Java microservices.
Find and remove dead PostHog flags from Spring Boot and Java backend services.