MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / emitLeaf

Function emitLeaf

src/resolution/frameworks/java.ts:360–382  ·  view source on GitHub ↗
(dottedKey: string, line: number, valueText: string)

Source from the content-addressed store, hash-verified

358 const now = Date.now();
359
360 const emitLeaf = (dottedKey: string, line: number, valueText: string) => {
361 if (!dottedKey) return;
362 nodes.push({
363 id: `spring-config:${filePath}:${line}:${dottedKey}`,
364 kind: 'constant',
365 name: dottedKey.split('.').pop() ?? dottedKey,
366 qualifiedName: dottedKey,
367 filePath,
368 startLine: line,
369 endLine: line,
370 startColumn: 0,
371 endColumn: valueText.length,
372 language: lang,
373 signature: dottedKey,
374 // SECURITY (#383): store the KEY only, never the value. Config files
375 // routinely hold secrets (DB passwords, API keys, JDBC URLs with embedded
376 // credentials), and surfacing the value here pushes it into agent context
377 // unbidden (it lands in codegraph_node/explore output via the docstring).
378 // The key is all `@Value`/`@ConfigurationProperties` resolution needs; an
379 // agent that genuinely needs a value can read the file directly.
380 updatedAt: now,
381 });
382 };
383
384 if (isProperties) {
385 // Properties format: `k1.k2.k3 = value` (or `:` separator, or no value).

Callers 1

extractSpringConfigFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected