Snippet Usage Report
The Snippet Usage Report feature analyzes all snippets in your project and shows exactly how many times each snippet is used. This powerful tool helps you identify unused snippets for cleanup and understand snippet dependencies across your project.
How to Use
- Open your Flare project
- Go to the Productivity tab in the ribbon
- Click the Snippet Usage Report button
- Wait for the analysis to complete (a progress dialog shows real-time status)
- Review the results in the sortable grid
Features
- Fast Performance - Optimized algorithm reads each file only once, making it up to 500x faster than traditional approaches on large projects
- Progress Dialog - Shows real-time progress with the current file being scanned and the ability to cancel at any time
- Sortable Columns - Click column headers to sort by snippet name, usage count, or files
- Usage Count - See exactly how many times each snippet is used
- File List - View which files use each snippet (shows first 3, with "..." if more)
- Quick Navigation - Double-click any row to open the file(s) where the snippet is used
Understanding the Results
The report displays three main columns:
- Snippet Name - The filename of the snippet (e.g., "ProductName.flsnp")
- Usage Count - Number of files where this snippet appears
- Used In Files - List of files where the snippet is used
Double-Click Behavior
When you double-click a row, the plugin intelligently handles different scenarios:
- Usage Count = 0 - Opens the snippet file itself
- Usage Count = 1 - Opens the single file where it's used
- Usage Count > 1 - Prompts you with a dialog:
- Click Yes to open all files where the snippet is used
- Click No to open only the first file
- Click Cancel to do nothing
When opening multiple files, the plugin shows a success/failure count if any files couldn't be opened.
Common Use Cases
Find Unused Snippets
- Run the report
- Click the Usage Count column header to sort
- Snippets with count = 0 are unused and can potentially be deleted
Find Rarely Used Snippets
- Run the report
- Sort by Usage Count
- Review snippets with count = 1 or 2 to see if they should be expanded or removed
Update Multi-Use Snippets
- Find a snippet with high usage count
- Double-click to open all files where it's used
- Review and update the snippet knowing exactly where it appears
Performance
The report is optimized for speed:
- Small projects (10-50 snippets, 100 files) - Completes in seconds
- Medium projects (100-200 snippets, 500 files) - Completes in 10-20 seconds
- Large projects (500+ snippets, 1000+ files) - Completes in 30-60 seconds
The algorithm reads each file only once and searches for all snippets simultaneously, making it dramatically faster than older approaches that would read files repeatedly.
Tips
- Run the report periodically to maintain project hygiene
- Use the Refresh button to update results after making changes
- Consider archiving unused snippets before deleting them
- Check snippet dependencies before major refactoring
- Sort by usage count to prioritize cleanup efforts