Refactor WebIdeCommitsCount class
What does this MR do?
In preparation for https://gitlab.com/gitlab-org/gitlab-ce/issues/63886 and https://gitlab.com/gitlab-org/gitlab-ce/issues/63887, we're refactoring the logic in WebIdeCommitsCount
class to reuse it in other places.
Does this MR meet the acceptance criteria?
Conformity
- [ ] Changelog entry
- [ ] Documentation created/updated or follow-up review issue created
- [ ] Database guides