sourcegraph/sourcegraph-public-snapshot

insights: refactor capture group methods for readability and performance

オープン

#33,148 opened on 2022/03/28

 (11 件のコメント) (0 件のリアクション) (0 人の担当者)Go (1,374 件のフォーク)auto 404
backendcode-insightsgood first issue

Repository metrics

Stars
 (10,290 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド