Code references

Finding all references to a flag from within a codebase is a simple problem - at first. It's relatively easy to search across all your code files for the name of a flag. It can be more complicated to search across all branches in your code repository, or multiple repositories. If your code has aliases or function wrappers for each flag - for example, if the flag enable-search-bar is wrapped in a function called enableSearchBar() - then you need to find those names as well.

LaunchDarkly's Code References feature makes it easier to find flag references in your code, across all your repositories. It can find flag names and their aliases, based on patterns which you configure. The matching lines of code are then presented as part of the LaunchDarkly dashboard.

To see the code references for a particular flag, go to that flag's page and click the Code References tab:

Code References

In the image above, you can see the code references for a flag named show-widgets.

In the next step, you'll clean up the code for a flag you created earlier.