MCPcopy
hub / github.com/colbymchenry/codegraph / isLowValueFile

Function isLowValueFile

src/db/queries.ts:32–48  ·  view source on GitHub ↗

* Path-only heuristic for files that should not be candidates for * "dominant file" detection: test/spec files and tool-generated files. * Generated files (`*.pb.go`, `*.pulsar.go`, mock outputs, …) often * have huge in-file edge counts that dwarf the real source — etcd's * `rpc.pb.go` has 4× th

(filePath: string)

Source from the content-addressed store, hash-verified

30 * `rpc.pb.go` has 4× the in-file edges of `server.go`.
31 */
32function isLowValueFile(filePath: string): boolean {
33 const lp = filePath.toLowerCase();
34 return (
35 /(?:^|\/)(tests?|__tests?__|spec)\//.test(lp) ||
36 /_test\.go$/.test(lp) ||
37 /(?:^|\/)test_[^/]+\.py$/.test(lp) ||
38 /_test\.py$/.test(lp) ||
39 /_spec\.rb$/.test(lp) ||
40 /_test\.rb$/.test(lp) ||
41 /\.(test|spec)\.[jt]sx?$/.test(lp) ||
42 /(test|spec|tests)\.(java|kt|scala)$/.test(lp) ||
43 /(tests?|spec)\.cs$/.test(lp) ||
44 /tests?\.swift$/.test(lp) ||
45 /_test\.dart$/.test(lp) ||
46 isGeneratedFile(filePath)
47 );
48}
49
50const SQLITE_PARAM_CHUNK_SIZE = 500;
51

Callers 3

getDominantFileMethod · 0.85
getTopRouteFileMethod · 0.85
getRoutingManifestMethod · 0.85

Calls 1

isGeneratedFileFunction · 0.90

Tested by

no test coverage detected