Skip to main content

Identifying Technical Debt: Stale Feature Flags in ConfigCat

· 5 min read
Zoltan David
One with a vision, answers and a master plan.
Chavez Harris
Inspiration does exist, but it must find you writing code.

Feature flags help teams release features safely and quickly, but if left unmanaged, they can become stale and accumulate technical debt. To keep your codebase clean, you can use the Zombie Flags page, the Zombie Flags Report, and the Zombie Flags API. Let’s take a closer look at each of them.

ConfigCat Zombie Flags Report cover

What Are Zombie (Stale) Feature Flags

Zombie or stale feature flags are flags that are no longer needed or rarely used. Left behind in the codebase, they quietly build up technical debt, create confusion, and increase the risk of bugs. Regularly identifying and removing them is key to keeping your code clean and maintainable.

A stale feature flag is one that:

  • Controls a feature that has already been permanently released
  • Hasn't been toggled in a long time
  • Was used in a one-time rollout but never removed
  • Lingers even after a final decision (ON or OFF) has been made

Zombie feature flags make your code harder to read, maintain, and test.

How ConfigCat Helps You Detect Zombie Flags

The Zombie Flags Page

The Zombie Flags page in the dashboard is the quickest way to see all your zombie flags in one place. It displays your Zombie Flags in an auto-filtered table based on the filters set:

  • Inactivity: How long the flag was inactive.
  • Feature flag scope: Choose between all feature flags or only those you are watching.
  • Included environments: The ConfigCat environment(s) to include in the analysis.
  • Ignored flags based on tags: Exclude flags based on assigned tags.
  • Stale in all/any selected environments: Choose whether to include flags that are stale in all or any of the selected environments.
  • Filter by config or feature flag name: Start typing to filter the list automatically.
The Zombie Flags page in the ConfigCat dashboard

The Zombie Flags Report

ConfigCat's Zombie Flags Report sends automated emails listing feature flags that haven't changed in a while. You get full control over:

  • Receive report via email: Turn on email notifications and set the frequency (daily, weekly, monthly).
  • Criteria: Define how long a flag must be inactive before it's marked as stale.
  • Scope: Include all flags or only watched ones.
  • Environment: Choose the ConfigCat environment(s) you want to analyze.
  • Tags: Exclude specific flags based on tags.
  • Stale in all/any selected environments: Choose whether to include flags that are stale in all or any of the selected environments.
My Zombie Flags Report page

You can access this page in the ConfigCat dashboard, by clicking your Organization name at the top right, then selecting My Zombie Flags Report.

Navigating to My Zombie Flags Report

Sample Email Report

Based on your Zombie Flags Report settings, the email you receive should look similar to the one below:

My Zombie Flags Report email sample

The Zombie Flags API

The Zombie Flags API allows programmatic access to zombie flag data. This is useful for integrating flag cleanup processes into your CI/CD workflows or internal tooling.

You can use tools like Postman to retrieve zombie flag data via the API for testing or integration. Here's a preview of what it looks like in Postman:

Using the Zombie Flags API in Postman

Other Tools for Identifying Unused Feature Flags

Here are some alternative methods for identifying stale feature flags:

  • Scan & Upload Code References to track feature flags in your code.
  • The ConfigCat CLI finds feature flags in your code that were removed from the dashboard.
  • GitHub Action and CircleCI Orb find feature flags in your code that you might want to remove.
  • Bitrise Step scans your source code for feature flag and setting usages and upload the found code references to ConfigCat.
  • Bitbucket Pipe scans your source code for feature flag and setting usages and upload the found code references to ConfigCat.

Conclusion

Feature flags play a major role in nearly every feature release, offering significant benefits for controlling and managing features across tech stacks. While they are a favorite tool among developers, it is essential to keep track of them to prevent them from going stale and adding to your technical debt.

Fortunately, ConfigCat makes this easy with the methods outlined in this post. Now that you can spot the zombie flags, you have the power to prevent them from creeping up—and if they are already in your code, eliminate them. Happy Feature Flagging!

Follow ConfigCat on Facebook, X, LinkedIn, and GitHub for more articles and other announcements.