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

Function detectLanguages

src/tools/codegraph/project-overview.ts:109–121  ·  view source on GitHub ↗
(files: FileStat[])

Source from the content-addressed store, hash-verified

107}
108
109function detectLanguages(files: FileStat[]): Record<string, { files: number; lines: number }> {
110 const stats: Record<string, { files: number; lines: number }> = {};
111 for (const f of files) {
112 const ext = path.extname(f.path).toLowerCase().slice(1);
113 if (!ext) continue;
114 const lang = LANG_BY_EXT[ext];
115 if (!lang) continue;
116 if (!stats[lang]) stats[lang] = { files: 0, lines: 0 };
117 stats[lang].files++;
118 stats[lang].lines += f.lines;
119 }
120 return stats;
121}
122
123const LANG_BY_EXT: Record<string, string> = {
124 ts: 'TypeScript', tsx: 'TypeScript', js: 'JavaScript', jsx: 'JavaScript',

Callers 1

executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected