sourcegraph/sourcegraph-public-snapshot

insights: refactor capture group methods for readability and performance

Offen

#33.148 geöffnet am 28.03.2022

 (11 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (1.374 Forks)auto 404
backendcode-insightsgood first issue

Repository-Metriken

Stars
 (10.290 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

When a capture group insight is created, we tally up matches per capture group using MatchValues and Counts methods on ComputeMatchContext. We then group them in the method GroupByCaptureMatch.

The current logic uses many nested for loops. The aim of this ticket is to look into simplifying this logic. What we want at the end is a map of unique capture group values to their count.

Contributor Guide