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

Function categorizeFile

src/tools/codegraph/quality.ts:61–76  ·  view source on GitHub ↗
(rel: string)

Source from the content-addressed store, hash-verified

59}
60
61function categorizeFile(rel: string): string {
62 const l = rel.toLowerCase();
63 if (/\.(test|spec)\.|__tests__|\/tests?\//.test(l)) return 'tests';
64 if (/^(src\/)?(index|main|app|server|cli|bin)\b/.test(l)) return 'entry';
65 if (/\/(routes?|api|controllers?|handlers?|endpoints?)\//.test(l)) return 'routes/controllers';
66 if (/\/(services?|business|domain|logic)\//.test(l)) return 'services';
67 if (/\/(models?|entities|schema|db)\//.test(l)) return 'data/models';
68 if (/\/(components?|widgets?|ui|views?|screens?|pages?)\//.test(l)) return 'ui';
69 if (/\/(hooks?|composables?)\//.test(l)) return 'hooks';
70 if (/\/(utils?|helpers?|common|shared|lib)\//.test(l)) return 'utils';
71 if (/\/(config|configs|settings)\//.test(l) || /\.config\.[jt]sx?$/.test(l)) return 'config';
72 if (/\/(types?|interfaces?|dto)\//.test(l) || /\.d\.ts$/.test(l)) return 'types';
73 if (/\/(migrations?|seeds?)\//.test(l)) return 'migrations';
74 if (/\/(middleware|guards?)\//.test(l)) return 'middleware';
75 return 'other';
76}
77
78// ─────────────────────────────────────────────────────────────────────────────
79// explain_codebase

Callers 1

executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected