Files
beads/analyze_duplicates.sh
Steve Yegge ef31d98b43 Fix bd-666: Replace N+1 query pattern in auto-import with batch fetch
- Batch fetch all existing issues with SearchIssues() upfront
- Use O(1) map lookup instead of O(n) GetIssue() calls
- Improves performance dramatically with 1000+ issues
- All tests pass
2025-10-16 19:14:17 -07:00

14 lines
397 B
Bash
Executable File

#!/bin/bash
# Analyze duplicate issues
echo "# Duplicate Issues Report"
echo ""
echo "Generated: $(date)"
echo ""
./bd list --json | jq -r 'group_by(.title) | .[] | select(length > 1) | {
title: .[0].title,
count: length,
issues: [.[] | {id, status, created_at}]
} | "## \(.title)\nCount: \(.count)\n" + (.issues | map("- \(.id) (\(.status)) created \(.created_at)") | join("\n")) + "\n"'