MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / suggestName

Function suggestName

src/codegraph/helper-extract.ts:69–79  ·  view source on GitHub ↗

A shared-helper name: common words across the member names, else a common prefix, else generic.

(names: string[])

Source from the content-addressed store, hash-verified

67
68/** A shared-helper name: common words across the member names, else a common prefix, else generic. */
69function suggestName(names: string[]): string {
70 const wordSets = names.map(splitWords);
71 if (wordSets.length && wordSets[0]!.length) {
72 const common = wordSets[0]!.filter(w => wordSets.every(set => set.includes(w)));
73 if (common.length) {
74 const [head, ...rest] = common;
75 return head + rest.map(w => w[0]!.toUpperCase() + w.slice(1)).join('');
76 }
77 }
78 return 'extractedHelper';
79}
80
81/**
82 * Cluster functions into near-duplicate groups by structural similarity. Returns clusters of ≥2,

Callers 1

findSimilarHelpersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected