MCPcopy Create free account
hub / github.com/JordanCoin/codemap / AdaptiveDepth

Function AdaptiveDepth

limits/limits.go:26–37  ·  view source on GitHub ↗

AdaptiveDepth returns a safe tree depth based on repository size. Unknown file count (<=0) defaults to a conservative depth.

(fileCount int)

Source from the content-addressed store, hash-verified

24// AdaptiveDepth returns a safe tree depth based on repository size.
25// Unknown file count (<=0) defaults to a conservative depth.
26func AdaptiveDepth(fileCount int) int {
27 if fileCount <= 0 {
28 return 2
29 }
30 if fileCount > LargeRepoFileCount {
31 return 2
32 }
33 if fileCount > MediumRepoFileCount {
34 return 3
35 }
36 return 4
37}

Callers 3

hookSessionStartFunction · 0.92
handleGetStructureFunction · 0.92
TestAdaptiveDepthFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestAdaptiveDepthFunction · 0.68