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

Method buildSignature

src/extraction/mybatis-extractor.ts:257–270  ·  view source on GitHub ↗
(elemType: string, attrs: string, isSqlFragment: boolean)

Source from the content-addressed store, hash-verified

255 }
256
257 private buildSignature(elemType: string, attrs: string, isSqlFragment: boolean): string {
258 if (isSqlFragment) return '<sql>';
259 const verb = elemType.toUpperCase();
260 const result = /\bresultType\s*=\s*(["'])([^"']+)\1/.exec(attrs)?.[2];
261 const param = /\bparameterType\s*=\s*(["'])([^"']+)\1/.exec(attrs)?.[2];
262 // A vendor-split statement carries `databaseId`; surface it so the two
263 // otherwise-identical `<namespace>::<id>` nodes are distinguishable.
264 const dbId = /\bdatabaseId\s*=\s*(["'])([^"']+)\1/.exec(attrs)?.[2];
265 const parts = [verb];
266 if (param) parts.push(`param=${param}`);
267 if (result) parts.push(`result=${result}`);
268 if (dbId) parts.push(`databaseId=${dbId}`);
269 return parts.join(' ');
270 }
271
272 /**
273 * Build the `<namespace>::<id>` qualified name the MyBatis synthesizer

Callers 1

extractMapperMethod · 0.95

Calls 2

execMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected