MCPcopy Index your code
hub / github.com/BishopFox/cloudfox / getCodeCommitRepositoriesPerRegion

Method getCodeCommitRepositoriesPerRegion

aws/inventory.go:2649–2688  ·  view source on GitHub ↗
(r string, wg *sync.WaitGroup, semaphore chan struct{})

Source from the content-addressed store, hash-verified

2647}
2648
2649func (m *Inventory2Module) getCodeCommitRepositoriesPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) {
2650 defer func() {
2651 wg.Done()
2652 m.CommandCounter.DecrExecuting()
2653 m.CommandCounter.IncrComplete()
2654 }()
2655 semaphore <- struct{}{}
2656 defer func() {
2657 <-semaphore
2658 }()
2659 // m.CommandCounter.IncrTotal()
2660 m.CommandCounter.DecrPending()
2661 m.CommandCounter.IncrExecuting()
2662 var totalCountThisServiceThisRegion = 0
2663 var service = "CodeCommit Repositories"
2664 var resourceNames []string
2665
2666 repos, err := sdk.CachedCodeCommitListRepositories(m.CodeCommitClient, aws.ToString(m.Caller.Account), r)
2667 if err != nil {
2668 m.modLog.Error(err.Error())
2669 m.CommandCounter.IncrError()
2670 return
2671 }
2672
2673 // Add this page of resources to the total count
2674 totalCountThisServiceThisRegion = totalCountThisServiceThisRegion + len(repos)
2675
2676 // Add this page of resources to the module's resource list
2677 for _, repo := range repos {
2678 arn := "arn:aws:codecommit:" + r + ":" + aws.ToString(m.Caller.Account) + ":" + aws.ToString(repo.RepositoryName)
2679 resourceNames = append(resourceNames, arn)
2680 }
2681
2682 m.mu.Lock()
2683 m.resources = append(m.resources, resourceNames...)
2684 m.serviceMap[service][r] = totalCountThisServiceThisRegion
2685 m.totalRegionCounts[r] = m.totalRegionCounts[r] + totalCountThisServiceThisRegion
2686 m.serviceMap["total"][r] = m.serviceMap["total"][r] + totalCountThisServiceThisRegion
2687 m.mu.Unlock()
2688}
2689
2690func (m *Inventory2Module) getCodeDeployApplicationsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) {
2691 defer func() {

Callers 1

executeChecksMethod · 0.95

Calls 7

DecrExecutingMethod · 0.80
IncrCompleteMethod · 0.80
DecrPendingMethod · 0.80
IncrExecutingMethod · 0.80
ErrorMethod · 0.80
IncrErrorMethod · 0.80

Tested by

no test coverage detected