[AI assisted] MM-62755: Refactor scanning to map to a util (#30780)

With some neat generics, I was able to refactor
the scanning to a util function. I used it to
refactor 3 places and also removed an unnecessary method.

Claude was quite good here.

https://mattermost.atlassian.net/browse/MM-62755
```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2025-04-28 19:21:12 +05:30
коммит произвёл GitHub
родитель cd5523f5fb
Коммит efde5e2717
4 изменённых файлов: 178 добавлений и 50 удалений

3
.gitignore поставляемый
Просмотреть файл

@@ -160,4 +160,7 @@ docker-compose.override.yaml
.aider*
.env
**/CLAUDE.local.md
CLAUDE.md