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

Function computeScope

cmd/intent.go:151–168  ·  view source on GitHub ↗

computeScope determines whether the task touches one file, one package, or crosses packages.

(files []string)

Source from the content-addressed store, hash-verified

149
150// computeScope determines whether the task touches one file, one package, or crosses packages.
151func computeScope(files []string) string {
152 if len(files) == 0 {
153 return "unknown"
154 }
155 if len(files) == 1 {
156 return "single-file"
157 }
158
159 packages := make(map[string]struct{})
160 for _, f := range files {
161 packages[filepath.Dir(f)] = struct{}{}
162 }
163
164 if len(packages) <= 1 {
165 return "package"
166 }
167 return "cross-cutting"
168}
169
170// analyzeRisk evaluates hub involvement and generates context suggestions.
171func analyzeRisk(files []string, info *hubInfo, category string) (string, []ContextSuggestion) {

Callers 2

TestComputeScopeFunction · 0.85
classifyIntentFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestComputeScopeFunction · 0.68