A Node.js utility to visualize and analyze dependencies between feature flags in a Split.io configuration.
This tool analyzes feature flag configurations to identify dependencies where a flag has a matcher of type 'IN_SPLIT', and the splitName referenced in the depends object matches the name of another feature flag in the system.
- 📊 Dependency Graph: Generates a visual graph showing flag dependencies using Graphviz
- 📝 HTML Report: Creates a detailed HTML report with dependency relationships
- 📋 Dependency Analysis: Shows which flags are most depended upon and which flags depend on others
-
Ensure you have Node.js installed on your system.
-
Clone or download this repository.
-
Install Node.js dependencies:
npm init -y npm install graphviz -
Install Graphviz on your system:
- On macOS:
brew install graphviz - On Linux:
apt-get install graphviz - On Windows: Download from Graphviz website
- On macOS:
-
Place your
flag_data.jsonfile (containing the Split.io feature flag configurations) in the same directory as the script. You can retrieve this using the admin api's endpoint to list feature flag definitions -
Run the script:
node visualize_dependencies.js -
Two output files will be generated:
flag_dependencies.png: A visualization of the flag dependenciesflag_dependencies_report.html: A detailed HTML report showing all dependencies
The graph visualization shows:
- Blue nodes: Flags that depend on other flags
- Green nodes: Flags that are depended upon
- Arrows: Direction of dependency (from dependent flag to dependency)
The tool prints summary information to the console, including:
- Total count of flags with dependencies
- Total number of dependency relationships
- Flags that are most depended upon by other flags
- Flags that depend on the most other flags
The HTML report provides:
- Summary statistics
- A table view of all dependencies
- Detailed cards for each flag showing:
- Flag ID
- Flags it depends on
- Flags that depend on it
A dependency is considered to exist when:
- A feature flag has a rule with a matcher of type 'IN_SPLIT'
- The matcher's
depends.splitNameproperty matches the name of another flag in the dataset
Contributions are welcome! Feel free to submit a Pull Request.
